TopCoder

User's AC Ratio

100.0% (1/1)

Submission's AC Ratio

66.7% (2/3)

Tags

Description

Input Format

Output Format

Sample Input 1

4 9
-1 1 4
-5 1 4
-1 9 19
-8 1 0
0 1 1
0 1 2
0 1 3
0 1 4
-2 1 1
-2 1 2
-1 1 1
-1 1 2
10 1 4

Sample Output 1

19 1
23 1
27 1
27 1
-2 1
-5 1
9 1
11 1
-1353 1

Sample Input 2

3 7
-16 32 48
-8 16 24
-1 2 15
-2 3 2
-1 2 2
0 1 2
1 2 2
2 3 2
3 2 2
4 3 2

Sample Output 2

295 9
42 1
72 1
90 1
280 3
90 1
280 3

Hints

Problem Source

Subtasks

No. Testdata Range Score

Testdata and Limits

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