| 시간 제한 | 메모리 제한 | 제출 | 정답 | 맞힌 사람 | 정답 비율 |
|---|---|---|---|---|---|
| 1 초 | 256 MB | 14 | 7 | 7 | 70.000% |
You are given some domino-like pieces. The following types of pieces are possible:
Note that there are only four types, and you may rotate and reflect any piece for further use. You want to place all the pieces in a matrix of size at most 800ドル \times 800$ so that you get a single non-self-touching cycle. Formally, this means:
The input consists of a single line containing four integers: the number of pieces of each type (in the order they are shown in the image). It is guaranteed that each number is at least 2 and at most 100, and that at least one valid answer exists.
The first line of output must contain two integers $N$ and $M$ ($N, M \le 800$) denoting the number of rows and columns in your matrix. The next lines must describe the matrix in the following format:
If there are several valid answers, print any one of them.
3 4 3 4
11 6 0 1 2 4 4 4 1 1 0 0 0 3 8 0 0 0 3 3 8 0 0 0 9 0 8 0 0 0 9 9 10 0 0 0 0 13 10 0 0 0 0 11 12 0 0 0 0 11 12 0 0 0 0 14 6 0 0 0 0 7 6 5 5 5 7 7