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

Code 1:
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace std;
using namespace __gnu_pbds;
template<class T> using oset = tree< T , null_type , less<T> , rb_tree_tag , tree_order_statistics_node_update >; 
// *st.find_by_order(i) --> element at ith position
// st.order_of_key(x) --> no. of ele less than x
//For multiset change less to less_equal and for reverse order change less to greater
#define int long long 
#define endl '\n'
#define all(x) (x).begin(), (x).end()
template<typename T> // cin >> vector<T>
istream& operator>>(istream &istream, vector<T> &v){for(auto &it : v)cin >> it;return istream;}
template<typename T> // cout << vector<T>
ostream& operator<<(ostream &ostream, const vector<T> &c){for(auto &it : c)cout << it << " ";return ostream;}

signed main()
{
    ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL);
    int testCase; cin >> testCase;
    while(testCase--) {
        int n , m;
        cin >> n >> m;
        multiset<int>A,B;
        for(int i = 0 ; i < n ; i++) {
            int x; cin >> x;
            A.insert(x);
        }
        for(int i = 0 ; i < m ; i++) {
            int x; cin >> x;
            B.insert(x);
        }
        int sumA = accumulate(all(A),0LL) , sumB = accumulate(all(B),0LL);
        if(m > n or sumA != sumB) {
            cout << "No" << endl;
            continue;
        }
        while(B.size() > 0 and A.size() > 0) {
            if(*(--A.end()) > *(--B.end())) break;
            if(*(--A.end()) == *(--B.end())) {
                A.erase(--A.end());
                B.erase(--B.end());
            } else {
                int x = *(--B.end());
                B.erase(--B.end());
                B.insert(x / 2);
                B.insert((x + 1) / 2);
            }
        }
        if(A == B) cout << "Yes" << endl;
        else cout << "No" << endl;
    }
    return 0;
}

Code 2:
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace std;
using namespace __gnu_pbds;
template<class T> using oset = tree< T , null_type , less<T> , rb_tree_tag , tree_order_statistics_node_update >; 
// *st.find_by_order(i) --> element at ith position
// st.order_of_key(x) --> no. of ele less than x
//For multiset change less to less_equal and for reverse order change less to greater
#define int long long 
#define endl '\n'
#define all(x) (x).begin(), (x).end()
template<typename T> // cin >> vector<T>
istream& operator>>(istream &istream, vector<T> &v){for(auto &it : v)cin >> it;return istream;}
template<typename T> // cout << vector<T>
ostream& operator<<(ostream &ostream, const vector<T> &c){for(auto &it : c)cout << it << " ";return ostream;}

signed main()
{
    ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL);
    int testCase; cin >> testCase;
    while(testCase--) {
        int n , m;
        cin >> n >> m;
        vector<int>arr(n) , brr(m);
        cin >> arr >> brr;
        vector<int>tmp;
        multiset<int>A(all(arr)),B(all(brr));
        if(m > n) {
            cout << "No" << endl;
            continue;
        }
        auto i = B.begin();
        while(i != B.end()) {
            auto it = A.find(*i);
            if(it != A.end()) {
                tmp.push_back(*it);
                A.erase(it);
            }
            ++i;
        }
        for(auto j : tmp) {
            auto it = B.find(j);
            if(it != B.end()) B.erase(it);
        }
        int diff = max(n - m,10000LL);
        while(diff-- and B.size() > 0 and A.size() > 0) {
            if(*(--A.end()) == *(--B.end())) {
                A.erase(--A.end());
                B.erase(--B.end());
            } else {
                int x = *(--B.end());
                B.erase(--B.end());
                B.insert(x / 2);
                B.insert((x + 1) / 2);
                if(x == 1) break;
            }
        }
        vector<int>finalA(all(A)) , finalB(all(B));
        if(finalA == finalB) cout << "Yes" << endl;
        else cout << "No" << endl;
    }
    return 0;
}

Answer: 1