CF1674A Number Transformation
Description
You are given two integers $ x $ and $ y $ . You want to choose two strictly positive (greater than zero) integers $ a $ and $ b $ , and then apply the following operation to $ x $ exactly $ a $ times: replace $ x $ with $ b \cdot x $ .
You want to find two positive integers $ a $ and $ b $ such that $ x $ becomes equal to $ y $ after this process. If there are multiple possible pairs, you can choose any of them. If there is no such pair, report it.
For example:
- if $ x = 3 $ and $ y = 75 $ , you may choose $ a = 2 $ and $ b = 5 $ , so that $ x $ becomes equal to $ 3 \cdot 5 \cdot 5 = 75 $ ;
- if $ x = 100 $ and $ y = 100 $ , you may choose $ a = 3 $ and $ b = 1 $ , so that $ x $ becomes equal to $ 100 \cdot 1 \cdot 1 \cdot 1 = 100 $ ;
- if $ x = 42 $ and $ y = 13 $ , there is no answer since you cannot decrease $ x $ with the given operations.
Input Format
N/A
Output Format
N/A