Submit: 2 Solved: 2

[Submit] [Status] [Web Board] [Creator:]

The programmers in ACM learn very hard every day. The health is much better than learning, all of them know. Therefore, they decide to run d meters every day. They run on a plane as a square whose lower left corner is at the original point and the length of side is A meters. The sides of the square are parallel to coordinate axes. In order to do exercise more effectively, they are going to exercise n days. In addition, the starting point for their running is the end point of the last day, and run counter-clockwise. Of course, at the first day, they start at the original point.

The first line of input contains the only positive number T (T <= 10), the following T cases.

For each case, the first line contains two positive integer A, n (A<=1000, n<=10,000). Number a denotes the length of the square's side, number n denotes the number of the days they plan to run. Next, we input n lines, each of which contains only integer di, which denotes the length of their running at I’th day (i=1,2,…,n).

For each case, you should output which case firstly.

Next, print n lines. The i’th line should contain two numbers x and y, which denote the end point at the i’th day (i=1,2,…,n).

```
1
3 3
1
2
3
```

```
Case #1:
1 0
3 0
3 3
```