시간 제한 | 메모리 제한 | 제출 | 정답 | 맞힌 사람 | 정답 비율 |
---|---|---|---|---|---|
4.7 초 | 1024 MB | 0 | 0 | 0 | 0.000% |
You are in the upper-left corner in a M × N network of trees, at coordinates (1,1). A squirrel jumps from tree to tree. Being a computer science squirrel, it jumps such that it creates fractal patterns of... trees, of course! The S fractals look like the ones in the pictures:
The squirrel follows the following rules:
The squirrel keeps jumping until it finishes one fractal shape, then it starts again with the next fractal. In how many of the trees can you see the squirrel?
The first line has three integers, M, N, and F. The following F lines describe F fractals. Each line has three integers, the coordinates of the starting tree, followed by the fractal size.
Print one integer, the number of positions where you can see the squirrel.
번호 | 배점 | 제한 |
---|---|---|
1 | 15 | The total number of jumps is at most 40 million. |
2 | 10 | The total number of jumps is at most 65 million. |
3 | 25 | The total number of jumps is at most 125 million. |
4 | 50 | None |
14 20 3 11 10 4 7 6 2 8 7 2
35
The example corresponds to: