Find The Point

All submissions for this problem are available.
Read problems statements in Mandarin Chinese, Russian and Vietnamese as well.
Jem is going to buy a house in Bearland. Can you help him to choose it?
Bearland has shape of circle with radius R metres and center at the point (0, 0). There is a house at every point with integer coordinates (expressed in metres), excluding the border. Since Jem likes traveling abroad, he wants to live very close to the border. More precisely, his house must be at most K centimeters away from the circular border. He also requires that the coordinates of his house must be positive. Find and print coordinates of any house fulfilling Jem's wishes. If there is no such house, print 1.
Input
The first line of the input contains one integer T — the number of test cases.
The ith of following T lines contains two integers R_{i} and K_{i}, describing one test case.
Output
For each test case print the answer in a separate line — two integer coordinates of any house Jem can buy, or print 1 if none house satisfies the described conditions.
Constraints
 1 ≤ T ≤ 100
 2 ≤ R_{i} ≤ 10^{9}
 1 ≤ K_{i} ≤ 99
Example
Input 1: 2 10 16 12 1 Output 1: 9 4 1
Explanation
test #1: Jem's house must be at most 16 centimeters  which is equal to 0.16 metres away from the border. The distance from the point (9, 4) to the border is: 10  sqrt(9^{2} + 4^{2}) ~ 0.15 < 0.16.
Author:  tuananh93 
Tester:  errichto 
Editorial  http://discuss.codechef.com/problems/TAPOINT 
Tags  cook74, geometry, math, medium, tuananh93 
Date Added:  15092016 
Time Limit:  1 sec 
Source Limit:  50000 Bytes 
Languages:  C, CPP14, JAVA, PYTH, PYTH 3.5, PYPY, CS2, PAS fpc, PAS gpc, RUBY, PHP, GO, NODEJS, HASK, SCALA, D, PERL, FORT, WSPC, ADA, CAML, ICK, BF, ASM, CLPS, PRLG, ICON, SCM qobi, PIKE, ST, NICE, LUA, BASH, NEM, LISP sbcl, LISP clisp, SCM guile, JS, ERL, TCL, PERL6, TEXT, SCM chicken, CLOJ, FS 
Comments
 Please login at the top to post a comment.
SUCCESSFUL SUBMISSIONS
Fetching successful submissions
HELP
If you are still having problems, see a sample solution here. 