Plane stretching
시간 제한10초메모리 제한1024 MB
x좌표에 각 배율 a를 적용한 점 집합의 지름을 각 질의마다 구한다.
문제
Igor is a big fan of geometry, so he bought himself a plane together with a set of distinct points, -th of them is located at .
It was extremely easy for Igor to find two points among them furthest away from each other. He quickly got bored and decided to come up with real numbers , , , , . For each of these numbers Igor is interested in the maximum possible distance between any two of the points if he scales the -coordinate of each point by . Formally speaking, he is interested in finding the two furthest points in a set . Please help Igor!
입력
Each input contains multiple test cases. The first line contains two integers and (, ) --- the number of test cases and the group number to indicate additional constraints those test cases might satisfy. Then test cases follow.
Each test case starts with two integers and --- the number of points and the number of queries.
The following lines contain the coordinates of each point and . It is guaranteed that all points within a test case are distinct.
The following lines contain the queries, each of them is identified by a single real number --- the scaling coefficients.
Let us denote the sum of values among all test cases as , and the sum of values as . It is guaranteed that .
출력
For each test case output real numbers: the answer to -th query. Your answer will be accepted if its absolute or relative error does not exceed . More precisely, if is your answer, and is the judges' answer, then your answer will be considered correct in case .