#P13545. [OOI 2022] Plane stretching
[OOI 2022] Plane stretching
题目描述
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 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 .
2 0
5 2
0 0
1 1
0 2
-1 3
0 4
1
2.5
8 4
0 0
6 11
7 13
4 14
0 15
-4 14
-7 13
-6 11
2
1
1.25
1.5
4.000000
5.385165
28.000000
15.000000
17.500000
21.000000
提示
Scoring
The testset for this problem consists of 9 test groups. You get points for a group only if your solution passes all tests from this group and from all the required groups. means that you will not get immediate feedback for this group and you will be able to see the outcome only after the end of the competition.
Random points means that each coordinate is chosen uniformly and independently between and .
Group | Points | Additional constraints | < | Required groups | Comment | ||
---|---|---|---|---|---|---|---|
0 | -- | Sample test cases | |||||
1 | 12 | 0 | |||||
2 | 9 | 0 -- 1 | |||||
3 | 13 | 0 -- 2 | |||||
4 | 11 | -- | Random points | ||||
5 | 8 | -- | 4 | ||||
6 | 12 | 0 -- 3 | |||||
7 | 11 | -- | 0 -- 3, 6 | ||||
8 | 10 | 0 -- 4, 6 | |||||
9 | 14 | -- | 0 -- 8 | Offline-evaluation |