My code is failing for some cases. Can anyone tell me error in my code.
My code
#include <iostream>
using namespace std;
int main() {
int t;
cin >> t;
for(int i=1;i<=t;i++){
int n,m,c,d;
cin >> n >> m;
c=n;
d=m;
if(c>d){
n--;
m++;
}
if(d>c){
m--;
n = n+3;
}
if(m==n){
cout << "YES" << endl;
}
if(m!=n){
cout << "NO" << endl;
}
}
return 0;
}
Problem Link: PR0BLEM Problem - CodeChef