My issue
why is this logic not working . atlast if my value is even i can distribute it to both kids evenly so what’s the issue here?
My code
#include<bits/stdc++.h>
using namespace std;
int main() {
int t;
cin>>t;
while(t--){
long long int x,y;
cin>>x>>y;
long long int sum=(x*1)+(y*2);
if(sum%2!=0){
cout<<"NO"<<endl;
}
else{
cout<<"YES"<<endl;
}
}
return 0;
}
Problem Link: EQUALCOIN Problem - CodeChef