PHƯỚC HƯNG OJ · THỬ THÁCH THUẬT TOÁN
#GL0000113. Tách thành hai số không nguyên tố cùng nhau (Non-coprime Split)
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ách thành hai số không nguyên tố cùng nhau (Non-coprime Split)
Non-coprime Split
Source: Codeforces
Version: Phuoc Hung OJ Extended
Problem Statement
Given an integer interval , find positive integers such that and . Any valid pair is accepted. Print -1 if none exists.
Input
One line containing .
Output
Print -1 if impossible; otherwise print two integers .
Subtasks
- Subtask 1 (20 points): .
- Subtask 2 (30 points): .
- Subtask 3 (50 points): .
Examples
Input
11 15
Output
2 10
Explanation
lies in , and .