-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathInterface.java
More file actions
56 lines (53 loc) · 1.01 KB
/
Interface.java
File metadata and controls
56 lines (53 loc) · 1.01 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
package test;
import java.util.*;
import java.lang.*;
import java.io.*;
/* Name of the class has to be "Main" only if the class is public. */
class Interface
{
public static void main (String[] args) throws java.lang.Exception
{
int t;
Scanner sc=new Scanner(System.in);
t=sc.nextInt();
while(t-->0)
{
int a,b,c,r=0;
a=sc.nextInt();
b=sc.nextInt();
c=sc.nextInt();
if((a*1+b*2+c*3)%2!=0)
{
System.out.print("NO");
continue;
}
if(a%2==0&&b%2==0&&c%2==0)
{
System.out.print("YES");
continue;
}
if(a%2!=0)
r+=1;
if(b%2!=0)
r+=2;
if(c%2!=0)
r+=3;
if(r==2)
{
if(a>=2||(b>=2&&c>=2))
System.out.print("YES");
else
System.out.print("NO");
}
if(r==4)
{
if(a>=3||b>=2||(a>=2&&c>=2)||(b>=2&&c>=2))
System.out.print("YES");
else
System.out.print("NO");
}
if(r==6)
System.out.print("YES");
}
}
}