#include<bits/stdc++.h>

using namespace std;

#define ios               ios_base::sync_with_stdio(false); cin.tie(NULL);
#define ifs               freopen("input.txt","r",stdin);
#define ofs               freopen("output.txt","w",stdout);
#define iof               ifs ofs
#define ll                long long
#define ld                long double
#define da(x,i)           cout << #x << "[" << i << "] = " << x[i] << "\n";
#define da2(x,i,y,j)      cout << #x << "[" << i << "] = " << x[i] << " ! " << #y << "[" << j << "] = " << y[j] << "\n";
#define d2a(x,i,j)        cout << #x << "[" << i << "][" << j << "] = " << x[i][j] << "\n";
#define db(x)             cout << #x << " = " << (x) << "\n";
#define db2(x,y)          cout << #x << " = " << (x) << " ! " << #y << " = " << (y) << "\n";
#define db3(x,y,z)        cout << #x << " = " << (x) << " ! " << #y << " = " << (y) << " ! " << #z << " = " << (z) << "\n";
#define db4(w,x,y,z)      cout << #w << " = " << (w) << " ! " << #x << " = " << (x) << " ! " << #y << " = " << (y) << " ! " << #z << " = " << (z) << "\n";
#define inf               LLONG_MAX
#define fr                first
#define sc                second
#define all(a)            a.begin(),a.end()


ll n,i,a,b,s,j,k;
ll f[109][10009];

int main()
{
	memset(f,-9,sizeof(f)); f[0][0]=0;
    cin>>n;
    for(i=1; i<=n; i++){
        cin>>a>>b; s+=b;
        for(j=i; j; j--){
            for(k=10001; k>=a; k--){
                f[j][k]=max(f[j][k],f[j-1][k-a]+b);
            }
        }
    }
    for(j=1; j<=n; j++){
        a=0;
        for(k=0; k<=10001; k++){
            a=max(a,min(k*2,f[j][k]+s));
        }
        cout<< a/2.0 <<" ";
    }
}





















































