문제
Farmer John's
Problem credits: Nick Wu
입력
The first line of input contains
The next
The next
출력
For each of the
예제1
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
Problem credits: Nick Wu
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