#GL0000036. Số bánh kẹo cần chuẩn bị (Snack)
Bài tập thuộc lộ trình
Mục lục đề ⌄
Số bánh kẹo cần chuẩn bị (Snack)
Snack
Source: AtCoder
Version: Phuoc Hung OJ Extended
Problem Statement
The organizers are preparing a party, but its number of guests is not yet known. There will be either guests or guests, where and are distinct positive integers.
Choose a fixed positive number of snack pieces to prepare in advance. In either possible case, all pieces must be distributed so that every guest receives the same positive integer number of whole pieces. No pieces may remain, and no piece may be cut.
The number of pieces received by one guest may differ between the two possible cases. The two guest counts are alternatives, not two groups attending together.
Find the smallest number of pieces that satisfies these requirements for either guest count.
Input
One line containing the integers and , the two possible numbers of guests.
Output
Print one positive integer: the smallest number of pieces that can be distributed under all the stated requirements in either possible case.
Subtasks
- Subtask 1 (20 points): ;
- Subtask 2 (30 points): ;
- Subtask 3 (50 points): ;
Examples
Input
2 3
Output
6
Explanation
Six pieces work for both and guests, and no smaller positive number is divisible by both counts.