This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
//#include <bits/stdc++.h>
//using namespace std;
//
//typedef long long ll;
//typedef long double ld;
//typedef pair<ll,ll> pl;
//typedef pair<int,int> pii;
//typedef tuple<int,int,int> tt;
//
//#define all(a) a.begin(), a.end()
//#define filter(a) a.erase(unique(all(a)), a.end())
//
//int mex (vector<int> &v) {
//    vector<bool> check(v.size());
//    for (int u : v)
//        if (u < v.size()) check[u] = 1;
//    for (int i = 0; i < v.size(); i++)
//        if (!check[i]) return i;
//    return v.size();
//}
//
//int grundy[110][110];
//
//int main()
//{
//    ios::sync_with_stdio(0);
//    cin.tie(0);
//
//    int n, k; cin >> n >> k;
//
//    for (int i = 1; i <= n; i++) {
//        for (int j = 1; j <= k; j++) {
//            vector<int> vec;
//            for (int select = 1; select <= min(i, j); select++)
//                vec.push_back(grundy[i - select][select]);
//            grundy[i][j] = mex(vec);
//        }
//    }
//
//    for (int i = 0; i <= n; i++) {
////        cout << "row " << i << ": ";
////        if (i < 10) cout << " ";
////        for (int j = 0; j <= k; j++) cout << grundy[i][j] << " ";
////        cout << " (" << bitset<5>(i) << ")\n";
//
//        for (int j = 0; j <= k; j++) {
//            int tmp = ((1 << j) & i) - 1;
//            cout << tmp << " ";
//        }
//        cout << "\n";
//    }
//
//    return 0;
//}
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef long double ld;
typedef pair<ll,ll> pl;
typedef pair<int,int> pii;
typedef tuple<int,int,int> tt;
#define all(a) a.begin(), a.end()
#define filter(a) a.erase(unique(all(a)), a.end())
const int mn = 1e5 + 5;
int n, k, a[mn];
namespace onePile {
    bool solve() {
        return k >= (a[1] & -a[1]);
    }
    bool check() {
        return n == 1;
    }
};
namespace manyPile {
    bool solve() {
        int lo = INT_MAX;
        for (int i = 1; i <= n; i++) lo = min(lo, (a[i] & -a[i]));
        return k >= lo;
    }
    bool check() {
        return n <= 100'000;
    }
};
bool solve() {
    cin >> n >> k;
    for (int i = 1; i <= n; i++) cin >> a[i];
    if (onePile::check()) return onePile::solve();
    if (manyPile::check()) return manyPile::solve();
}
int main()
{
    ios::sync_with_stdio(0);
    cin.tie(0);
    int TC; cin >> TC;
    while (TC--) cout << solve();
    return 0;
}
Compilation message (stderr)
football.cpp: In function 'bool solve()':
football.cpp:99:1: warning: control reaches end of non-void function [-Wreturn-type]
   99 | }
      | ^| # | Verdict  | Execution time | Memory | Grader output | 
|---|
| Fetching results... | 
| # | Verdict  | Execution time | Memory | Grader output | 
|---|
| Fetching results... | 
| # | Verdict  | Execution time | Memory | Grader output | 
|---|
| Fetching results... | 
| # | Verdict  | Execution time | Memory | Grader output | 
|---|
| Fetching results... | 
| # | Verdict  | Execution time | Memory | Grader output | 
|---|
| Fetching results... | 
| # | Verdict  | Execution time | Memory | Grader output | 
|---|
| Fetching results... | 
| # | Verdict  | Execution time | Memory | Grader output | 
|---|
| Fetching results... | 
| # | Verdict  | Execution time | Memory | Grader output | 
|---|
| Fetching results... |