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
2 2 3
5 4 9
3 5 14
2 6 15 8
6 4 9 15

Sample Output 1

15
8
-1

Sample Input 2

5 5
5 18 26
19 14 9
17 13 16
6 6 13
17 3 21
17 7 21 20
11 17 30 16
11 19 5 10
17 10 1 11
19 14 11 7

Sample Output 2

-1
20
16
16
-1

Hints

Problem Source

NPSC 2019 高中組決賽 pB

Subtasks

No. Testdata Range Constraints Score
1 0~1 範例測資 0
2 0~26 無額外限制 100

Testdata and Limits

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