#1256
Unrated
Jetpack
스페셜 저지채점 준비중
시간 제한
1s
메모리 제한
64MB
제출
0
정답
0
맞힌 사람
0
정답 비율
0.0%

문제

Little Mirko got a new mobile phone for his birthday! As all kids nowadays, he quickly downloaded all of the popular mobile games, including Jetpack Joyride. In the game, the protagonist Barry is running across a field consisting of 10 rows and N columns of squares of equal size. Initially, Barry is located in the center of the square in the lower left corner. Barry is constantly running to the right at the speed of one square per second. Additionally, he must avoid obstacles that are in his way. When Mirko presses the phone screen, Barry turns on his super-duper special jetpack and starts his ascent at the speed of one square per second (still moving to the right, now moving diagonally up at an angle of 45°, until he reaches the ceiling, when he will continue moving to the right until Mirko releases the screen). When Mirko releases the phone screen, Barry starts falling down at the speed of one square per second (now moving diagonally again, but this time facing down, until he reaches the floor, when he will continue moving to the right). Mirko just started playing the game recently and he’s still not good at it. He saw on YouTube that someone managed to complete the game by crossing all N columns, so he is asking you for your help. He will give you the layout of the fields in the game, and you must output the moves he has to play in order to win.

입력

The first line of input contains the integer N (1 ≤ N ≤ 10510^{5}), the size of the field. Each of the following 10 lines contains N characters ‘.’ and ‘X’, the layout of the field in the game. The characters ‘X’ denote obstacles, and ‘.’ walkable fields.

출력

The first line of output must contain the integer P (0 ≤ P ≤ 5 ⋅ 10410^{4}), the number of moves Mirko has to make. In the following P lines, output any series of P moves, each in its own line, such that it solves Mirko’s problem from the task. A move is determined by two integers tit_{i} and xix_{i}, where tit_{i} denotes the second in which Mirko has to press the screen, and xix_{i} denotes how long he needs to keep the screen pressed. A series of moves must be sorted in chronological order. In other words, it must hold tit_{i} + xix_{i}ti+1t_{i+1}. Also, no move should begin after the end of the game, tit_{i} < N. The input data will be such that a solution will surely exist.

예제 입력 1

11
.....XX...X
....XX...XX
...XX...XX.
...........
....XXX....
...........
.....X.....
....XX...X.
...XX...XX.
...X...XX..

예제 출력 1

2
1 4
7 2
코드 제출

이 문제는 현재 제출할 수 없습니다.

이 현상이 잘못되었다고 생각될 경우 관리자한테 문의주세요.

내 제출
제출 내역이 없습니다.
맞은 사람
아직 맞은 사람이 없습니다.
난이도 투표
Unrated0명 투표
로그인 후 AC 받으면 투표할 수 있습니다.
전체 제출
제출 내역이 없습니다.