Problem A
Dvoniz
We say that a sequence of
Input
The first line contains integers
The following
Output
Output
Sample Input 1 | Sample Output 1 |
---|---|
5 10000 1 1 1 1 1 |
4 4 2 2 0 |
Sample Input 2 | Sample Output 2 |
---|---|
5 9 1 1 10 1 9 |
2 0 0 2 0 |
Sample Input 3 | Sample Output 3 |
---|---|
8 3 1 1 1 1 1 1 1 1 |
6 6 6 4 4 2 2 0 |