PHƯỚC HƯNG OJ · THỬ THÁCH THUẬT TOÁN
#GL0000125. Bài toán chia số (Another Problem About Dividing Numbers)
HỌC THEO LỘ TRÌNH
1 lộ trìnhBài tập thuộc lộ trình
Mục lục đề ⌄
Đang đọc
Bài toán chia số (Another Problem About Dividing Numbers)
Another Problem About Dividing Numbers
Source: Codeforces
Version: Phuoc Hung OJ Extended
Problem Statement
Given positive integers and a positive integer , one operation chooses either current number, selects an integer divisor , and replaces the chosen number by its quotient upon division by . Determine whether the two numbers can be made equal in exactly operations. Every operation must divide one number by an integer greater than 1.
Input
A single line contains three integers .
Output
Print YES if possible and NO otherwise.
Subtasks
- Subtask 1 (20 points): ; ; .
- Subtask 2 (30 points): ; ; .
- Subtask 3 (50 points): ; ; .
Examples
Input
2 8 1
Output
YES
Explanation
In one move, divide 8 by 4 to obtain 2, so the two numbers become equal.