Square
시간 제한1초메모리 제한1024 MB
이웃한 곱 a_i*t_i*a_{i+1}*t_{i+1}이 모두 제곱수가 되도록 양의 정수 t_i를 정하고, t_i의 곱의 최솟값을 1e9+7로 나눈 나머지를 구한다.
문제
Father Study loves math very much.
Given a sequence of integers , Father Study wants to calculate another sequence of integers satisifing
- For each , .
- For each , 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.)
- is minimized.
Please help Father Study to calculate the answer --- the minimum value of . Because the answer is too large, please output the answer modulo .
입력
The first line contains a single integer ().
The second line contains integers () separated by single spaces.
출력
Output one integer -- the answer modulo .