forked from daiwb/Algorithm
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path1009.java
More file actions
21 lines (19 loc) · 658 Bytes
/
1009.java
File metadata and controls
21 lines (19 loc) · 658 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
import java.util.*;
import java.io.*;
import java.math.*;
class Solution {
public static void main(String[] args) throws Exception {
BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
String line;
for (int now = 0; (line = reader.readLine()) != null; ++now) {
if (now > 0) {
line = reader.readLine();
System.out.println();
}
String[] nums = line.split("\\s+");
BigInteger a = new BigInteger(nums[0]);
BigInteger b = new BigInteger(nums[1]);
System.out.println(a.gcd(b));
}
}
}