Language: C++

const int inf = (1 << 30) - 1;

ll gcd(ll x, ll y){
    ll r = x%y;
    if(r == 0) return y;
    else return gcd(y, r);
} 

ll lcm(ll x, ll y){
    ll g = gcd(x,y);
    return x*y/g;
}

int main(){
    cin.tie(0);
    ios::sync_with_stdio(false);
    ll  n, m;
    cin >> n >> m;
    lvec a(n), aa;
    for (ll i = 0; i < n; i++) cin >> a[i];
    sort(a.rbegin(), a.rend());
    aa.push_back(a[0]/2);
    for (ll i = 1; i < n; i++){
        if(a[i] == a[i-1]) continue;
        aa.push_back(a[i]/2);
    }
    ll lc=aa[0];
    for (ll &x : aa ) {
        lc = lcm(max(lc,x), min(lc,x));
        if ((lc/x)%2 == 0){
            cout << 0 << endl;
            return 0;
        } 
    }
    
    cout << ((m/lc) - 1)/2 + !(lc > m) << endl;
    
    //cout << ((2*m/g)/(mm)-1)/2 + !(mm > 2*m/g) << endl;
    
}

Compiler output:
a.cc:3:1: error: 'll' does not name a type
    3 | ll gcd(ll x, ll y){
      | ^~
a.cc:9:1: error: 'll' does not name a type
    9 | ll lcm(ll x, ll y){
      | ^~
a.cc: In function 'int main()':
a.cc:15:5: error: 'cin' was not declared in this scope
   15 |     cin.tie(0);
      |     ^~~
a.cc:16:5: error: 'ios' has not been declared
   16 |     ios::sync_with_stdio(false);
      |     ^~~
a.cc:17:5: error: 'll' was not declared in this scope
   17 |     ll  n, m;
      |     ^~
a.cc:18:12: error: 'n' was not declared in this scope
   18 |     cin >> n >> m;
      |            ^
a.cc:18:17: error: 'm' was not declared in this scope
   18 |     cin >> n >> m;
      |                 ^
a.cc:19:5: error: 'lvec' was not declared in this scope
   19 |     lvec a(n), aa;
      |     ^~~~
a.cc:20:12: error: expected ';' before 'i'
   20 |     for (ll i = 0; i < n; i++) cin >> a[i];
      |            ^~
      |            ;
a.cc:20:20: error: 'i' was not declared in this scope
   20 |     for (ll i = 0; i < n; i++) cin >> a[i];
      |                    ^
a.cc:20:39: error: 'a' was not declared in this scope
   20 |     for (ll i = 0; i < n; i++) cin >> a[i];
      |                                       ^
a.cc:21:10: error: 'a' was not declared in this scope
   21 |     sort(a.rbegin(), a.rend());
      |          ^
a.cc:21:5: error: 'sort' was not declared in this scope; did you mean 'short'?
   21 |     sort(a.rbegin(), a.rend());
      |     ^~~~
      |     short
a.cc:22:5: error: 'aa' was not declared in this scope
   22 |     aa.push_back(a[0]/2);
      |     ^~
a.cc:23:12: error: expected ';' before 'i'
   23 |     for (ll i = 1; i < n; i++){
      |            ^~
      |            ;
a.cc:23:20: error: 'i' was not declared in this scope
   23 |     for (ll i = 1; i < n; i++){
      |                    ^
a.cc:27:7: error: expected ';' before 'lc'
   27 |     ll lc=aa[0];
      |       ^~~
      |       ;
a.cc:28:16: error: found ':' in nested-name-specifier, expected '::'
   28 |     for (ll &x : aa ) {
      |                ^
      |                ::
a.cc:28:14: error: 'x' has not been declared
   28 |     for (ll &x : aa ) {
      |              ^
a.cc:36:5: error: 'cout' was not declared in this scope
   36 |     cout << ((m/lc) - 1)/2 + !(lc > m) << endl;
      |     ^~~~
a.cc:36:17: error: 'lc' was not declared in this scope
   36 |     cout << ((m/lc) - 1)/2 + !(lc > m) << endl;
      |                 ^~
a.cc:36:43: error: 'endl' was not declared in this scope
   36 |     cout << ((m/lc) - 1)/2 + !(lc > m) << endl;
      |                                           ^~~~
a.cc:40:1: error: expected primary-expression before '}' token
   40 | }
      | ^
a.cc:36:48: error: expected ')' before '}' token
   36 |     cout << ((m/lc) - 1)/2 + !(lc > m) << endl;
      |                                                ^
      |                                                )
......
   40 | }
      | ~                                               
a.cc:28:9: note: to match this '('
   28 |     for (ll &x : aa ) {
      |         ^
a.cc:40:1: error: expected primary-expression before '}' token
   40 | }
      | ^