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

31088번 - Square 다국어

시간 제한메모리 제한제출정답맞힌 사람정답 비율
1 초 1024 MB665100.000%

문제

Father Study loves math very much.

Given a sequence of integers $a_1,a_2,...,a_n,ドル Father Study wants to calculate another sequence of integers $t_1,t_2,...,t_n$ satisifing

  • For each $i (1 \le i \le n),ドル $t_i > 0$.
  • For each $i (1\le i < n),ドル $a_i \times t_i \times a_{i+1} \times t_{i+1}$ is a square number. (In mathematics, a square number or perfect square is an integer that is the square of an integer, in other words, it is the product of some integer with itself.)
  • $\prod_{i=1}^{n}{t_i}$ is minimized.

Please help Father Study to calculate the answer --- the minimum value of $\prod_{i=1}^{n}{t_i}$. Because the answer is too large, please output the answer modulo 1000000007ドル$.

입력

The first line contains a single integer $n$ (1ドル\le n \le 100000$).

The second line contains $n$ integers $a_1, a_2, ..., a_n$ (1ドル \le a_i \le 1000000$) separated by single spaces.

출력

Output one integer -- the answer modulo 1000000007ドル$.

제한

예제 입력 1

3
2 3 6

예제 출력 1

6

힌트

출처

Contest > Open Cup > 2020/2021 Season > Stage 15, Grand Prix of China, Division 1 L번

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

출처

대학교 대회

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

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