Small Numbers Search
시간 제한2초메모리 제한1024 MB
크기 n인 숨겨진 순열에서 값 1부터 k까지의 위치를 찾는다. 두 위치의 값을 비교하는 질의를 10700번까지 사용한다.
문제
This is an interactive problem.
Jury has a permutation of numbers from to . Your task is find positions where numbers from to are placed. To do this, you can use jury's program which can compare numbers in any two positions in the permutation.
입력
The first line of input contains two integers and : the order of permutation and the number of positions to find. In all tests except the example, and .
Then follow the answers for your requests, one per line. If the first of the two numbers to compare is less than the second one, the line will contain a single character "<", otherwise, it will contain a single character ">".
출력
If you want to compare numbers on positions and , you must print one line "? ". Here, and must be different integers between and . You can request a comparison at most times.
If you found all positions for all numbers from to , print "! ", and then terminate your program.
To prevent output buffering, after printing each line, consider issuing the command which flushes the buffer. For example, this command may be fflush(stdout) in C or C++, System.out.flush() in Java, flush(output) in Pascal or sys.stdout.flush() in Python.
Also, don't forget to put a newline at the end of every line of your output.
힌트
In the example, the jury's permutation is 1 2 3.