Staring Contest
문제
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:
| Name | ||
|---|---|---|
| 1 | Anna | 431 |
| 2 | Esther | 623 |
| 3 | Tony | 121 |
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 .
예제
예제 1
3 431 121 121
? 1 2 ? 1 3 ? 3 2 ! 431 431 121