Preparando MOJI

Divisibility Check

2000ms 65536K

Description:

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.

Input:

The 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!

Output:

Output 1 if there exists element of this array which is divisible by all other elements of the array, and 0 otherwise.

Sample Input:

6 12 4

Sample Output:

1

Sample Input:

3 13

Sample Output:

0

Sample Input:

26 13 12

Sample Output:

0

Informação

Codeforces

Provedor Codeforces

Código CF661E

Tags

*special

Submetido 0

BOUA! 0

Taxa de BOUA's 0%

Datas 09/05/2023 09:05:56

Relacionados

Nada ainda