{"raw_statement":[{"iden":"statement","content":"Bob is an aspiring archaeologist. He has found n ancient scrolls, each with an unusual sum written on it. The sum on the i-th scroll reads as \n\nBob thinks that precise values of these sums encode the location of Aldoredo, the not-so-famous city of gold. Help him calculate the values of the sums!\n\nThe first line contains a single integer n, the number of scrolls (1 ≤ n ≤ 105). The i-th of the next n lines contains two space-separated integer numbers li and ri, the description of the sum on the i-th scroll (1 ≤ li ≤ ri ≤ 1018).\n\nOutput n lines: in the i-th line output the value of the sum written on the i-th scroll. Your answer will be considered correct if its relative or absolute error doesn't exceed 10 - 9.\n\n"},{"iden":"input","content":"The first line contains a single integer n, the number of scrolls (1 ≤ n ≤ 105). The i-th of the next n lines contains two space-separated integer numbers li and ri, the description of the sum on the i-th scroll (1 ≤ li ≤ ri ≤ 1018)."},{"iden":"output","content":"Output n lines: in the i-th line output the value of the sum written on the i-th scroll. Your answer will be considered correct if its relative or absolute error doesn't exceed 10 - 9."},{"iden":"examples","content":"Input31 234 764 4Output0.6666666666670.0164247517190.050000000000"}],"translated_statement":null,"sample_group":[],"show_order":[],"formal_statement":"**Definitions**  \nLet $ n \\in \\mathbb{Z} $ be the number of scrolls.  \nFor each scroll $ i \\in \\{1, \\dots, n\\} $, let $ l_i, r_i \\in \\mathbb{Z} $ denote the bounds of the sum, with $ 1 \\leq l_i \\leq r_i \\leq 10^{18} $.\n\n**Constraints**  \n1. $ 1 \\leq n \\leq 10^5 $  \n2. For each $ i \\in \\{1, \\dots, n\\} $: $ 1 \\leq l_i \\leq r_i \\leq 10^{18} $\n\n**Objective**  \nFor each scroll $ i $, compute the sum:  \n$$\nS_i = \\sum_{k=l_i}^{r_i} k\n$$  \nwhich simplifies to:  \n$$\nS_i = \\frac{(r_i - l_i + 1)(l_i + r_i)}{2}\n$$","simple_statement":"For each scroll, given two integers l and r, compute the sum of all integers from l to r inclusive.","has_page_source":false}