{"raw_statement":[{"iden":"background","content":"翻译简化自 [ROIR 2022 D2T1](https://neerc.ifmo.ru/school/archive/2021-2022/ru-olymp-regional-2022-day2.pdf)。"},{"iden":"statement","content":"给出三个整数 $n,a,b$，求有多少对 $(x,y)$ 满足 $0 \\le x \\le a$，$0 \\le y \\le b$，$x+y$ 不为 $0$ 且能被 $n$ 整除。"},{"iden":"input","content":"本题多测，第一行输入一个整数 $t$，表示测试数据的组数。\n\n接下来的 $t$ 行，每行输入一组测试数据 $n,a,b$，由空格隔开。"},{"iden":"output","content":"对于每组数据，输出一行一个数字，即符合条件的 $(x,y)$ 数量。"},{"iden":"note","content":"本题使用捆绑测试。\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$。"}],"translated_statement":null,"sample_group":[["4\n4 2 2\n4 4 4\n6 5 5\n8 13 17","1\n6\n5\n30"]],"show_order":[],"formal_statement":null,"simple_statement":null,"has_page_source":false}