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[1000], R[1000];
int _x[1000];
int nx;
double f[100][100];
double g[100][100];
double ans[100];
int main() {
  int N;
  scanf("%d", &N);
  for (int i = (1), _b = (N); i <= _b; i++) {
    scanf("%d%d", &L[i], &R[i]);
  }
  nx = 0;
  for (int i = (1), _b = (N); i <= _b; i++) _x[++nx] = L[i], _x[++nx] = R[i];
  sort(_x + 1, _x + nx + 1);
  nx = unique(_x + 1, _x + nx + 1) - _x - 1;
  for (int i = (1), _b = (N); i <= _b; i++) {
    for (int j = (1), _b = (N); j <= _b; j++) ans[j] = 0;
    for (int j = (0), _b = (N); j <= _b; j++)
      for (int k = (0), _b = (N - j); k <= _b; k++) g[j][k] = 0;
    for (int j = (1), _b = (nx - 1); j <= _b; j++) {
      if ((_x[j] >= L[i]) && (_x[j + 1] <= R[i])) {
        for (int k = (0), _b = (N); k <= _b; k++)
          for (int p = (0), _b = (N - k); p <= _b; p++) f[k][p] = 0;
        f[0][0] = (double)(_x[j + 1] - _x[j]) / (R[i] - L[i]);
        for (int k = (1), _b = (N); k <= _b; k++)
          if (i != k) {
            double p1 = 0;
            if ((L[k] <= _x[j]) && (R[k] <= _x[j]))
              p1 = 1;
            else if ((L[k] <= _x[j]) && (R[k] >= _x[j + 1]))
              p1 = double(_x[j] - L[k]) / (R[k] - L[k]);
            double p2 = 0;
            if ((L[k] <= _x[j]) && (R[k] >= _x[j + 1]))
              p2 = double(_x[j + 1] - _x[j]) / (R[k] - L[k]);
            for (int p = (k), _b = (0); p >= _b; p--)
              for (int q = (k - p), _b = (0); q >= _b; q--) {
                f[p][q] *= (1.0 - p1 - p2);
                if (p) f[p][q] += f[p - 1][q] * p1;
                if (q) f[p][q] += f[p][q - 1] * p2;
              }
          }
        for (int p = (0), _b = (N); p <= _b; p++)
          for (int q = (0), _b = (N - p); q <= _b; q++) g[p][q] += f[p][q];
      }
    }
    for (int p = (0), _b = (N); p <= _b; p++) {
      double sum = 0.0;
      for (int q = (N - p), _b = (0); q >= _b; q--)
        sum += g[p][q] / (q + 1), ans[p + q + 1] += sum;
    }
    for (int j = (1), _b = (N); j <= _b; j++) {
      if (j > 1) printf(" ");
      printf("%.8lf", (double)ans[j]);
    }
    printf("\n");
  }
  return 0;
}