The lastest Math theory problem

Time Limit: 1000ms
Memory Limit: 32768KB
This problem will be judged on HDU. Original ID: 3417
64-bit integer IO format: %I64d      Java class name: Main

Description

There is a positive integer N,satisfied that (N / a1) equals K1a1, (N / a2) equals K2a2 and so on. Then, I want you to tell me the smallest N.

Input

Input is a integer n(1<=n<=6), then n numbers ai (16 < ai < 10000 )described above.

Output

If there exists such a N,output N mod 19880502, else -1 instead.

Sample Input

1
323
2
17 19

Sample Output

323
3493625

Source

Language: 
Theme: 
Share Code? 

Powered by NB231 | Current Style: .