-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathJ10103.java
More file actions
30 lines (24 loc) · 825 Bytes
/
Copy pathJ10103.java
File metadata and controls
30 lines (24 loc) · 825 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
package TIL;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.StringTokenizer;
public class J10103 {
public static void main(String[] args) throws IOException {
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
int n = Integer.parseInt(br.readLine());
int Acount = 100;
int Bcount = 100;
for(int i = 0; i < n; i++) {
StringTokenizer st = new StringTokenizer(br.readLine());
int A = Integer.parseInt(st.nextToken());
int B = Integer.parseInt(st.nextToken());
if(A > B) {
Bcount -= A;
}else if(A < B) {
Acount -= B;
}
}
System.out.println(Acount + "\n" + Bcount);
}
}