시간 제한 메모리 제한 제출 정답 맞은 사람 정답 비율
2 초 512 MB 1599 968 918 63.485%

문제

정수 A는 정수 B를 0보다 큰 정수인 N회 곱해 A를 구할 수 있다면 A는 B의 배수이다.

예:

  • 10은 5의 배수이다 (5*2 = 10)
  • 10은 10의 배수이다(10*1 = 10)
  • 6은 1의 배수이다(1*6 = 6)
  • 20은 1, 2, 4,5,10,20의 배수이다.

다른 예:

  • 2와 5의 최소공배수는 10이고, 그 이유는 2와 5보다 작은 공배수가 없기 때문이다.
  • 10과 20의 최소공배수는 20이다.
  • 5와 3의 최소공배수는 15이다.

당신은 두 수에 대하여 최소공배수를 구하는 프로그램을 작성 하는 것이 목표이다.

입력

한 줄에 두 정수 A와 B가 공백으로 분리되어 주어진다.

50%의 입력 중 A와 B는 1000(103)보다 작다. 다른 50%의 입력은 1000보다 크고 100000000(108)보다 작다.

추가: 큰 수 입력에 대하여 변수를 64비트 정수로 선언하시오. C/C++에서는 long long int를 사용하고, Java에서는 long을 사용하시오.

출력

A와 B의 최소공배수를 한 줄에 출력한다.

예제 입력 1

1 1

예제 출력 1

1

예제 입력 2

3 5

예제 출력 2

15

예제 입력 3

1 123

예제 출력 3

123

예제 입력 4

121 199

예제 출력 4

24079

힌트

W3sicHJvYmxlbV9pZCI6IjEzMjQxIiwicHJvYmxlbV9sYW5nIjoiMCIsInRpdGxlIjoiXHVjZDVjXHVjMThjXHVhY2Y1XHViYzMwXHVjMjE4IiwiZGVzY3JpcHRpb24iOiI8cD5cdWM4MTVcdWMyMTggQVx1YjI5NCBcdWM4MTVcdWMyMTggQlx1Yjk3YyAwXHViY2Y0XHViMmU0IFx1ZDA3MCBcdWM4MTVcdWMyMThcdWM3NzggTlx1ZDY4YyBcdWFjZjFcdWQ1NzQgQVx1Yjk3YyBcdWFkNmNcdWQ1NjAgXHVjMjE4IFx1Yzc4OFx1YjJlNFx1YmE3NCBBXHViMjk0IEJcdWM3NTggXHViYzMwXHVjMjE4XHVjNzc0XHViMmU0Ljxc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