Codeforces Round 183 (Div. 1)
E
Random Ranking
Codeforces
3000
原题
← D→
翻译中…

Imagine a real contest or exam of $*n*$ participants. Every participant will get a particular score. We can predict the standings board more or less, if we do some statistics on their previous performance.

翻译中…

image

翻译中…

Let's say the score of the participants will be uniformly distributed in interval $[*l*_{*i*}, *r*_{*i*}]$ (the score can be a real number). Can you predict the standings board according to these data? In other words you should say for each participant the probability that he gets some fixed place in the scoreboard. The participants are sorted by increasing of their scores in the scoreboard. So, the participant with the largest score gets the last place.

翻译中…

Input

翻译中…

The first line contains integer $*n*$ ($1  ≤ *n*  ≤ 80$), showing how many participants we have. Each of the next $*n*$ lines contains our predictions, the $*i*$-th line contains a pair of integers $*l*_{*i*}, *r*_{*i*}$ $(0 ≤ *l*_{*i*} < *r*_{*i*} ≤ 10^{9})$ as the distributed interval for participant $*i*$.

翻译中…

Consider the participants numbered from $1$ to $*n*$ in some way.

翻译中…

Output

翻译中…

Output a distributed matrix $*a*$ of order $*n*$. The element $*a*_{*ij*}$ of the matrix is the probability that participant $*i*$ has rank $*j*$.

翻译中…

Your answer will considered correct if it has at most $10^{ - 6}$ absolute or relative error.

翻译中…

Note

翻译中…

The score probability distribution is continuous, which means, there is no possibility for a draw.

翻译中…

样例

Input #1
2
1 6
4 9
Output #1
0.9200000000 0.080
0.080 0.9200000000
InputCopy OutputCopy
Input #2
8
0 2
1 3
2 4
3 5
4 6
5 7
6 8
7 9
Output #2
0.875 0.125 0 0 0 0 0 0
0.125 0.750 0.125 0 0 0 0 0
0 0.125 0.750 0.125 0 0 0 0
0 0 0.125 0.750 0.125 0 0 0
0 0 0 0.125 0.750 0.125 0 0
0 0 0 0 0.125 0.750 0.125 0
0 0 0 0 0 0.125 0.750 0.125
0 0 0 0 0 0 0.125 0.875
InputCopy OutputCopy
题目信息
题号
303E
时间限制
2 s
内存限制
256 MB
标签
动态规划
数学
概率论

题面与样例版权归 Codeforces 及出题人所有;中文翻译由 AI 生成(CI 管线),如有出入请以原文为准。