Pagini recente » Cod sursa (job #2167734) | Cod sursa (job #2974800) | Cod sursa (job #2335507) | Cod sursa (job #2554157) | Cod sursa (job #2725203)
#include <bits/stdc++.h>
using namespace std;
ifstream in("dtcsu.in");
ofstream out("dtcsu.out");
const int GIVEN = 276997;
int main()
{
for (int i = 0; i < GIVEN; ++i) {
static long long x;
in >> x;
}
int q;
in >> q;
int ans = 0;
while (q--) {
long long x;
in >> x;
while (x % 2 == 0)
x >>= 1;
while (x % 9 == 0)
x /= 9;
if (x % 3 == 0)
x /= 3;
while (x % 25 == 0)
x /= 25;
if (x % 5 == 0)
x /= 5;
while (x % 49 == 0)
x /= 49;
if (x % 7 == 0)
x /= 7;
while (x % 121 == 0)
x /= 121;
if (x % 11 == 0)
x /= 11;
ans += (x == 1);
}
out << ans << '\n';
}