-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathI046.java
More file actions
33 lines (29 loc) · 853 Bytes
/
I046.java
File metadata and controls
33 lines (29 loc) · 853 Bytes
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
package levelB;
import java.util.Scanner;
public class I046 {
public static void main(String[] args) {
Scanner s=new Scanner(System.in);
int N=s.nextInt();
int count_jia=0,count_yi=0;
for(int i=0;i<N;i++){
boolean flag1=true,flag2=true;
int jiahan=s.nextInt();
int jiahua=s.nextInt();
int yihan=s.nextInt();
int yihua=s.nextInt();
if(jiahan+yihan==jiahua){
count_yi++;
flag1=false;
}
if(jiahan+yihan==yihua){
count_jia++;
flag2=false;
}
if(!flag1&&!flag2){
count_jia--;
count_yi--;
}
}
System.out.print(count_jia+" "+count_yi);
}
}