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 n, L[82], R[82], num[82 * 2], tnum;
double A[82], B[82], C[82];
double ans[82], f[2][82][82];
int main() {
  scanf("%d", &n);
  tnum = 0;
  if (n == 1) {
    puts("1");
    return 0;
  }
  for (int i = 1; i <= n; i++) {
    scanf("%d%d", &L[i], &R[i]);
    num[++tnum] = L[i];
    num[++tnum] = R[i];
  }
  sort(num + 1, num + tnum + 1);
  tnum = (int)(unique(num + 1, num + tnum + 1) - num - 1);
  for (int id = 1; id <= n; id++) {
    memset(ans, 0, sizeof(ans));
    for (int range = 1; range < tnum; range++) {
      int x = num[range], y = num[range + 1];
      if (L[id] >= y || R[id] <= x) continue;
      double W = (double)(y - x) / (double)(R[id] - L[id]);
      int top = 0, rnk = 0;
      memset(f, 0, sizeof(f));
      for (int i = 1; i <= n; i++)
        if (i != id) {
          ++top;
          A[top] =
              (L[i] >= x) ? 0 : ((double)(x - L[i]) / (double)(R[i] - L[i]));
          B[top] = (L[i] >= y || R[i] <= x)
                       ? 0
                       : ((double)(y - x) / (double)(R[i] - L[i]));
          C[top] =
              (R[i] <= y) ? 0 : ((double)(R[i] - y) / (double)(R[i] - L[i]));
          if (A[top] > 1) A[top] = 1;
          if (B[top] > 1) B[top] = 1;
          if (C[top] > 1) C[top] = 1;
          if (A[top] >= 1) {
            rnk++;
            top--;
          }
          if (C[top] >= 1) {
            top--;
          }
        }
      int s = 0;
      if (top == 0) {
        ans[rnk + 1] += W;
        continue;
      }
      f[s][0][0] = 1;
      for (int i = 1; i <= top; i++) {
        s ^= 1;
        for (int j = 0; j <= i; j++)
          for (int k = 0; k <= i - j; k++)
            f[s][j][k] = (j > 0 ? f[s ^ 1][j - 1][k] : 0) * A[i] +
                         (k > 0 ? f[s ^ 1][j][k - 1] : 0) * B[i] +
                         f[s ^ 1][j][k] * C[i];
      }
      for (int i = 0; i <= top; i++)
        for (int j = 0; j <= top - i; j++)
          for (int k = 0; k <= j; k++)
            ans[rnk + 1 + i + k] += f[s][i][j] / (j + 1) * W;
    }
    for (int i = 1; i <= n; i++)
      printf("%.10lf%c", ans[i], i == n ? '\n' : ' ');
  }
  return 0;
}