Problems
Farmer John's
Input
The first line of input contains
The next
The next
Output
For each of the
Example
6 3
2
1
1
3
2
1
1 6
3 3
2 4
3 2 1
1 0 0
2 0 1
Farmer John's
The first line of input contains
The next
The next
For each of the
6 3
2
1
1
3
2
1
1 6
3 3
2 4
3 2 1
1 0 0
2 0 1