Language: C++

#include <bits/stdc++.h>
#define int long long
#define rep(i, a, n) for(int i = (int)(a);(i) < (int)(n);++(i))
#define repe(i, a, n) for(int i = (int)(a);(i) <= (int)(n);++(i))
#define repif(i, a, x) for(int i = (int)(a);(x);++(i))
#define repr(i, a, n) for(int i = ((int)(a)-1);(i) >= (int)(n);--(i))
#define reper(i, a, n) for(int i = (int)(a);(i) >= (int)(n);--(i))
#define SZ(x) ((int)(x).size())
#define ALL(x) begin(x), end(x)
#define RNG(x, a, n) begin(x)+(a), begin(x)+(n)
#define ADD(a, b) ((((a)%MOD+MOD)%MOD+((b)%MOD+MOD)%MOD)%MOD)
#define SUB(a, b) ((((a)%MOD+MOD)%MOD-((b)%MOD+MOD)%MOD+MOD)%MOD)
#define MUL(a, b) (((((a)%MOD+MOD)%MOD)*(((b)%MOD+MOD)%MOD))%MOD)
#define CHADD(a, b) (a = ADD(a, b))
#define CHMUL(a, b) (a = MUL(a, b))
#define CEIL(x) ((int)ceil(((double)x)))
#define POW(x, y) ((int)pow(x, y))
#define UNIQUE(x) (x).erase(unique(ALL((x))), (x).end())
#define gcd(x, y) __gcd(x, y)
#define lcm(x, y) ((x)/gcd(x,y)*(y))
#define isin(x, l, r) ((l) <= (x) and (x) < (r))
#define YES cout << "YES" << endl
#define NO cout << "NO" << endl
#define Yes cout << "Yes" << endl
#define No cout << "No" << endl
#define yes cout << "yes" << endl
#define no cout << "no" << endl
#define fcout cout << fixed << setprecision(10)
#define pb push_back
#define eb emplace_back
#define lb lower_bound
#define ub upper_bound
#define PI (acos(-1))
#define EPS (1e-10)
#define INF LLONG_MAX
#define MOD 1000000007LL
using namespace std;
using VI = vector<int>;
using PII = pair<int, int>;
using TIII = tuple<int, int, int>;
using VPII = vector<PII>;
using VTIII = vector<TIII>;
using Complex = complex<double>;
template<typename T, template<typename> typename C = less> using PQ = priority_queue<T, vector<T>, C<T>>;
template<typename T> bool chmax(T& a, const T& b){ if(a<b){ a=b; return true; } return false; }
template<typename T> bool chmin(T& a, const T& b){ if(a>b){ a=b; return true; } return false; }


int N, M;
int b[100010];


signed main(){
    cin >> N >> M;
    rep(i, 0, N) cin >> b[i], b[i]/=2;

    int p2 = 1;
    for(int x = a[0];x%2 == 0;x/=2) p2*=2;

    if(all_of(RNG(a, 1, N), [](int x){ return !(x%p2) and x%(2*p2); })){
        int sm = 1;
        rep(i, 0, N) sm = lcm(sm, b[i]);
        cout << CEIL((M/sm)/2.0) << endl;
    }
    else cout << 0 << endl;

    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:58:17: error: 'a' was not declared in this scope
   58 |     for(int x = a[0];x%2 == 0;x/=2) p2*=2;
      |                 ^
a.cc:60:19: error: 'a' was not declared in this scope
   60 |     if(all_of(RNG(a, 1, N), [](int x){ return !(x%p2) and x%(2*p2); })){
      |                   ^
a.cc:10:28: note: in definition of macro 'RNG'
   10 | #define RNG(x, a, n) begin(x)+(a), begin(x)+(n)
      |                            ^
a.cc: In lambda function:
a.cc:60:51: error: 'p2' is not captured
   60 |     if(all_of(RNG(a, 1, N), [](int x){ return !(x%p2) and x%(2*p2); })){
      |                                                   ^~
a.cc:60:30: note: the lambda has no capture-default
   60 |     if(all_of(RNG(a, 1, N), [](int x){ return !(x%p2) and x%(2*p2); })){
      |                              ^
a.cc:57:9: note: 'long long int p2' declared here
   57 |     int p2 = 1;
      |         ^~
a.cc:60:64: error: 'p2' is not captured
   60 |     if(all_of(RNG(a, 1, N), [](int x){ return !(x%p2) and x%(2*p2); })){
      |                                                                ^~
a.cc:60:30: note: the lambda has no capture-default
   60 |     if(all_of(RNG(a, 1, N), [](int x){ return !(x%p2) and x%(2*p2); })){
      |                              ^
a.cc:57:9: note: 'long long int p2' declared here
   57 |     int p2 = 1;
      |         ^~