Logo
(追記) (追記ここまで)

23587번 - Multiplication 다국어인터랙티브

시간 제한메모리 제한제출정답맞힌 사람정답 비율
2 초 (추가 시간 없음) 512 MB279939.130%

문제

This is an interactive problem.

Jury has chosen a secret odd number $x$ between 1ドル$ and 2ドル^{31}-1$ inclusive. Your task is to guess it. In order to do that, jury gives you an even number $n$. Then you should output exactly $n$ distinct integers between 0ドル$ and 2ドル^{31}-1$ inclusive. After that, jury will multiply each of these numbers by $x$ and take the results modulo 2ドル^{31}$. Then jury will equiprobably choose some random subset of these new numbers of size $n/2$ and give this subset back to you in random order. After that, you should output the correct value of $x$.

In each test, $x$ is chosen in advance and does not change.

입력

출력

제한

인터랙션

Initially, you are given one even integer $n$ (4ドル \leq n \leq 10^5$). After that, you should output $n$ distinct integers $a_1, a_2, \ldots, a_n$ (0ドル \leq a_i \leq 2^{31}-1$) on a single line, separated by spaces. Next, you are given $n/2$ integers $b_1, b_2, \ldots, b_{n/2}$ (0ドル \leq b_i \leq 2^{31}-1$) created by the process described above, on a single line, separated by spaces. Finally, you should output a single odd integer $x$: the secret number chosen by the jury (1ドル \leq x \leq 2^{31}-1$).

To prevent output buffering, flush the output buffer after each printed line: this can be done by using, for example, fflush (stdout) in C or C++, System.out.flush () in Java, flush (output) in Pascal, or sys.stdout.flush () in Python. Also, do not forget to terminate each line of output with a newline character.

예제 입력 1

4
9 6

예제 출력 1

1 2 3 4
3

힌트

출처

Contest > Open Cup > 2018/2019 Season > Stage 3: Grand Prix of SPb I번

채점 및 기타 정보

  • 예제는 채점하지 않는다.
(追記) (追記ここまで)

출처

대학교 대회

  • 사업자 등록 번호: 541-88-00682
  • 대표자명: 최백준
  • 주소: 서울시 서초구 서초대로74길 29 서초파라곤 412호
  • 전화번호: 02-521-0487 (이메일로 연락 주세요)
  • 이메일: contacts@startlink.io
  • 통신판매신고번호: 제 2017-서울서초-2193 호

AltStyle によって変換されたページ (->オリジナル) /