eolymp
bolt
Спробуйте наш новий інтерфейс для відправки розв'язків
Задачі

Cake Cutting

Cake Cutting

Ліміт часу 2 секунди
Ліміт використання пам'яті 64 MiB

There is a very big rectangular (yes...) cake on the xy-plane, whose four corners are (0, 0), (w, 0), (w, h) and (0, h).

Each time you're hungry, you slice a piece from the cake and eat it. Your task is to output the area of the remaining cake, after each slice.

Вхідні дані

There are several test cases. The first line contains threes integers n, w, h (1 ≤ n ≤ 200,000, 1w, h1000), the number of slices, the width and the height of the cake. Each of the following n lines contains four positive real numbers x_1, y_1, x_2, y_2 not greater than 1000. That means, you slice it along the straight line connecting (x_1, y_1) and (x_2, y_2), and eat the part on the right (if any), when looking from (x_1, y_1) to (x_2, y_2). The input is terminated by end-of-file (EOF). The size of input file does not exceed 10 MB.

Вихідні дані

For each slice, output the area of the cake after the slice, to at least three digits after the decimal point. We allow an absolute error of 10^{-3} for each value you output.

Приклад

Вхідні дані #1
2 20 10
15.0 0.0 15.0 5.0
1.0 2.0 2.0 2.0
Вихідні дані #1
150.000
120.000