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 N = 80;
int n, ord[N * 2 + 9], co;
struct seg {
  int l, r;
} a[N + 9];
void into() {
  scanf("%d", &n);
  for (int i = 1; i <= n; ++i) {
    scanf("%d%d", &a[i].l, &a[i].r);
    ord[++co] = a[i].l;
    ord[++co] = a[i].r;
  }
}
double dp[N + 9][N + 9][N + 9];
double ans[N + 9][N + 9];
void Divide_dp(const int l, const int r, const int d, const int x, const int y,
               const int c) {
  if (l == r) {
    if (y <= a[l].l || x >= a[l].r) return;
    double v = 1.0 * (y - x) / (a[l].r - a[l].l);
    for (int i = 0; i < n; ++i)
      for (int j = 0; i + j < n; ++j) {
        int c = n - i - j;
        double t = v / c * dp[d][i][j];
        ans[l][i + 1] += t;
        ans[l][i + c + 1] -= t;
      }
    return;
  }
  int mid = l + r >> 1, lc = c, rc = c;
  for (int i = 0; i <= n; ++i)
    for (int j = 0; j <= n; ++j) dp[d + 1][i][j] = dp[d][i][j];
  for (int id = mid + 1; id <= r; ++id) {
    int tl = a[id].l, tr = a[id].r;
    double u = 1.0 * (y - x) / (tr - tl),
           v = 1.0 * (min(x, tr) - tl) / (tr - tl),
           w = 1.0 * (tr - max(y, tl)) / (tr - tl);
    ++lc;
    for (int i = lc; i >= 0; --i)
      for (int j = lc; j >= 0; --j) {
        dp[d + 1][i][j] = x >= tl && y <= tr ? dp[d + 1][i][j] * u : 0;
        if (i && tl < x) dp[d + 1][i][j] += dp[d + 1][i - 1][j] * v;
        if (j && tr > y) dp[d + 1][i][j] += dp[d + 1][i][j - 1] * w;
      }
  }
  Divide_dp(l, mid, d + 1, x, y, lc);
  for (int i = 0; i <= n; ++i)
    for (int j = 0; j <= n; ++j) dp[d + 1][i][j] = dp[d][i][j];
  for (int id = l; id <= mid; ++id) {
    int tl = a[id].l, tr = a[id].r;
    double u = 1.0 * (y - x) / (tr - tl),
           v = 1.0 * (min(x, tr) - tl) / (tr - tl),
           w = 1.0 * (tr - max(y, tl)) / (tr - tl);
    ++rc;
    for (int i = rc; i >= 0; --i)
      for (int j = rc; j >= 0; --j) {
        dp[d + 1][i][j] = x >= tl && y <= tr ? dp[d + 1][i][j] * u : 0;
        if (i && tl < x) dp[d + 1][i][j] += dp[d + 1][i - 1][j] * v;
        if (j && tr > y) dp[d + 1][i][j] += dp[d + 1][i][j - 1] * w;
      }
  }
  Divide_dp(mid + 1, r, d + 1, x, y, rc);
}
void Get_ans() {
  sort(ord + 1, ord + co + 1);
  co = unique(ord + 1, ord + co + 1) - ord - 1;
  for (int i = 1; i < co; ++i) {
    dp[0][0][0] = 1;
    Divide_dp(1, n, 0, ord[i], ord[i + 1], 0);
  }
}
void work() { Get_ans(); }
void outo() {
  for (int i = 1; i <= n; ++i) {
    for (int j = 1; j <= n; ++j) printf("%.7lf ", (ans[i][j] += ans[i][j - 1]));
    putchar('\n');
  }
}
int main() {
  into();
  work();
  outo();
  return 0;
}