{"raw_statement":[{"iden":"problem statement","content":"How many triples $A,B,C$ of integers between $L$ and $R$ (inclusive) satisfy $A-B=C$?\nYou will be given $T$ cases. Solve each of them."},{"iden":"constraints","content":"*   $1 \\leq T \\leq 2\\times 10^4$\n*   $0\\le L \\le R \\le 10^6$\n*   All values in input are integers."},{"iden":"input","content":"Input is given from Standard Input in the following format:\n\n$T$\n$\\text{case}_1$\n$\\vdots$\n$\\text{case}_T$\n\nEach case is in the following format:\n\n$L$ $R$"},{"iden":"sample input 1","content":"5\n2 6\n0 0\n1000000 1000000\n12345 67890\n0 1000000"},{"iden":"sample output 1","content":"6\n1\n0\n933184801\n500001500001\n\nIn the first case, we have the following six triples:\n\n*   $4 - 2 = 2$\n*   $5 - 2 = 3$\n*   $5 - 3 = 2$\n*   $6 - 2 = 4$\n*   $6 - 3 = 3$\n*   $6 - 4 = 2$"}],"translated_statement":null,"sample_group":[],"show_order":["default"],"formal_statement":null,"simple_statement":null,"has_page_source":true}