diff --git "a/JHLEE325/202601/27 BOJ G4 \354\235\214\354\213\235 \355\217\211\353\241\240\352\260\200.md" "b/JHLEE325/202601/27 BOJ G4 \354\235\214\354\213\235 \355\217\211\353\241\240\352\260\200.md" new file mode 100644 index 00000000..7f048db3 --- /dev/null +++ "b/JHLEE325/202601/27 BOJ G4 \354\235\214\354\213\235 \355\217\211\353\241\240\352\260\200.md" @@ -0,0 +1,27 @@ +```java +import java.io.*; +import java.util.*; + +public class Main { + public static void main(String[] args) throws Exception { + BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); + StringTokenizer st = new StringTokenizer(br.readLine()); + + int n = Integer.parseInt(st.nextToken()); + int m = Integer.parseInt(st.nextToken()); + + int res = m - gcd(n, m); + + System.out.println(res); + } + + public static int gcd(int a, int b) { + while (b != 0) { + int r = a % b; + a = b; + b = r; + } + return a; + } +} +```