Problem: 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 [li, ri] (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 li, ri (0 ≤ li < ri ≤ 109) 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 aij 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.

Examples

Input

2
1 6
4 9


Output

0.9200000000 0.080 
0.080 0.9200000000 


Input

8
0 2
1 3
2 4
3 5
4 6
5 7
6 8
7 9


Output

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 

Note

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

Solution (in CPP):

Solution:
#include <bits/stdc++.h>
using namespace std;
int l[165], r[165];
int a[165];
int n, tot;
int num;
double ans[165], g[85][85];
int main() {
  scanf("%d", &n);
  for (int i = 1; i <= n; i++) {
    scanf("%d%d", &l[i], &r[i]);
    a[++num] = l[i];
    a[++num] = r[i];
  }
  sort(a + 1, a + num + 1);
  num = unique(a + 1, a + num + 1) - (a + 1);
  for (int k = 1; k <= n; k++) {
    memset(ans, 0, sizeof(ans));
    for (int p = 1; p <= num - 1; p++) {
      if (l[k] >= a[p + 1] || r[k] <= a[p]) continue;
      memset(g, 0, sizeof(g));
      g[0][0] = 1;
      tot = 0;
      for (int wz = 1; wz <= n; wz++) {
        if (wz == k) continue;
        if (l[wz] >= a[p + 1]) continue;
        double w1, w2;
        if (r[wz] <= a[p]) {
          w1 = 0;
          w2 = 1;
        } else {
          w1 = 1.0 * (a[p + 1] - a[p]) / (r[wz] - l[wz]);
          w2 = 1.0 * (a[p] - l[wz]) / (r[wz] - l[wz]);
        }
        tot++;
        for (int i = tot; i >= 0; i--)
          for (int j = tot - i; j >= 0; j--) {
            g[i][j] = g[i][j] * (1 - w1 - w2);
            if (i) g[i][j] += g[i - 1][j] * w1;
            if (j) g[i][j] += g[i][j - 1] * w2;
          }
      }
      double tmp = 1.0 * (a[p + 1] - a[p]) / (r[k] - l[k]);
      for (int i = 0; i <= tot; i++)
        for (int j = 0; j <= tot - i; j++) {
          ans[j] += g[i][j] * tmp / (i + 1);
          ans[i + j + 1] -= g[i][j] * tmp / (i + 1);
        }
    }
    for (int i = 1; i <= n; i++) ans[i] += ans[i - 1];
    for (int i = 0; i <= n - 1; i++) printf("%.8lf ", ans[i]);
    puts("");
  }
  return 0;
}