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

Code 1:
#define _CRT_SECURE_NO_WARNINGS
#define _USE_MATH_DEFINES

#include <iostream>
#include <cmath>
#include <cstdlib>
#include <queue>
#include <deque>
#include <map>
#include <unordered_map>
#include <string>
#include <cstring>
#include <stack>
#include <vector>
#include <set>
#include <cstdint>
#include <set>
#include <algorithm>
#include <random>
#include <iomanip>
#include <cassert>
#include <string>
#include <chrono>
#include <ctime>
#include <complex>
#include <unordered_set>


#define ll unsigned long long
#define ld long double
#define nl "\n"
#define pb push_back
#define ff first
#define ss second
#define cinn(a) for (int i = 0; i < (int) a.size(); i++) cin >> a[i];
#define coutt(a) for (int i = 0; i < (int) a.size(); i++) cout << a[i] << (i == a.size() - 1 ? nl : " ");
#define sortt(a) sort(a.begin(), a.end());
#define rev(a) reverse(a.begin(), a.end());
#define int long long

using namespace std;

void solve() {
    int n,m;

    cin >> n >> m;

    priority_queue<int> q1;
    priority_queue<int> q2;

    for (int i = 0; i < n; i++) {
        int x;
        cin >> x;
        q1.push(x);
    }

    for (int i = 0; i < m; i++) {
        int x;
        cin >> x;
        q2.push(x);
    }

    for (int i = 0; i < n-m; i++) {
        if (q1.empty() || q2.empty()) break;
        int a = q1.top();
        int b = q2.top();
        if (a < b) {
            q2.pop();
            q2.push(b/2);
            q2.push(b % 2 == 1 ? b / 2 + 1 : b / 2);
        } else if (a == b) {
            q1.pop();
            q2.pop();
            i--;
        } else {
            break;
        }
    }

    if (q1.size() != q2.size()) {
        cout << "No\n";
    } else {
        while (!q1.empty()) {
            if (q1.top() != q2.top()) {
                cout << "No\n";
                return;
            }
            q1.pop();
            q2.pop();
        }
        cout << "Yes\n";
    }


}


signed main() {
#ifdef _DEBUG
    freopen("input.txt", "r", stdin);
    freopen("output.txt", "w", stdout);
    ll start = chrono::high_resolution_clock::now().time_since_epoch().count();
#endif
    //freopen("segmentupdate.in", "r", stdin);
    //freopen("segmentupdate.out", "w", stdout);

    ios_base::sync_with_stdio(0);
    cin.tie(0);
    cout.tie(0);
    //cout << fixed;
    //cout.precision(10);

    int tests = 1;
    cin >> tests;
    while (tests--) solve();

#ifdef _DEBUG
    cout << nl << "TIME ms: ";
    cout << (chrono::high_resolution_clock::now().time_since_epoch().count() - start) / 1e6 << nl;
#endif
    return 0;
}


Code 2:
#define _CRT_SECURE_NO_WARNINGS
#define _USE_MATH_DEFINES

#include <iostream>
#include <cmath>
#include <cstdlib>
#include <queue>
#include <deque>
#include <map>
#include <unordered_map>
#include <string>
#include <cstring>
#include <stack>
#include <vector>
#include <set>
#include <cstdint>
#include <set>
#include <algorithm>
#include <random>
#include <iomanip>
#include <cassert>
#include <string>
#include <chrono>
#include <ctime>
#include <complex>
#include <unordered_set>


#define ll unsigned long long
#define ld long double
#define nl "\n"
#define pb push_back
#define ff first
#define ss second
#define cinn(a) for (int i = 0; i < (int) a.size(); i++) cin >> a[i];
#define coutt(a) for (int i = 0; i < (int) a.size(); i++) cout << a[i] << (i == a.size() - 1 ? nl : " ");
#define sortt(a) sort(a.begin(), a.end());
#define rev(a) reverse(a.begin(), a.end());
#define int long long

using namespace std;

void solve() {
    int n,m;

    cin >> n >> m;

    priority_queue<int> q1;
    priority_queue<int> q2;

    for (int i = 0; i < n; i++) {
        int x;
        cin >> x;
        q1.push(x);
    }

    for (int i = 0; i < m; i++) {
        int x;
        cin >> x;
        q2.push(x);
    }

    for (int i = 0; i < n; i++) {
        int a = q1.top();
        int b = q2.top();
        if (a < b) {
            q2.pop();
            q2.push(b/2);
            q2.push(b % 2 == 1 ? b / 2 + 1 : b / 2);
        } else if (a == b) {
            q1.pop();
            q2.pop();
        } else {
            break;
        }
    }

    if (q1.size() != q2.size()) {
        cout << "No\n";
    } else {
        while (!q1.empty()) {
            if (q1.top() != q2.top()) {
                cout << "No\n";
                return;
            }
            q1.pop();
            q2.pop();
        }
        cout << "Yes\n";
    }


}


signed main() {
#ifdef _DEBUG
    freopen("input.txt", "r", stdin);
    freopen("output.txt", "w", stdout);
    ll start = chrono::high_resolution_clock::now().time_since_epoch().count();
#endif
    //freopen("segmentupdate.in", "r", stdin);
    //freopen("segmentupdate.out", "w", stdout);

    ios_base::sync_with_stdio(0);
    cin.tie(0);
    cout.tie(0);
    //cout << fixed;
    //cout.precision(10);

    int tests = 1;
    cin >> tests;
    while (tests--) solve();

#ifdef _DEBUG
    cout << nl << "TIME ms: ";
    cout << (chrono::high_resolution_clock::now().time_since_epoch().count() - start) / 1e6 << nl;
#endif
    return 0;
}


Answer: 1