func_code_string: #include <bits/stdc++.h>   using namespace std;   const int maxn = 5007;   int a[maxn], b[maxn], n, m, g[maxn];   int gcd(int a, int b) {     if (a < b) return gcd(b, a);     if (b == 0) return a;     return gcd(b, a % b);   }   bool found(int v) {     int l = 1, r = m, mid;     while (l <= r) {       mid = (l + r) / 2;       if (b[mid] == v)         return 1;       else if (v < b[mid])         r = mid - 1;       else         l = mid + 1;     }     return 0;   }   int cal(int v) {     int res = 0, s;     for (int i = 2; i * i <= v; ++i)       if (v % i == 0) {         s = 0;         while (v % i == 0) {           v /= i;           ++s;         }         if (found(i)) s = -s;         res += s;       }     if (v > 1) {       s = 1;       if (found(v)) s = -s;       res += s;     }     return res;   }   int main() {     scanf( %d%d , &n, &m);     for (int i = 1, _c = n; i <= _c; i++) scanf( %d , &a[i]);     for (int i = 1, _c = m; i <= _c; i++) scanf( %d , &b[i]);     g[0] = 0;     int mul = 1;     int res = 0;     for (int i = 1, _c = n; i <= _c; i++)       g[i] = gcd(g[i - 1], a[i]), res += cal(a[i]);     for (int i = n; i >= 1; i--) {       int gx = g[i] / mul;       int vx = cal(gx);       if (vx < 0) {         res -= vx * i;         mul *= gx;       }     }     printf( %d n , res);   }   