405086: GYM101778 G Preparing for Exams

Memory Limit:256 MB Time Limit:1 S
Judge Style:Text Compare Creator:
Submit:0 Solved:0

Description

G. Preparing for Examstime limit per test1.5 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard output

Ran Mouri and Sonoko Suzuki are preparing for the final exams. They decided to study mathematics as it is the hardest subject for them. While they are solving mathematical problems, they faced troubles with some questions, including the following question:

You are given a drawing for a sensor and some measurements about it. You have to find the rest of measurements. Sensor's design is as follow:

The data you have is the length of , the length of , the area of oda, and the area of obc. Your task is to calculate x and y, where x is the length of and y is the length of .

Can you help Ran and Sonoko Suzuki by solving this question?

Input

The first line contains an integer T (1 ≤ T ≤ 2 × 105), in which T is the number of test cases.

Then T lines follow, each line contains four integers k, l, m, and n (1 ≤ k, l, m, n ≤ 1012), in which k is the length of , l is the length of , m is the area of oda, and n is the area of obc.

Output

For each test case, print a single line containing two numbers x and y, where x is the length of and y is the length of . Your output will be considered correct if the absolute or relative error of every number in your output does not exceed 10 - 6.

ExampleInput
1
18 16 72 288
Output
20 14

加入题单

算法标签: