Strange_Fractions
题号:NC231122
时间限制:C/C++/Rust/Pascal 1秒,其他语言2秒
空间限制:C/C++/Rust/Pascal 256 M,其他语言512 M
Special Judge, 64bit IO Format: %lld

题目描述

Given a positive fraction , you should find two positive integers a,b that . If no such integers, report it.

输入描述:

The first line contains one integer , denoting the number of test cases.

For each test case:

Input one line containing two integers , denoting the given fraction.

输出描述:

For each test case:

If solution exists, output one line containing two integers , or print two zeros in one line if no solution.
示例1

输入

复制
2
5 2
5 1

输出

复制
1 2
0 0

说明

For the first case, \frac{5}{2} = \frac{1}{2} + \frac{2}{1} holds. So one possible solution is a=1,b=2.