-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathP337.java
60 lines (37 loc) · 1.16 KB
/
P337.java
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
57
58
59
60
package aceptaelreto;
import java.util.*;
public class P337 {
static Scanner s;
static String igual(int[] b, int[] d, int ig){
boolean igual = true;
int i = 1;
int num;
while(igual && i != 6){
num = b[i] + d[i];
if(num != ig)
igual = false;
else
i++;
}
return igual ? "SI":"NO";
}
static void llegir(int[] n){
for(int i = 0; i < 6; i++)
n[i] = s.nextInt();
}
static void cas(){
int[] d,b;
d = new int[6];
b = new int[6];
llegir(d);
llegir(b);
int ig = d[0]+ b[0];
String resp = igual(d,b,ig);
System.out.printf("%s\n",resp);
}
public static void main(String[] args) {
s = new Scanner(System.in);
int n = s.nextInt();
for (int i = 0; i<n; i++) cas();
}
}