We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents 0430a69 + bd91dee commit 9d74433Copy full SHA for 9d74433
1 file changed
JHLEE325/202601/27 BOJ G4 음식 평론가.md
@@ -0,0 +1,27 @@
1
+```java
2
+import java.io.*;
3
+import java.util.*;
4
+
5
+public class Main {
6
+ public static void main(String[] args) throws Exception {
7
+ BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
8
+ StringTokenizer st = new StringTokenizer(br.readLine());
9
10
+ int n = Integer.parseInt(st.nextToken());
11
+ int m = Integer.parseInt(st.nextToken());
12
13
+ int res = m - gcd(n, m);
14
15
+ System.out.println(res);
16
+ }
17
18
+ public static int gcd(int a, int b) {
19
+ while (b != 0) {
20
+ int r = a % b;
21
+ a = b;
22
+ b = r;
23
24
+ return a;
25
26
+}
27
+```
0 commit comments