Hard deck/Module
External Module and Access Opener
서버관리자 페페
2022. 8. 4. 12:52
import java.util.Scanner;
public class Main {
public static void main(String[] args) throws Exception {
// Input Supply Cable
Scanner sc = new Scanner(System.in);
int T = sc.nextInt();
for (int i = 0; i < T; i++) {
// Preprocessing
int A = sc.nextInt();
int B = sc.nextInt();
// Operating LCM
int result = A*B / GCD(A, B);
// Output Extracting Cable
System.out.println(result);
}
}
// External Module
public static int GCD(int A, int B) {
if (B == 0)
return A;
else
return GCD (B, A%B);
}
}