#CCBOTPBA0000054. Mốc đầu tiên chia hết cả a và b (First Common Multiple at or Above L)
Mốc đầu tiên chia hết cả a và b (First Common Multiple at or Above L)
First Common Multiple at or Above L
Source: Phước Hưng OJ
Version: Phuoc Hung OJ Extended
Problem Statement
Given three positive integers , , and , find the smallest positive integer such that and is divisible by both and . If is already divisible by both, the answer is .
Input
One line contains three positive integers , , and , in that order.
Output
Print one integer: the smallest divisible by both and .
Subtasks
- Subtask 1 (20%): .
- Subtask 2 (30%): .
- Subtask 3 (50%): .
Examples
Example 1
Input:
4 6 13
Output:
24
Explanation: The first multiples of 4 at or above 13 are 16, 20 and 24. Only 24 among them is also divisible by 6; no smaller valid number exists.
Example 2
Input:
5 5 10
Output:
10
Explanation: Here and is divisible by both, so the starting bound is the answer.
Example 3
Input:
7 9 1
Output:
63
Explanation: The least positive common multiple of 7 and 9 is 63; none of 1 through 62 works.