#codefestivalchinaf. [code_festival_china_f]Yakiniku
[code_festival_china_f]Yakiniku
Problem
There's a Japanese dish called 'Yakiniku', which is very similar to barbecue. You roast some pieces of meat on a grill to cook 'Yakiniku'.
You have a grill that can roast any number of pieces of meat on it at once. You want to make pieces of 'Yakiniku' using that grill.
'Yakiniku' is a very tender dish that the -th piece of meat must be put on the grill at the time , and must be picked up at the time sharp. If you pick the piece of meat later than that piece is 'scorched'. If you pick the piece of meat earlier than that piece is 'underdone'.
However, when you pick the -th piece of meat at the time , you totally forget where you put the -th piece of meat on, so you pick piece of meat from the grill at random. Calculate the probability of each piece of meat picked up 'underdone' and 'scorched'.
Input
Input is given in the following format.
:
- On the first line, you will be given the integer , the number of pieces of meat you are going to cook 'Yakiniku'.
- Following lines consists of two integers , the time you put the -th meat on the grill and the time you have to pick up that meat from the grill. are distinct from each other.
Output
Output lines. The -th line should contain the probability of -th piece of meat picked up from the grill 'underdone' and 'scorched' separated by space. Your answer is considered correct if it has an absolute or relative error less than .
Input Example 1
2
1 3
2 4
Output Example 1
0.0 0.5
0.5 0.0
Think of the st piece of meat. At the time there are pieces of meat on the grill. You pick the nd piece of meat with probability and in that case at the time the st meat will be picked up 'scorched'.
Think of the nd piece of meat. At the time the nd piece of meat is taken from the grill with probability and is 'underdone'.
Input Example 2
5
1 2
3 4
5 10
6 9
7 8
Output Example 2
0.0000000000 0.0000000000
0.0000000000 0.0000000000
0.6666666667 0.0000000000
0.3333333333 0.3333333333
0.0000000000 0.6666666667
Input Example 3
1
0 1000000000
Output Example 3
0 0