Problem: 2061D - Kevin and Numbers
Language: C++17 (GCC 7-32)

Previous submission (verdict: Wrong answer on test 3):
#include <bits/stdc++.h>
using namespace std;
 
#define int long long
#define ll long long
#define mod 1000000007
#define mod2 998244353
#define inf (1LL << 60)
#define all(x) (x).begin(), (x).end()
#define pii pair<int, int>
#define endl "\n"
#define cout std::cout
#define cin std::cin
#define fo(i, a, b) for (int i = a; i < b; i++)
void print(vector<int> &a){
    fo(i, 0, a.size()) cout << a[i] << " ";
    cout << endl;
}
/**************************************************/
int expo(int a, int b, int m){
    int res = 1;
    while (b > 0)
    {
        if (b & 1)
            res = (res * a) % m;
        a = (a * a) % m;
        b = (b >> 1);
    }
    return res;
}
 
int gcd(int a, int b){
    if (a < b) swap(a, b);
    return b == 0 ? a : gcd(b, a % b);
}
 
int LCM(int a, int b){return (a * b) / gcd(a, b);}
 
int mod_add(int a, int b, int m){a = (m + a % m) % m;b = (m + b % m) % m;return (a + b) % m;}
int mod_sub(int a, int b, int m){a = (m + a % m) % m;b = (m + b % m) % m;return (m + a - b) % m;}
int mod_mul(int a, int b, int m){a = (m + a % m) % m;b = (m + b % m) % m;return (a * b) % m;}
int mod_div_prime(int a, int b, int m) { return mod_mul(a, expo(b, m - 2, m), m); } // modular multiplicative inverse with prime modulo
/**************************************************/
 
void solve(){
    int n, m; cin >> n >> m;
    vector<int> a(n), b(m);
    map<int,int> cnt;
    fo(i, 0, n){
        cin >> a[i];
        cnt[a[i]]++;
    }

    fo(i, 0, m){
        cin >> b[i];
    }

    fo(i, 0, m){
        while(b[i]){
            if(cnt.find(b[i]) != cnt.end()){
                cnt[b[i]]--; 
                break;
            }
            int aval = (b[i] + 1)/2;
            if(!cnt[aval]){
                cout << "NO" << endl; return;
            }
            cnt[aval]--;
            b[i] /= 2;
        }
    }

    for(auto & it : cnt){
        if(it.second){
            cout << "NO" << endl; return;
        }
    }

    cout << "YES" << endl;

}
 
int32_t main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
 
    int t = 1;
    cin >> t;
 
    while (t--){
        solve();
    }
 
    return 0;
}
 
/*
 
 
*/


Submission (verdict: Wrong answer on test 3):
#include <bits/stdc++.h>
using namespace std;
 
#define int long long
#define ll long long
#define mod 1000000007
#define mod2 998244353
#define inf (1LL << 60)
#define all(x) (x).begin(), (x).end()
#define pii pair<int, int>
#define endl "\n"
#define cout std::cout
#define cin std::cin
#define fo(i, a, b) for (int i = a; i < b; i++)
void print(vector<int> &a){
    fo(i, 0, a.size()) cout << a[i] << " ";
    cout << endl;
}
/**************************************************/
int expo(int a, int b, int m){
    int res = 1;
    while (b > 0)
    {
        if (b & 1)
            res = (res * a) % m;
        a = (a * a) % m;
        b = (b >> 1);
    }
    return res;
}
 
int gcd(int a, int b){
    if (a < b) swap(a, b);
    return b == 0 ? a : gcd(b, a % b);
}
 
int LCM(int a, int b){return (a * b) / gcd(a, b);}
 
int mod_add(int a, int b, int m){a = (m + a % m) % m;b = (m + b % m) % m;return (a + b) % m;}
int mod_sub(int a, int b, int m){a = (m + a % m) % m;b = (m + b % m) % m;return (m + a - b) % m;}
int mod_mul(int a, int b, int m){a = (m + a % m) % m;b = (m + b % m) % m;return (a * b) % m;}
int mod_div_prime(int a, int b, int m) { return mod_mul(a, expo(b, m - 2, m), m); } // modular multiplicative inverse with prime modulo
/**************************************************/
 
void solve(){
    int n, m; cin >> n >> m;
    vector<int> a(n), b(m);
    map<int,int> cnt;
    fo(i, 0, n){
        cin >> a[i];
        cnt[a[i]]++;
    }

    fo(i, 0, m){
        cin >> b[i];
    }

    fo(i, 0, m){
        while(b[i]){
            if(cnt[b[i]]){
                cnt[b[i]]--; 
                break;
            }
            int aval = (b[i] + 1)/2;
            if(cnt.find(aval) == cnt.end()){
                cout << "NO" << endl; return;
            }
            cnt[aval]--;
            b[i] /= 2;
        }
    }

    for(auto & it : cnt){
        if(it.second){
            cout << "NO" << endl; return;
        }
    }

    cout << "YES" << endl;

}
 
int32_t main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
 
    int t = 1;
    cin >> t;
 
    while (t--){
        solve();
    }
 
    return 0;
}
 
/*
 
 
*/