Skip to content

Instantly share code, notes, and snippets.

@vaibhavgeek
Created May 14, 2018 13:13
Show Gist options
  • Save vaibhavgeek/e876f1d9fca134dd8e1fbcf8a26233b2 to your computer and use it in GitHub Desktop.
Save vaibhavgeek/e876f1d9fca134dd8e1fbcf8a26233b2 to your computer and use it in GitHub Desktop.
#include <bits/stdc++.h>
using namespace std;
int main(){
long int t;
cin>>t;
while(t>0){
long long int c,d,l;
cin>>c>>d>>l;
long long int minl, maxl;
if(c < (2*d))
{
minl = 4*d;
}
else
{
minl = (4*d) - ((d-(2*c))*4);
}
maxl = 4*(c+d);
if(l >= minl && l <= maxl && l%4 == 0)
{
cout<<"yes"<<endl;
}
else {
cout<<"no"<<endl;
}
t--;
}
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment