{"problem":{"name":"[ROIR 2022] 幼儿园的新年 (Day 2)","description":{"content":"给出三个整数 $n,a,b$，求有多少对 $(x,y)$ 满足 $0 \\le x \\le a$，$0 \\le y \\le b$，$x+y$ 不为 $0$ 且能被 $n$ 整除。","description_type":"Markdown"},"platform":"Luogu","limit":{"time_limit":1000,"memory_limit":131072},"difficulty":{"LuoguStyle":"P4"},"is_remote":true,"is_sync":true,"sync_url":null,"sign":"LGP10090"},"statements":[{"statement_type":"Markdown","content":"给出三个整数 $n,a,b$，求有多少对 $(x,y)$ 满足 $0 \\le x \\le a$，$0 \\le y \\le b$，$x+y$ 不为 $0$ 且能被 $n$ 整除。\n\n## Input\n\n本题多测，第一行输入一个整数 $t$，表示测试数据的组数。\n\n接下来的 $t$ 行，每行输入一组测试数据 $n,a,b$，由空格隔开。\n\n## Output\n\n对于每组数据，输出一行一个数字，即符合条件的 $(x,y)$ 数量。\n\n[samples]\n\n## Background\n\n翻译简化自 [ROIR 2022 D2T1](https://neerc.ifmo.ru/school/archive/2021-2022/ru-olymp-regional-2022-day2.pdf)。\n\n## Note\n\n本题使用捆绑测试。\n\n| 子任务 | 分值 | 特殊性质 |\n| :----------: | :----------: | :----------: |\n| $1$ | $10$ | $t=1$ 且 $a,b\\le1000$ |\n| $2$ | $10$ | $t\\le1000$ 且 $a=0$ |\n| $3$ | $15$ | $t\\le1000$ 且 $a,b<n\\le1000$ |\n| $4$ | $10$ | $t\\le1000$ 且 $a,b\\le1000$ |\n| $5$ | $15$ | $t=1$ 且 $n\\le1000$ |\n| $6$ | $10$ | $t\\le1000$ 且 $n\\le1000$ |\n| $7$ | $30$ | 无特殊性质 |\n\n对于 $100\\%$ 的数据，$1 \\le t \\le 10^5$，$4 \\le n \\le 10^9$，$0 \\le a, b \\le 10^9$。","is_translate":false,"language":"English"}],"meta":{"iden":"LGP10090","tags":["数学","2022","Special Judge","ROIR（俄罗斯）"],"sample_group":[["4\n4 2 2\n4 4 4\n6 5 5\n8 13 17","1\n6\n5\n30"]],"created_at":"2026-03-03 11:09:25"}}