Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include<iostream>
- using namespace std;
- int main()
- {
- int t; cin>>t;
- while(t--)
- {
- unsigned int x=0,y=0,t=0;
- if (scanf("%u %u",&x,&y));
- if (x > y)
- {
- t = x;
- x = y;
- y = t;
- }
- if (x*2 < y)
- {
- cout<<"NO\n";
- continue;
- }
- x%=3; y%=3;
- if (x > y) {t = x; x = y; y = t;}
- if (x == 0 && y == 0) cout<<"YES\n";
- else if (x == 1 && y == 2) cout<<"YES\n";
- else if (x == 2 && y == 1) cout<<"YES\n";
- else printf("NO\n");
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement