TopCoder

User's AC Ratio

NaN% (0/0)

Submission's AC Ratio

NaN% (0/0)

Tags

Description

Input Format

Output Format

Sample Input 1

5
3 1
4 2
5 4
10 5
1000000 314159

Sample Output 1

4
12
66
1192320
853363991

Hints

Problem Source

Subtasks

No. Testdata Range Constraints Score
1 0 Sample testcases. 0
2 0~25 No additional constraints. 100

Testdata and Limits

No. Time Limit (ms) Memory Limit (VSS, KiB) Output Limit (KiB) Subtasks
0 4000 2097152 65536 1 2
1 4000 2097152 65536 2
2 4000 2097152 65536 2
3 4000 2097152 65536 2
4 4000 2097152 65536 2
5 4000 2097152 65536 2
6 4000 2097152 65536 2
7 4000 2097152 65536 2
8 4000 2097152 65536 2
9 4000 2097152 65536 2
10 4000 2097152 65536 2
11 4000 2097152 65536 2
12 4000 2097152 65536 2
13 4000 2097152 65536 2
14 4000 2097152 65536 2
15 4000 2097152 65536 2
16 4000 2097152 65536 2
17 4000 2097152 65536 2
18 4000 2097152 65536 2
19 4000 2097152 65536 2
20 4000 2097152 65536 2
21 4000 2097152 65536 2
22 4000 2097152 65536 2
23 4000 2097152 65536 2
24 4000 2097152 65536 2
25 4000 2097152 65536 2