problem Link :
(MULTHREE Problem - CodeChef)
See below My code
#include<bits/stdc++.h>
#define fast ios_base::sync_with_stdio(false);cin.tie(0);
#define lli long long int
#define vi vector<lli>
#define pb push_back
#include<string>
#define mp map<string,lli>
#define test lli t;cin>>t;while(t--)
using namespace std;
int main()
{
test
{
lli n,x,y;
cin>>n>>x>>y;
lli z=x+y;
n=n-3;
lli lst;
if(n%4==0)
lst=6;
else if(n%4==1)
lst=2;
else if(n%4==2)
lst=4;
else
lst=8;
if((lst*z)%3==0)
cout<<"YES\n";
else
cout<<"NO\n";
}
}