{"problem":{"name":"Trapezoid Sum","description":{"content":"We have a blackboard with nothing written on it. Takahashi will do $N$ operations to write integers on it. In the $i$\\-th operation, he will write each integer from $A_i$ through $B_i$ once, for a tot","description_type":"Markdown"},"platform":"AtCoder","limit":{"time_limit":2000,"memory_limit":262144},"difficulty":"None","is_remote":true,"is_sync":true,"sync_url":null,"sign":"abc181_b"},"statements":[{"statement_type":"Markdown","content":"We have a blackboard with nothing written on it. Takahashi will do $N$ operations to write integers on it.\nIn the $i$\\-th operation, he will write each integer from $A_i$ through $B_i$ once, for a total of $B_i - A_i + 1$ integers.\nFind the sum of the integers written on the blackboard after the $N$ operations.\n\n## Constraints\n\n*   All values in input are integers.\n*   $1 \\leq N \\leq 10^5$\n*   $1 \\leq A_i \\leq B_i \\leq 10^6$\n\n## Input\n\nInput is given from Standard Input in the following format:\n\n$N$\n$A_1$ $B_1$\n$\\vdots$\n$A_N$ $B_N$\n\n[samples]","is_translate":false,"language":"English"}],"meta":{"iden":"abc181_b","tags":[],"sample_group":[["2\n1 3\n3 5","18\n\nIn the $1$\\-st operation, he will write $1$, $2$, and $3$ on the blackboard.\nIn the $2$\\-nd operation, he will write $3$, $4$, and $5$ on the blackboard.\nThe sum of the integers written is $1+2+3+3+4+5=18$."],["3\n11 13\n17 47\n359 44683","998244353"],["1\n1 1000000","500000500000"]],"created_at":"2026-03-03 11:01:14"}}