303413: CF661E. Divisibility Check
Memory Limit:64 MB
Time Limit:2 S
Judge Style:Text Compare
Creator:
Submit:0
Solved:0
Description
E. Divisibility Checktime limit per test2 secondsmemory limit per test64 megabytesinputstandard inputoutputstandard output
You are given an array of integers. Check whether there exists a number in this array which is divisible by all other numbers in this array. Output 1, if such a number exists, and 0 otherwise.
InputThe only line of the input contains a list of space-separated integers ai (1 ≤ ai ≤ 100) — elements of the array. The size of the array is between 2 and 10, inclusive. Note that the size of the array is not given explicitly!
OutputOutput 1 if there exists element of this array which is divisible by all other elements of the array, and 0 otherwise.
ExamplesInput6 12 4Output
1Input
3 13Output
0Input
26 13 12Output
0