A. EhAb AnD gCd

cout<<1<<" "<<x-1<<endl;

B. CopyCopyCopyCopyCopy

sort(a,a+n);

C. Ehab and Path-etic MEXs

#include<bits/stdc++.h>
using namespace std;
int n,u,v,f[100011],t[100011],s[100011],r[100011],c;
int main()
{
    scanf("%d",&n);
    if(n==2)
    {
        printf("0");
        return 0;
    }
    for(int i=1;i<n;++i)
    {
        scanf("%d%d",&f[i],&t[i]);
        s[f[i]]++;
        s[t[i]]++;
        r[i]=-1;
    }
    for(int i=1;i<n;++i)
    {
        if(s[f[i]]==1)
            r[i]=c++;
        else if(s[t[i]]==1)
            r[i]=c++;
        if(c==3)
            break;
    }
    for(int i=1;i<n;++i)
        printf("%d\n",r[i]==-1?c++:r[i]);
    return 0;
}

D. Ehab the Xorcist

int main(){
    ll u,v;
    cin>>u>>v;
    if(u==v){
        if(u==0)return O(0);
        O(1);return O(u);
    }
    ll n=v-u;
    if((n&1)||u>v)return O(-1);
    n>>=1;
    ll ans=0;
    for(int i=0;i<64;i++){
        int x=n>>i&1;
        int y=u>>i&1;
        if(x&&y){
            O(3);
            cout<<u<<" "<<n<<" "<<n<<endl;
            return 0;
        }
        if(!y&&!x)continue;
        ans+=1LL<<i;
    }
    O(2);
    cout<<ans<<" "<<v-ans<<endl;
}