func_code_string: #include <bits/stdc++.h>   using namespace std;   const int maxn = 1e5;   bool isprime[32000];   vector<int> prime;   int a[maxn + 50], num[maxn + 50], factor[maxn + 50], now[maxn + 50];   int k, n, len = 0;   long long ans = 0;   bool check() {     for (int i = 1; i <= len; ++i)       if (now[i] < num[i]) return false;     return true;   }   void make(int x, int type) {     for (int i = 1; i <= len; ++i) {       if (x % factor[i] != 0) continue;       if (factor[i] == 1) {         now[i] += type;         continue;       }       while (x % factor[i] == 0) {         x /= factor[i];         now[i] += type;       }       if (x == 1) break;     }   }   int main() {     scanf( %d%d , &n, &k);     for (int i = 1; i <= n; ++i) scanf( %d , &a[i]);     isprime[1] = 1;     for (int i = 2; i <= sqrt(k); ++i)       if (!isprime[i]) {         prime.push_back(i);         for (int j = i + i; j <= sqrt(k); j += i) isprime[j] = 1;       }     ++len;     factor[len] = 1;     num[len] = 1;     for (int i = 0; i < prime.size(); ++i) {       if (k % prime[i] != 0) continue;       factor[++len] = prime[i];       while (k % prime[i] == 0) {         k /= prime[i];         ++num[len];       }       if (k == 1) break;     }     if (k != 1) factor[++len] = k, num[len] = 1;     int r = 0;     for (int l = 1; l <= n; ++l) {       while (!check() && r < n) {         ++r;         make(a[r], 1);       }       if (check()) ans += n - r + 1;       make(a[l], -1);     }     printf( %lld n , ans);     return 0;   }   