import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.util.StringTokenizer;
public class Main {
public static void main(String[] args) throws Exception{
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
StringTokenizer st;
int testcase = Integer.parseInt(br.readLine());
for(int i=0; i<testcase; i++){
st = new StringTokenizer(br.readLine());
int x = Integer.parseInt(st.nextToken());
int y = Integer.parseInt(st.nextToken());
if(x>y){
int temp = x;
x = y;
y = temp;
}
int a = x; int b = y;
int temp = b;
while(temp!=0){
temp = b%a;
b = a;
a = temp;
}
int gcd = b;
System.out.println((x*y)/gcd);
}
}
}
'1d-1c > BOJ' 카테고리의 다른 글
6588_골드바흐의 추측 (JAVA) (0) | 2020.11.22 |
---|---|
9613_GCD 합 (JAVA) (0) | 2020.11.22 |
1652_누울 자리를 찾아라 (JAVA) (0) | 2020.11.19 |
1764_듣보잡 (JAVA) (0) | 2020.11.19 |
1759_암호 만들기 (JAVA) (0) | 2020.11.18 |