PHƯỚC HƯNG OJ · THỬ THÁCH THUẬT TOÁN
#GL0000076. Khôi phục số từ hai ước lớn nhất (Two Divisors)
HỌC THEO LỘ TRÌNH
1 lộ trìnhBài tập thuộc lộ trình
Mục lục đề ⌄
Đang đọc
Khôi phục số từ hai ước lớn nhất (Two Divisors)
Two Divisors
Source: Codeforces
Version: Phuoc Hung OJ Extended
Problem Statement
An integer not exceeding is chosen. Its two largest positive divisors strictly less than are given as . Recover any value whose two largest proper positive divisors are exactly and . At least one solution is guaranteed.
Input
One line with integers and .
Output
Print a positive integer satisfying the requirements.
Subtasks
-
Subtask 1 (20 points): , tồn tại phù hợp.
-
Subtask 2 (30 points): , tồn tại phù hợp.
-
Subtask 3 (50 points): , tồn tại phù hợp.
Examples
Input
4 6
Output
12
Explanation
The positive proper divisors of are . The two largest are and , exactly matching the input.