최대공약수 (GCD)
private static long gcd(long a, long b) {
if(a % b == 0) return b;
return gcd(b, a%b);
}
public static int gcd(int a, int b) {
if(b == 0) return a;
return gcd(b, a%b);
}
최소공배수 (LCM)
import java.io.*;
import java.util.*;
public class num13241 {
public static void main(String[] args) throws IOException {
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
StringTokenizer st;
st = new StringTokenizer(br.readLine());
long A = Integer.parseInt(st.nextToken());
long B = Integer.parseInt(st.nextToken());
System.out.println(A * B / gcd(A, B));
}
private static long gcd(long a, long b) {
if(a % b == 0) return b;
return gcd(b, a%b);
}
}