View difference between Paste ID: uTfQL0rs and y7Kvy9sL
SHOW: | | - or go back to the newest paste.
1
#include<iostream>
2
using namespace std;
3
int main()
4
{
5-
    int t; if (scanf("%u",&t));
5+
    int t; cin>>t;
6
    while(t--)
7
    {
8
        unsigned int x=0,y=0,t=0;
9
        if (scanf("%u %u",&x,&y));
10
        if (x > y)
11
        {
12
            t = x;
13
            x = y;
14
            y = t;
15
        }
16
        if (x*2 < y)
17
        {
18
            cout<<"NO\n";
19
            continue;
20
        }
21
        x%=3; y%=3;
22
        if (x > y) {t = x; x = y; y = t;}
23
        if (x == 0 && y == 0) cout<<"YES\n";
24
        else if (x == 1 && y == 2) cout<<"YES\n";
25
        else if (x == 2 && y == 1) cout<<"YES\n";
26
        else printf("NO\n"); 
27
    }
28
    return 0;
29
}