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(85);
int n;
vector<int> v;
double a[N], b[N], c[N];
int l[N], r[N];
double ans[N];
double f[N][N], p[N][N];
int main() {
  cin >> n;
  for (int i = int(0); i < int(n); ++i) {
    cin >> l[i] >> r[i];
    v.push_back(l[i]);
    v.push_back(r[i]);
  }
  sort(v.begin(), v.end());
  for (int i = int(0); i < int(n); ++i) {
    memset(p, 0, sizeof(p));
    for (int j = int(1); j < int(v.size()); ++j)
      if (v[j - 1] != v[j] && l[i] <= v[j - 1] && v[j] <= r[i]) {
        memset(a, 0, sizeof(a));
        memset(b, 0, sizeof(b));
        memset(c, 0, sizeof(c));
        int t = 0, cnt = 0;
        for (int k = int(0); k < int(n); ++k)
          if (r[k] <= v[j - 1])
            ++cnt;
          else if (l[k] <= v[j - 1] && v[j] <= r[k] && k != i) {
            a[t] = (v[j - 1] - l[k]) / (double)(r[k] - l[k]);
            b[t] = (r[k] - v[j]) / (double)(r[k] - l[k]);
            c[t++] = 1 - a[t] - b[t];
          }
        memset(f, 0, sizeof(f));
        f[0][0] = 1;
        for (int x = int(0); x < int(t); ++x)
          for (int y = x; y != -1; --y)
            for (int z = x - y; z != -1; --z)
              if (f[y][z] > 0) {
                f[y + 1][z] += f[y][z] * a[x];
                f[y][z + 1] += f[y][z] * c[x];
                f[y][z] *= b[x];
              }
        for (int x = int(0); x < int(t + 1); ++x)
          for (int y = 0; x + y <= t; ++y)
            p[x + cnt][y] += f[x][y] * (v[j] - v[j - 1]);
      }
    memset(ans, 0, sizeof(ans));
    for (int x = int(0); x < int(n); ++x)
      for (int y = 0; x + y < n; ++y)
        for (int z = int(0); z < int(y + 1); ++z)
          ans[x + z] += p[x][y] / (y + 1) / (r[i] - l[i]);
    for (int j = int(0); j < int(n); ++j) cout << ans[j] << " ";
    cout << endl;
  }
  return 0;
}