#Lutece2357. The Party
The Party
Migrated from Lutece 2357 The Party
All parts of this problem, including description, images, samples, data and checker, might be broken. If you find bugs in this problem, please contact the admins.
Description
2018 is about to end, 2019 is coming soon. Well, boys in UESTC, do you have girlfriends? Of course, bachelor XYZ is also worried about this problem. But now, he thinks of a good idea.
Tomorrow UESTC will hold a party, and XYZ is going to invite a girl whose name is Q to this party.
Q is a clever girl, she says: "Sure, but at first, you should solve my problem. If you can solve this problem, I will come with you and dance with you."
Here is the problem: Suppose there are people at the party, and everyone has a charm value. The -person's charm value is . Now, Q defines a function: . The meaning of is as follows: We choose people from people, and the value of is equal to the Great Common Divisor of these people's charm value.
And Q wants the as large as possible. So now, she asks XYZ: "Can you calculate the when is from to and is an integer?"
As we all know, XYZ is not good at math. Can you help him?
Note: Q wants the as large as possible when is from to and is an integer.
Input
The first line contains an integer .
then lines are as follows: every line contains an integer , which means i-person's charm value.
,;
Output
There are lines, the i-th line outputs the when .
Note again: The should be maximized.
Samples
3
1
2
4
4
2
1
Note
;
;
;
Here is the gcd function :
int gcd(int a,int b){
return b==0?a:gcd(b,a%b);
}
Resources
电子科技大学第十届ACM趣味程序设计竞赛