Interactive Array Guessing | 프로그래밍의 벗 PivotOJ
PivotOJ

Interactive Array Guessing

시간 제한: 3000ms메모리 제한: 512MB출처: NEERC Northern Subregional 2018BOJ 16656

문제

This is an interactive problem.

Jury has prepared n non-empty integer arrays a1, a2, . . . , an. Each array consists of at most 10 positive integers not exceeding 1000. The elements of each array are pairwise distinct.

You can make queries of the following kind: choose several indices q1, q2, . . . , qm, where 1 ≤ m ≤ n and 1 ≤ qi ≤ n. These indices do not have to be distinct. The testing system tells you the contents of arrays aq1, aq2, . . . , aqm in the same order. However, these contents are concatenated without any delimeters.

Your task is to find the contents of all n arrays.

예제

예제 1

입력
3

5 1 1 2 2 1

4 1 2 1 1

2 1 2
출력
? 3 1 2 3

? 3 1 3 1

? 1 2

! 1 1 2 1 2 2 2 1
코드를 제출하려면 로그인하세요.