Inaho is given an array of length , such that is a unique integer. With the array, he defines a function:
Inaho wants to play a game with you! He wants you to recreate the array. Because he knows this is impossible, he will allow you to ask him some questions. In particular, you are to ask him , where , and he will reply with . He wants this to be challenging. As such, he will only allow you to ask him questions.
Tell Inaho what his array is!
Inaho will provide you the integer on the first line.
You may then ask questions. To ask a question, you must use the form
Q x. Note that is in radians and must be in the range . may contain as many decimal places as you desire, however, will be rounded to decimal places. Inaho's response is guaranteed to be precise to decimal places.
To tell Inaho the array , you must use the form
A p. is an integer, such that the bit in is if there exists a , and otherwise. Because is guaranteed to be unique, this means the number of bits in should be equal to .
For example, if , and , then .
You are allowed to ask Inaho a maximum of questions. Note that telling Inaho the array does not count as a question.
After each question or the answer, you may need to flush
stdout. You do not need to flush if you are using C++, Java, or Python 2/3. In other languages, such as Pascal, you will need to flush
stdout for the interactor to receive your output.
Note 1: Up to seconds of the time limit could be used up by the interactor.
To tell Inaho the array , use the form
A p, where is the integer as defined in the Interaction section.
Subtask 1 [10%]
Subtask 2 [30%]
Subtask 3 [60%]
Note that these are not explicit subtasks. You will receive the specified percentage of points depending on which subtask you fall in. For example, using questions for will grant you of the points.
>>> denotes your output; don't actually print this out.
3 >>> Q 0.000000000000 0.000000000000000 >>> Q 3.01 -1.239969287666227 >>> A 13