{"problem":{"name":"[CoE R5] 暴龙的白菜","description":{"content":"给定一个字符串，由 $1$ 个 $\\texttt{1}$，$2$ 个 $\\texttt{2}$，$3$ 个 $\\texttt{3}$，$4$ 个 $\\texttt{4}$，$5$ 个 $\\texttt{5}$，$6$ 个 $\\texttt{6}$，$7$ 个 $\\texttt{7}$，$8$ 个 $\\texttt{8}$，$9$ 个 $\\texttt{9}$，$10$ 个 $\\texttt{10}","description_type":"Markdown"},"platform":"Luogu","limit":{"time_limit":1000,"memory_limit":131072},"difficulty":{"LuoguStyle":"P2"},"is_remote":true,"is_sync":true,"sync_url":null,"sign":"LGP8577"},"statements":[{"statement_type":"Markdown","content":"给定一个字符串，由 $1$ 个 $\\texttt{1}$，$2$ 个 $\\texttt{2}$，$3$ 个 $\\texttt{3}$，$4$ 个 $\\texttt{4}$，$5$ 个 $\\texttt{5}$，$6$ 个 $\\texttt{6}$，$7$ 个 $\\texttt{7}$，$8$ 个 $\\texttt{8}$，$9$ 个 $\\texttt{9}$，$10$ 个 $\\texttt{10}$……以此类推，依次拼接而成。\n\n询问字符串第 $l$ 位到第 $r$ 位的数字之和。\n\n## Input\n\n**输入包含多组测试数据。**\n\n第一行一个正整数 $T$。\n\n接下来 $T$ 组问询，每次两个正整数 $l,r$。\n\n## Output\n\n$T$ 行，每行一个整数代表答案。\n\n[samples]\n\n## Background\n\n暴龙爱吃白菜。\n\n## Note\n\n**样例解释**\n\n字符串为：\n\n$$\\texttt{12233344445555566666677777778888888899999999910101010101010101010}\\cdots\\cdots$$\n\n对于第一组询问，第 $5$ 位到第 $9$ 位的数字之和为 $3+3+4+4+4=18$。\n\n对于第二组询问，第 $46$ 位到第 $50$ 位的数字之和为 $1 + 0 + 1 + 0 + 1 = 3$。\n\n------------\n\n**数据范围**\n\n**本题采用捆绑测试。**\n\n- $\\texttt{Subtask 1(10 pts)：}T=1$，$1\\le l\\le r\\le 10$；\n- $\\texttt{Subtask 2(20 pts)：}1\\le T\\le 10$，$1\\le l\\le r\\le 10^3$；\n- $\\texttt{Subtask 3(30 pts)：}1\\le T\\le 10^3$，$1\\le l\\le r\\le 10^5$；\n- $\\texttt{Subtask 4(40 pts)：}$无特殊限制。\n\n对于 $100\\%$ 的数据，满足 $1\\le T\\le 10^5$，$1\\le l\\le r\\le 10^6$。","is_translate":false,"language":"English"}],"meta":{"iden":"LGP8577","tags":["模拟","洛谷原创","O2优化","前缀和","洛谷月赛"],"sample_group":[["4\n5 9\n46 50\n114 514\n19 19810","18\n3\n1134\n74924"]],"created_at":"2026-03-03 11:09:25"}}