#570. 「Nowcoder多校 2019 Day2」Polygons
「Nowcoder多校 2019 Day2」Polygons
题目描述
Lines make polygons. Given N lines, please tell how many closed polygons are formed by these N straight lines and what is the largest and smallest area of them? Moreover, could you tell -th largest area?
输入格式
The first line of input contains an integers N indicating the number of lines. Following N lines each contains four space-separated integers indicating two points on the i-th line. The next line contains an integer M indicating the number of questions. Following M lines each contains an integer .
输出格式
First output a single line containing three numbers, the number of closed polygons, the largest area and the smallest area. Then, output m lines each contains a number indicating -th largest area. If is greater than the number of polygons, output "(without quotes) instead. Your answer will be considered correct if its absolute or relative error doesn't exceed
样例
样例输入 1
6
1 1 0 2
1 3 0 4
1 6 0 7
1 3 0 2
1 -1 0 -2
1 4 0 4
7
1
2
3
4
5
6
7
样例输出 1
6 5.75 0.25
5.75
4.0
3.0
2.25
1.0
0.25
Invalid question
数据范围与提示
3≤N≤1000
No three lines intersect in one point No two lines coincide There is at least 1 closed polygon