#A. [ROIR 2022 Day 2] 幼儿园的新年

    Type: RemoteJudge 1000ms 128MiB

[ROIR 2022 Day 2] 幼儿园的新年

You cannot submit for this problem because the contest is ended. You can click "Open in Problem Set" to view this problem in normal mode.

题目背景

翻译简化自 ROIR 2022 D2T1

题目描述

给出三个整数 n,a,bn,a,b,求有多少对 (x,y)(x,y) 满足 0xa0 \le x \le a0yb0 \le y \le bx+yx+y 不为 00 且能被 nn 整除。

输入格式

本题多测,第一行输入一个整数 tt,表示测试数据的组数。

接下来的 tt 行,每行输入一组测试数据 n,a,bn,a,b,由空格隔开。

输出格式

对于每组数据,输出一行一个数字,即符合条件的 (x,y)(x,y) 数量。

4
4 2 2
4 4 4
6 5 5
8 13 17
1
6
5
30

提示

本题使用捆绑测试。

子任务 分值 特殊性质
11 1010 t=1t=1a,b1000a,b\le1000
22 t1000t\le1000a=0a=0
33 1515 t1000t\le1000a,b<n1000a,b<n\le1000
44 1010 t1000t\le1000a,b1000a,b\le1000
55 1515 t=1t=1n1000n\le1000
66 1010 t1000t\le1000n1000n\le1000
77 3030 无特殊性质

对于 100%100\% 的数据,1t1051 \le t \le 10^54n1094 \le n \le 10^90a,b1090 \le a, b \le 10^9

1125集训

Not Attended
Status
Done
Rule
IOI
Problem
5
Start at
2024-11-25 17:30
End at
2024-11-25 21:30
Duration
4 hour(s)
Host
Partic.
24