Created
May 14, 2018 13:13
-
-
Save vaibhavgeek/e876f1d9fca134dd8e1fbcf8a26233b2 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#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