|시간 제한||메모리 제한||제출||정답||맞은 사람||정답 비율|
|2 초||256 MB||3||3||3||100.000%|
Let $N \ge 3$ be an odd number.
There are $N$ seats arranged in a circle. The seats are numbered $0$ through $N-1$. For each $i$ ($0 \le i \le N - 2$), seat $i$ and seat $i + 1$ are adjacent. Also, seat $N - 1$ and seat $0$ 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 $N$ is an odd number greater than $1$.
You are given $N$, 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 $i$ ($0 \le i \le N - 1$). If Seat $i$ is empty, the problem is solved. Otherwise, you are notified of the sex of the person at seat $i$.
Guess the ID number of an empty seat by sending at most $20$ queries.
In the first line you are given one integer $N$ --- the number of seats ($N$ is odd, $3 \le N \le 99\,999$).
After that, you start to send queries. A query consists of one integer $i$ ($0 \le i \le N-1$) --- number of seat. Do not forget to end the query by end-of-line character and to flush standard output after each query.
The responce of the interactor is one of three possible answers: "
Male" and "
Female". Each of these means that Seat $i$ is empty, occupied by a man and occupied by a woman, respectively.
When you receive "
Vacant" answer, immediately terminate the program. If you send more than 20 queries, you will receive the Wrong Answer verdict.
3 Male Female Vacant
0 1 2
In the sample, $N = 3$, and Seat $0$, $1$, $2$ are occupied by a man, occupied by a woman and vacant, respectively.