luogu#P10827. [EC Final 2020] Square
[EC Final 2020] Square
题目描述
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 .
3
2 3 6
6