Skip to content

Commit 99216ef

Browse files
authored
Create CATSDOGS.cpp
1 parent 132739a commit 99216ef

File tree

1 file changed

+35
-0
lines changed

1 file changed

+35
-0
lines changed

Codeshef/CATSDOGS.cpp

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
#include <stdio.h>
2+
3+
using namespace std;
4+
5+
int main()
6+
{
7+
int T;
8+
scanf("%d",&T);
9+
while(T--){
10+
long long int C, D, L;
11+
scanf("%lld",&C);
12+
scanf("%lld",&D);
13+
scanf("%lld",&L);
14+
if(L%4==0){
15+
if((L/4)<=(C+D)){
16+
if(C<=(2*D)){
17+
if((L/4)>=D){
18+
printf("%s\n","yes");
19+
}
20+
else printf("%s\n","no");
21+
22+
}
23+
else if(C>(2*D)){
24+
if((L/4)>=(C-D)){
25+
printf("%s\n","yes");
26+
}
27+
else printf("%s\n","no");
28+
}
29+
}
30+
else printf("%s\n","no");
31+
}
32+
else printf("%s\n","no");
33+
}
34+
return 0;
35+
}

0 commit comments

Comments
 (0)