PivotOJ

Lateral Damage

시간 제한: 2000ms메모리 제한: 1024MB출처: NWERC 2023BOJ 30909

문제

You are playing Battleships in a large ocean with large ships. More precisely, there is a large square grid of size at most 100×100100\times 100 and inside it are up to 1010 of the largest type of ship in Battleships -- the aircraft carrier -- which has a length of five tiles, placed either horizontally or vertically. The ships do not overlap, but they are allowed to be adjacent to each other. See Figure L.1 for an example.

Unfortunately, your opponent appears to bend the rules to their liking. It looks like they do not always determine the placement of their ships before you start shooting. You are not impressed by their attempt at cheating, and decide to try and win the game anyway.

Figure L.1: Illustration of Sample Interaction 1 after the first four shots were fired.

Your goal is to locate and sink all your opponent's aircraft carriers in at most 25002500 shots, that is, you must hit each of the five tiles of all their ships.

예제

예제 1

입력
7 2

miss

hit

miss

hit

hit

hit

hit

sunk

miss

miss

hit

miss

hit

hit

sunk
출력
6 1

6 3

7 3

5 3

4 3

3 3

2 3

1 3

6 7

6 7

6 2

6 2

6 4

6 5

6 6
이 문제는 채점 준비 중입니다. 테스트 데이터가 확보되면 제출이 가능합니다.