PHƯỚC HƯNG OJ · THỬ THÁCH THUẬT TOÁN
#GL0000079. Tìm hai số có BCNN nằm trong đoạn (LCM Problem)
HỌC THEO LỘ TRÌNH
1 lộ trìnhBài tập thuộc lộ trình
Mục lục đề ⌄
Đang đọc
Tìm hai số có BCNN nằm trong đoạn (LCM Problem)
LCM Problem
Source: Codeforces
Version: Phuoc Hung OJ Extended
Problem Statement
Given integers , find satisfying and . Any valid pair is accepted. If no such pair exists, print -1 -1.
Input
One line containing integers and .
Output
Print a valid pair , or -1 -1 if impossible.
Subtasks
-
Subtask 1 (20 points): .
-
Subtask 2 (30 points): .
-
Subtask 3 (50 points): .
Examples
Input
2 4
Output
2 4
Explanation
and lies in , so the pair is valid.