func_code_string: #include <bits/stdc++.h>   namespace chtholly {   char buf[1 << 23], *p1 = buf, *p2 = buf;   inline int read() {     int x = 0, f = 1;     char c = getchar();     for (; !isdigit(c); c = getchar()) f ^= c ==  - ;     for (; isdigit(c); c = getchar()) x = (x << 3) + (x << 1) + (c ^  0 );     return f ? x : -x;   }   template <typename mitsuha>   inline bool read(mitsuha &x) {     x = 0;     int f = 1;     char c = getchar();     for (; !isdigit(c) && ~c; c = getchar()) f ^= c ==  - ;     if (!~c) return 0;     for (; isdigit(c); c = getchar()) x = (x << 3) + (x << 1) + (c ^  0 );     return x = f ? x : -x, 1;   }   template <typename mitsuha>   inline int write(mitsuha x) {     if (!x) return 0 & putchar(48);     if (x < 0) putchar( - ), x = -x;     int bit[20], i, p = 0;     for (; x; x /= 10) bit[++p] = x % 10;     for (i = p; i; --i) putchar(bit[i] + 48);     return 0;   }   inline char fuhao() {     char c = getchar();     for (; isspace(c); c = getchar())       ;     return c;   }   }  // namespace chtholly   using namespace chtholly;   using namespace std;   const int yuzu = 1e5;   typedef long long fuko[yuzu | 10];   fuko a, b, c, d;   int n, k;   typedef long long karen[yuzu << 2 | 13];   struct segtree {     karen val;     void build(int rt = 1, int l = 1, int r = n) {       if (l == r)         val[rt] = read() % k;       else {         int mid = l + r >> 1;         build(rt << 1, l, mid), build(rt << 1 | 1, mid + 1, r);         val[rt] = val[rt << 1] * val[rt << 1 | 1] % k;       }     }     long long query(int ql, int qr, int rt = 1, int l = 1, int r = n) {       if (ql > r || qr < l) return 1;       if (ql <= l && qr >= r) return val[rt];       int mid = l + r >> 1;       return query(ql, qr, rt << 1, l, mid) *              query(ql, qr, rt << 1 | 1, mid + 1, r) % k;     }   } my;   int main() {     read(n), read(k), my.build();     int i, l = 1, r = 1;     long long llx = 0;     for (; r <= n; llx += n - r + 1, ++l, r = max(l, r))       for (; r <= n && my.query(l, r); ++r)         ;     write(llx);   }   