TopCoder

User's AC Ratio

NaN% (0/0)

Submission's AC Ratio

NaN% (0/0)

Tags

Description

Input Format

Output Format

Sample Input 1

3 2 998244353

Sample Output 1

2

Sample Input 2

4 2 993244853

Sample Output 2

10

Sample Input 3

500000 123456 100000007

Sample Output 3

43861600

Sample Input 4

314159 265358 265531103

Sample Output 4

0

Hints

Problem Source

ICPC 2026 Asia Seoul Regional Problem C

Subtasks

No. Testdata Range Score

Testdata and Limits

No. Time Limit (ms) Memory Limit (VSS, KiB) Output Limit (KiB) Subtasks
0 3000 1048576 1048576
1 3000 1048576 1048576
2 3000 1048576 1048576
3 3000 1048576 1048576
4 3000 1048576 1048576
5 3000 1048576 1048576
6 3000 1048576 1048576
7 3000 1048576 1048576
8 3000 1048576 1048576
9 3000 1048576 1048576
10 3000 1048576 1048576
11 3000 1048576 1048576
12 3000 1048576 1048576
13 3000 1048576 1048576
14 3000 1048576 1048576
15 3000 1048576 1048576
16 3000 1048576 1048576
17 3000 1048576 1048576
18 3000 1048576 1048576
19 3000 1048576 1048576
20 3000 1048576 1048576
21 3000 1048576 1048576
22 3000 1048576 1048576
23 3000 1048576 1048576
24 3000 1048576 1048576
25 3000 1048576 1048576
26 3000 1048576 1048576
27 3000 1048576 1048576
28 3000 1048576 1048576
29 3000 1048576 1048576
30 3000 1048576 1048576
31 3000 1048576 1048576
32 3000 1048576 1048576
33 3000 1048576 1048576
34 3000 1048576 1048576
35 3000 1048576 1048576
36 3000 1048576 1048576
37 3000 1048576 1048576
38 3000 1048576 1048576
39 3000 1048576 1048576
40 3000 1048576 1048576
41 3000 1048576 1048576
42 3000 1048576 1048576
43 3000 1048576 1048576
44 3000 1048576 1048576
45 3000 1048576 1048576
46 3000 1048576 1048576
47 3000 1048576 1048576
48 3000 1048576 1048576
49 3000 1048576 1048576
50 3000 1048576 1048576
51 3000 1048576 1048576
52 3000 1048576 1048576
53 3000 1048576 1048576
54 3000 1048576 1048576
55 3000 1048576 1048576
56 3000 1048576 1048576
57 3000 1048576 1048576
58 3000 1048576 1048576
59 3000 1048576 1048576
60 3000 1048576 1048576
61 3000 1048576 1048576
62 3000 1048576 1048576
63 3000 1048576 1048576
64 3000 1048576 1048576
65 3000 1048576 1048576
66 3000 1048576 1048576
67 3000 1048576 1048576
68 3000 1048576 1048576
69 3000 1048576 1048576
70 3000 1048576 1048576
71 3000 1048576 1048576
72 3000 1048576 1048576
73 3000 1048576 1048576
74 3000 1048576 1048576
75 3000 1048576 1048576