#000147

BubblePosters

Many artists announced their concerts for the upcoming holidays. Currently, there is an advertising war going on. Several agencies engaged workers to put posters on the street. In Bubble City there is only one (although very long) wall along the main street where posters are allowed. In the advertising union they have an agreement not to put posters over other, recently put posters. To make that agreement hold, they introduced a rule that an agency can send workers only if they are given a specific section of the wall which to cover fully with the posters. The section is specified by start and end positions.


Since there is little time left to the beginning of the show, agencies started to play rough: they still obey the rule about specifying sections in advance, but they do not care anymore about what was on the wall before. There are n sections specified and each of them is covered by a different poster. Workers come out one after the other.


After the concerts, agencies will want to analyze the effects of the campaign and they have to know for each different poster, on how much of the wall is their poster still visible? They will certainly employ some programmers. Are you interested?


InputFirst line contains a positive integer n, the number of poster types, with n ≤ 100000. Each of the next n lines has two real numbers ak and bk, determining the section where poster of type k has been put. For each poster type, there is exactly one section, and poster types are given in the order of execution.

OutputThe output consists of n real numbers in one line, separated by a space, printed with 3 decimal places per number. Each number represents the length of all parts of the wall, where the corresponding poster is visible.


Input:
3
2.0 5.0
3.0 7.0
4.0 6.0


Output:
1.000 2.000 2.000

Submit solution

Coming later

The grading service will be connected in a later migration step. You can inspect the task and your previous results now.