{"problem":{"name":"B = C","description":{"content":"How many triples $A,B,C$ of integers between $L$ and $R$ (inclusive) satisfy $A-B=C$? You will be given $T$ cases. Solve each of them.","description_type":"Markdown"},"platform":"AtCoder","limit":{"time_limit":2000,"memory_limit":262144},"difficulty":"None","is_remote":true,"is_sync":true,"sync_url":null,"sign":"arc112_a"},"statements":[{"statement_type":"Markdown","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.\n\n## Constraints\n\n*   $1 \\leq T \\leq 2\\times 10^4$\n*   $0\\le L \\le R \\le 10^6$\n*   All values in input are integers.\n\n## Input\n\nInput 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$\n\n[samples]","is_translate":false,"language":"English"}],"meta":{"iden":"arc112_a","tags":[],"sample_group":[["5\n2 6\n0 0\n1000000 1000000\n12345 67890\n0 1000000","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$"]],"created_at":"2026-03-03 11:01:14"}}