Vacant Seat

아직 제출이 없습니다시간 제한2초메모리 제한256 MB

문제

Let N3N \ge 3 be an odd number.

There are NN seats arranged in a circle. The seats are numbered 00 through N1N-1. For each ii (0iN20 \le i \le N - 2), seat ii and seat i+1i + 1 are adjacent. Also, seat N1N - 1 and seat 00 are adjacent.

Each seat is either vacant, or occupied by a man or a woman. However, no two adjacent seats are occupied by two people of the same sex. It can be shown that there is at least one empty seat because NN is an odd number greater than 11.

You are given NN, but the states of the seats are not given. Your objective is to correctly guess the ID number of any one of the empty seats. To do so, you can repeatedly send the following query:

Choose an integer ii (0iN10 \le i \le N - 1). If Seat ii is empty, the problem is solved. Otherwise, you are notified of the sex of the person at seat ii.

Guess the ID number of an empty seat by sending at most 2020 queries.

힌트

In the sample, N=3N = 3, and Seat 00, 11, 22 are occupied by a man, occupied by a woman and vacant, respectively.