# CF687B Remainders Game

#include<iostream>
#include<cstdio>
#include<cstring>
#include<queue>
#include<cmath>

using namespace std;

int n, k, c,tot,prime[100010];
bool vis[100010];

int main()
{
scanf("%d%d", &n, &k);
for (int i = 2; i <= sqrt(k); i++)
{
if (k % i == 0)
{
int t = 1;
while (k % i == 0)
{
t *= i;
k /= i;
}
prime[++tot] = t;
}
}
if (k)
prime[++tot] = k;
for (int i = 1; i <= n; i++)
{
int c;
scanf("%d", &c);
for (int j = 1; j <= tot; j++)
if (c % prime[j] == 0)
vis[j] = 1;
}
for (int i = 1; i <= tot; i++)
if (!vis[i])
{
printf("No\n");
return 0;
}
printf("Yes\n");

return 0;
}

## Codeforces Round #360 (Div. 2) D. Remainders Game（中国剩余定理）

D. Remainders Game Today Pari and Arya are playing a game called Remainders. Pari chooses two positive integer x and k, and tells Arya k but not x. Arya have to find the value . There are n ancient numbers c1, c2, ..., cn and Pari has to tell Arya  i

## codeforces 360 D - Remainders Game

D - Remainders Game Description Today Pari and Arya are playing a game called Remainders. Pari chooses two positive integer x and k, and tells Arya k but not x. Arya have to find the value . There are n ancient numbersc1,  c2, ..., cn and Pari has to

## Sum of Remainders(数学题)

F - Sum of Remainders Time Limit:2000MS     Memory Limit:262144KB     64bit IO Format:%I64d & %I64u Submit Status Practice CodeForces 616E Description Calculate the value of the sum: n mod 1 + n mod 2 + n mod 3 + ... + n mod m. As the result can be v