TopCoder

User's AC Ratio

NaN% (0/0)

Submission's AC Ratio

NaN% (0/0)

Tags

Description

Input Format

Output Format

Sample Input 1

4 5
10 20 40 70
1 200
1 150
3 100
2 300
2 250
130 130 85 250 245

Sample Output 1

370

Sample Input 2

6 7
10 10 10 10 10 10
1 150
2 140
3 110
4 200
5 250
6 100
3 170
120 110 100 170 230 90 150

Sample Output 2

100

Hints

Problem Source

NCPC 2026 Final Problem B

Subtasks

No. Testdata Range Score

Testdata and Limits

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