func_code_string: #include <bits/stdc++.h>   using namespace std;   int gcd(int x, int y) {     if (x == 0) return y;     return gcd(y % x, x);   }   int main() {     int n, m, x, g;     cin >> n >> m >> x;     g = x - 1;     for (int i = 1; i < n; ++i) {       scanf( %d , &x);       g = gcd(g, x - 1);     }     set<int> second;     int d = 1;     while (d * d <= g) {       if (g % d == 0) {         for (int p = 1; p * d <= m; p *= 2) second.insert(p * d);         for (int p = 1; p * (g / d) <= m; p *= 2) second.insert(p * (g / d));       }       ++d;     }     long long ans = 0;     for (set<int>::iterator it = second.begin(); it != second.end(); it++)       ans += m - (*it);     cout << ans;     return 0;   }   