My issue
((B - A) % 3 == 0) why
My code
#include <iostream>
#include <cmath>
using namespace std;
int main() {
int t;
cin >> t;
for(int i = 1; i <= t; i++) {
int A, B;
cin >> A >> B;
int diff = B - A;
if ((B - A) % 3 == 0) {
cout << "Yes\n";
}
else if ((B - A) % 3 == 1) {
cout << "Yes\n";
}
else {
cout << "No\n";
}
}
return 0;
}
Learning course: Complete C++ course
Problem Link: CodeChef: Practical coding for everyone