TopCoder

User's AC Ratio

100.0% (1/1)

Submission's AC Ratio

60.0% (3/5)

Tags

Description

Input Format

Output Format

Sample Input 1

2
4 6 5
0 0
3 4
6 0
9 4
12 0
15 4
4 8 4
0 0
3 0
0 3
3 3
12 12
15 12
12 15
15 15

Sample Output 1

25
-1

Hints

Problem Source

NCPC 2026 Final Problem E

Subtasks

No. Testdata Range Score

Testdata and Limits

No. Time Limit (ms) Memory Limit (VSS, KiB) Output Limit (KiB) Subtasks
0 2000 1048576 1048576
1 2000 1048576 1048576