Problem: 2061D - Kevin and Numbers
Language: c++23 

Code 1:
#include <bits/stdc++.h>
using namespace std;
#define ll int
#define lld long double
#define pll pair <ll, ll> 
#define f(i, a, b) for(ll i = a; i < b; i++)
#define br cout<<"\n";
const long long int N =  2e5+20;
const long long int M =  998244353;

ll binpow(ll x, ll y, ll MOD){
    ll res = 1; x %= MOD;
    while(y > 0){
        if(y&1ll){res = (res * x) % MOD;}
        x = (x * x) % MOD;
        y >>= 1LL;
    }
    res %= MOD;
    return res;
}


void solve(){ 
    ll n, m; 
    cin>>n>>m;
    vector <ll> a(n), b(m); 
    multiset <ll> s, t;
    f(i, 0, n){
        cin>>a[i];
        s.insert(a[i]);
    }
    f(j, 0, m){
        cin>>b[j];
        t.insert(b[j]);
    }
    ll cnt = 0; 
    while(cnt < n-m){
        vector <ll> v;
        for(auto x: t){
            if(s.find(x) != s.end()){
                s.erase(s.find(x));
            }
            else{
                cnt++;
                v.push_back(x/2);
                v.push_back((x+1)/2);
            }
            
        }
        t.clear();
        assert(t.size() == 0);
        for(auto x: v){
            t.insert(x);
        }
        if(t.empty() || s.empty()){break;}
    }
    if(t.size() != s.size()){
        cout<<"NO\n";
        return;
    }
    for(auto x: t){
        if(s.find(x) == s.end()){
            cout<<"NO\n"; 
            return;
        }
        if(s.count(x) != t.count(x)){
            cout<<"NO\n";
            return;
        }
    }
    for(auto x: s){
        if(t.find(x) == t.end()){
            cout<<"NO\n"; 
            return;
        }
        if(s.count(x) != t.count(x)){
            cout<<"NO\n";
            return;
        }
    }
    cout<<"YES\n";
    return;
}   

int main(){
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    cout.tie(NULL);
    int TT = 1;
    cin >> TT;
    f(tt, 1, TT+1){
        solve();
    }
    return 0;
}

Code 2:
#include <bits/stdc++.h>
using namespace std;
#define ll int
#define lld long double
#define pll pair <ll, ll> 
#define f(i, a, b) for(ll i = a; i < b; i++)
#define br cout<<"\n";
const long long int N =  2e5+20;
const long long int M =  998244353;

ll binpow(ll x, ll y, ll MOD){
    ll res = 1; x %= MOD;
    while(y > 0){
        if(y&1ll){res = (res * x) % MOD;}
        x = (x * x) % MOD;
        y >>= 1LL;
    }
    res %= MOD;
    return res;
}


void solve(){ 
    ll n, m; 
    cin>>n>>m;
    vector <ll> a(n), b(m); 
    multiset <ll> s, t;
    f(i, 0, n){
        cin>>a[i];
        s.insert(a[i]);
    }
    f(j, 0, m){
        cin>>b[j];
        t.insert(b[j]);
    }
    ll cnt = 0; 
    while(cnt < n-m){
        vector <ll> v;
        for(auto x: t){
            if(s.find(x) != s.end()){
                s.erase(s.find(x));
            }
            else{
                cnt++;
                v.push_back(x/2);
                v.push_back((x+1)/2);
            }
            
        }
        t.clear();
        assert(t.size() == 0);
        for(auto x: v){
            t.insert(x);
        }
        if(t.empty() || s.empty()){break;}
    }
    if(t.size() != s.size()){
        cout<<"NO\n";
        return;
    }
    vector <ll> x, y;
    for(auto z: t){
        x.push_back(z);
    }
    for(auto z: s){
        y.push_back(z);
    }
    f(i, 0, x.size()){
        if(x[i] != y[i]){
            cout<<"NO\n";
            return;
        }
    }
    
    cout<<"YES\n";
    return;
}   

int main(){
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    cout.tie(NULL);
    int TT = 1;
    cin >> TT;
    f(tt, 1, TT+1){
        solve();
    }
    return 0;
}

Answer: 2