TopCoder

User's AC Ratio

NaN% (0/0)

Submission's AC Ratio

NaN% (0/0)

Tags

Description

Problem description is available here.


Please Note that is this NTUJ version, you do NOT have to (in fact, you're not allowed to..) output the execution expression (see the pdf for details). Once again, output the optimal time only and do NOT output the expression, but still include the new line after each cases.

Input Format

Output Format

see sample for more detail.

Sample Input 1

4 5 5
10000
2 1 1 1 2
3 1 1 1 3
4 1 2 1 4
1 2 3 4 1 5
1 2 1
01
31 1 2 1 1
3 5 5
10100
3 1 1 1 2
1 1 3 1 4
3 2 4 2 1 5
1 3 3
100
1 1 1 1 2
0 0 0

Sample Output 1

Case 1: 7

Case 2: 31

Case 3: 6

Case 4: -1

Hints

Problem Source

Migrated from old NTUJ.

Wuhan Regional 2009

Subtasks

No. Testdata Range Score

Testdata and Limits

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