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;
const int inf = 1e9;
const double eps = 1e-9;
struct unit {
  int l, r;
  double pl, pm, pr;
};
struct unit a[110];
int n, n1;
int sa[1010];
double ans[110][110], f[110][110];
int intersect(int l1, int r1, int l2, int r2) {
  return max(0, min(r1, r2) - max(l1, l2));
}
int main() {
  int i1, i, j, k, p, s1, s2;
  double t;
  scanf("%d", &n);
  for (i = 1; i <= n; i++) {
    scanf("%d%d", &a[i].l, &a[i].r);
    sa[++n1] = a[i].l;
    sa[++n1] = a[i].r;
  }
  sort(sa + 1, sa + n1 + 1);
  for (i = 1; i <= n; i++)
    for (j = 1; j < n1; j++) {
      t = (double)intersect(a[i].l, a[i].r, sa[j], sa[j + 1]) /
          (a[i].r - a[i].l);
      if (sa[j] == sa[j + 1] || t < eps) continue;
      for (k = 1; k <= n; k++) {
        a[k].pl = a[k].pm = a[k].pr = 0;
        if (k == i)
          a[k].pm = 1;
        else {
          a[k].pl =
              (double)intersect(a[k].l, a[k].r, 0, sa[j]) / (a[k].r - a[k].l);
          a[k].pm = (double)intersect(a[k].l, a[k].r, sa[j], sa[j + 1]) /
                    (a[k].r - a[k].l);
          a[k].pr = (double)intersect(a[k].l, a[k].r, sa[j + 1], inf) /
                    (a[k].r - a[k].l);
        }
      }
      memset(f, 0, sizeof(f));
      f[0][0] = 1;
      for (p = 1; p <= n; p++) {
        i1 = p & 1;
        for (s1 = p; s1 >= 0; s1--)
          for (s2 = p - s1; s2 >= 0; s2--) {
            f[s1][s2] = f[s1][s2] * a[p].pm;
            f[s1][s2] += f[s1 - 1][s2] * a[p].pl;
            f[s1][s2] += f[s1][s2 - 1] * a[p].pr;
          }
      }
      for (s1 = 0; s1 < n; s1++)
        for (s2 = 0; s1 + s2 < n; s2++) {
          ans[i][s1 + 1] += t * f[s1][s2] / (n - s1 - s2);
          ans[i][n - s2 + 1] -= t * f[s1][s2] / (n - s1 - s2);
        }
    }
  for (i = 1; i <= n; i++)
    for (j = 1; j <= n; j++) {
      ans[i][j] += ans[i][j - 1];
      printf("%.10lf", ans[i][j]);
      printf("%c", j != n ? ' ' : '\n');
    }
  return 0;
}