|시간 제한||메모리 제한||제출||정답||맞은 사람||정답 비율|
|1 초||256 MB||5||2||1||33.333%|
It’s common practice in the village of Softville to produce software in a specific way: in the first day the programmer writes several lines of code (at least one line) and every next day he or she writes one line more than the day before.
After they turn 10 years old, every citizen of Softville should be initiated by writing from scratch a very complicated program. The code of the program is the same for all citizens and contains exactly N lines. It takes a different number of days for each citizen to complete the task. Nevertheless the rule always remains true: every day each programmer writes one line more than he wrote the previous day.
You’ll be given data about how many days it took citizens of Softville to write their initial program. You should determine the least possible value for N i.e. the number of lines of the program.
The first line of the input file contains the number m (0 ≤ m ≤ 1000) of citizens of Softville. The second line contains m numbers which represent the number of days each citizen was occupied writing the initial program. All numbers in the second line are integers less than 263 and also positive.
The only number in the output should be the least possible value for N. In case input data wouldn’t be consistent regardless of value of N you should output 0, otherwise it’s guaranteed that the least possible value for N is less than 263.
2 2 3
2 4 2