
ZOJ Problem Set  2361
Consider N different lines on the plane. They divide it to several parts, some of which are finite, some infinite. Your task in this problem is for each finite part to find its area. This problem contains multiple test cases! The first line of a multiple input is an integer N, then a blank line followed by N input blocks. Each input block is in the format indicated in the problem description. There is a blank line between input blocks. The output format consists of N output blocks. There is a blank line between output blocks. Input The first line of the input file contains N �� the number of lines (1 <= N <= 80). Each of next N lines contains four integer numbers x_{1}, y_{1}, x_{2} and y_{2}  the coordinates of two different points of the line. All coordinates do not exceed 10^{2} by their absolute value. No two lines coincide. Output First output K  the number of finite parts among those the lines divide the plane to. Next K lines of the output file must contain area parts sorted in nondecreasing order. You answer must be accurate up to 10^{4}. Due to floating point precision losses possible, do not consider parts with area not exceeding 10^{8}. Sample Input
1 Sample Output
2 Author: Andrew Stankevich Source: Andrew Stankevich's Contest #3 