-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathSakurakosExam.java
More file actions
31 lines (28 loc) · 1.04 KB
/
SakurakosExam.java
File metadata and controls
31 lines (28 loc) · 1.04 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
package Divisions.Div3.Round970;
//code by senurah
public class SakurakosExam {
public static void main(String[] args) {
java.util.Scanner scanner = new java.util.Scanner(System.in);
int t = scanner.nextInt();
if(t>=1 && t<=100){
for(int i = 0; i<t; i++){
int a = scanner.nextInt();
int b = scanner.nextInt();
if(a>=0 && a<=100 && b>=0 && b<=100){
// if(a%2==0 && b%2==0) {
// System.out.println("YES");
// } else if (((b % 2) * 2) == (a % 2) || (((b % 2) * 2) == (a))) {
// System.out.println("YES");
// } else {
// System.out.println("NO");
// }
if ((a + 2 * b) % 2 == 0 && (a != 0 || b % 2 == 0)) {
System.out.println("YES");
} else {
System.out.println("NO");
}
}
}
}
}
}