#include<bits/stdc++.h>
using namespace std;
#pragma comment(linker, "/STACK:102400000,102400000")
#define ls i<<1
#define rs ls | 1
#define mid ((ll+rr)>>1)
#define pii pair<int,double>
#define MP make_pair
typedef long long LL;
typedef unsigned long long ULL;
const long long INF = 1e18+1LL;
const double pi = acos(-1.0);
const int N = 2e5+10, M = 1e3+20,inf = 2e9;
struct ss{
int t,x,y;
/*bool operator < (const ss &r) const {
return x == r.x ? y<r.y : x < r.x;
}*/
}a[N],t[N];
bool cmp1(ss s1,ss s2) {
return s1.t < s2.t;
}
bool cmp2(ss s1,ss s2) {
if(s1.x == s2.x) {
if(s1.y == s2.y) return s1.t < s2.t;
else return s1.y > s2.y;
}
return s1.x > s2.x;
}
vector<double > ans;
int dp[N][2],scc = 0,tag[N];
double f[N][2];
int n;
pair<int,double > C[N],C1[N];
void update(int x,pii now) {
for(int i = x; i ; i -= i&-i) {
if(now.first == 0)C[i] = MP(0,0);
else {
if(C[i].first < now.first) {
C[i] = now;
}
else if(C[i].first == now.first) {
C[i].second += now.second;
}
}
}
}
pii ask(int x) {
pii ret = MP(0,0);
for(int i = x; i <= n; i += i&-i) {
if(ret.first < C[i].first) {
ret = C[i];
}
else if(ret.first == C[i].first){
ret.second += C[i].second;
}
}
return ret;
}
void cdq(int ll,int rr,int p) {
if(ll == rr) {
if( f[ll][p] == 0) {
dp[ll][p] = 1;
f[ll][p] = 1;
}
return ;
}
sort(a+ll,a+rr+1,cmp1);
cdq(ll,mid,p);
scc++;
sort(a+ll,a+rr+1,cmp2);
for(int i = ll; i <= rr; ++i) {
if(a[i].t <= mid) {
update(a[i].y,MP(dp[a[i].t][p],f[a[i].t][p]));
}
else {
pii now = ask(a[i].y);
now.first += 1;
if(now.second == 0) continue;
if(now.first > dp[a[i].t][p]) {
dp[a[i].t][p] = now.first;
f[a[i].t][p] = now.second;
}
else if(now.first == dp[a[i].t][p]){
f[a[i].t][p] += now.second;
}
}
}
for(int i = ll; i <= rr; ++i) {
if(a[i].t <= mid) update(a[i].y,MP(0,0));
}
sort(a+ll,a+rr+1,cmp1);
cdq(mid+1,rr,p);
}
int cnt[N],san[N],cnts;
int main() {
scanf("%d",&n);
int mxxx = 0;
for(int i = 1; i <= n; ++i) {
scanf("%d%d",&a[i].x,&a[i].y);
san[i] = a[i].y;
mxxx = max(mxxx,a[i].x);
a[i].t = i;
}
sort(san+1,san+n+1);
int SA = unique(san+1,san+n+1) - san - 1;
for(int i = 1; i <= n; ++i)
a[i].y = lower_bound(san+1,san+SA+1, a[i].y) - san;
cdq(1,n,0);
sort(a+1,a+n+1,cmp1);
for(int i =1; i <= n; ++i) {
a[i].y = SA - a[i].y + 1;
a[i].x = mxxx - a[i].x + 1;
}
for(int i = 1; i <= n/2; ++i) {
swap(a[i].x,a[n - i + 1].x);
swap(a[i].y,a[n - i + 1].y);
}
cdq(1,n,1);
int ans = 0;
for(int i = 1; i <= n; ++i) {
ans = max(ans,(int)dp[i][0]);
}
printf("%d\n",ans);
double sum = 0.0;
for(int i = 1; i <= n; ++i) {
if(dp[i][0] == ans) sum += (double)f[i][0] * f[n-i+1][1];
}
for(int i = 1; i <= n; ++i) {
if(dp[i][0] + dp[n-i+1][1] - 1 == ans) {
printf("%.5lf",(double)f[i][0] * f[n-i+1][1] / sum);
}
else printf("%.5lf",0.0);
if(i == n) printf("\n");
else printf(" ");
}
return 0;
}