PivotOJ

Staring Contest

시간 제한: 1000ms메모리 제한: 1024MB출처: BOI 2023BOJ 31975

문제

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 nn members for the upcoming world finals. The iith athlete can maintain eye contact for exactly aia_i seconds, but these values are unknown to you in the beginning. For instance, you could have a team of n=3n=3 members:

ii Name aia_i
1 Anna 431
2 Esther 623
3 Tony 121

When athletes ii and jj compete, the confrontation lasts exactly min(ai,aj)\min(a_i, a_j) 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 431431 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 a1,,ana_1,\ldots, a_n 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 aia_i.

예제

예제 1

입력
3

431

121

121
출력
? 1 2

? 1 3

? 3 2

! 431 431 121
코드를 제출하려면 로그인하세요.