In Ringworld, there are
There are
What is the minimum sum of the travel times for a teacher-student assignment?
Input Specification
The standard input contains 10 datasets. Each dataset begins with two integers
The next line contains
for the first 4 cases,
Output Specification
For each dataset, output the minimum sum of the travel times for a teacher-student assignment.
Sample Input (Two Datasets Shown)
2 5
1 4
5 3
5 100
10 20 30 40 50
60 70 80 90 100
Sample Output
2
130
Educational Computing Organization of Ontario - statements, test data and other materials can be found at ecoocs.org
Comments