Staring Contest
시간 제한1초메모리 제한1024 MB
두 선수의 대결 결과가 두 값의 최솟값으로 주어질 때, 최댓값 하나는 과소평가해도 되므로 나머지 값을 모두 알아낸다.
문제
A staring contest is a classical battle of imperturbability in which two people stare into each other's eyes while maintaining a facial expression of assured serenity. The goal is to maintain eye contact for longer than your opponent. The contest ends when one participant breaks composure, typically by looking away, smiling, speaking, or giggling.
As a coach of the national staring contest you need to determine the imperturbability of each of your team's members for the upcoming world finals. The th athlete can maintain eye contact for exactly seconds, but these values are unknown to you in the beginning. For instance, you could have a team of members:
When athletes and compete, the confrontation lasts exactly seconds, at which moment the weaker contestant breaks composure and both contestants start smiling and giggling within a fraction of a second. For instance, if Anna competes against Esther, the contest lasts for seconds. Importantly, to an outside observer the actual winner of the confrontation (in this case, Esther) is impossible to determine, only the duration of the contest is measurable.
Your goal is to estimate the values using as few staring contests as possible. Clearly, the strength of the strongest athlete can never be determined, so you are allowed to underestimate one of the .
제한
The number of athletes satisfies . The imperturbability of each athlete satisfies , they are all different. You can use at most queries; your final line of output, i.e., the line starting with !, is not counted as a query.