TopCoder

User's AC Ratio

NaN% (0/0)

Submission's AC Ratio

NaN% (0/0)

Tags

Description

Input Format

Output Format

Sample Input 1

2 2 0
1 0

Sample Output 1

4

Sample Input 2

5 3 2
0 0 1
1 2 4
0 3 4 1 2

Sample Output 2

17

Hints

Problem Source

NCPC 2026 Final Problem D

Subtasks

No. Testdata Range Score

Testdata and Limits

No. Time Limit (ms) Memory Limit (VSS, KiB) Output Limit (KiB) Subtasks
0 5000 1048576 1048576
1 5000 1048576 1048576
2 5000 1048576 1048576
3 5000 1048576 1048576
4 5000 1048576 1048576
5 5000 1048576 1048576
6 5000 1048576 1048576
7 5000 1048576 1048576
8 5000 1048576 1048576