/*Code is like humor. When you have to explain it, it’s bad.*/

#pragma GCC optimize("Ofast")
#include <bits/stdc++.h>
using namespace std;
 
typedef long long ll;
typedef long double ld;
typedef vector<int> vi;
typedef vector<ll> vl;
typedef vector<vi> vvi;
typedef vector<vl> vvl;
typedef pair<int, int> pi;
typedef pair<ll, ll> pl;
typedef vector<pi> vpi;
typedef vector<pl> vpl;
 
#define PTT(x) cout << (#x) << " is " << (x) << endl
#define PT(x) cout << (x) << endl
#define re return
#define sz(a) (a).size()
#define PB push_back
#define MP make_pair
#define EB emplace_back
#define F first
#define S second
#define lb lower_bound
#define ub upper_bound
#define all(a) (a).begin(), (a).end()
#define rall(a) (a).rbegin(), (a).rend()

#define F0r(i, a, b) for(int i = a; i < b; ++i)
#define f0r(i, a) for(int i = 0; i < a; ++i)
#define F0rd(i, a, b) for(int i = a - 1; i > b; --i)
#define f0rd(i, a) for(int i = a - 1; i >= 0; --i)
#define trav(i, a) for(auto i : (a))
void IN(vi &v, int n, int x){ f0r(i, n) cin >> v[i]; }
void P(int x) { cout << x << endl; }
void PP(int a, int b) {cout << a << " " << b << endl;}
void PV(vi v) {int n = sz(v); trav(i, v) cout << i << " ";cout << endl;}
void PPV(vpi v) {int n = sz(v); trav(i, v) cout << i.F << " " << i.S << endl;}

const ll INF = (1LL << 60);
const int MOD = 1e9 + 7;
const int nax = 105;
const double p = 3.14159265359;
 
bool ck[nax][nax * nax];
int dp[nax][nax * nax];
int a[nax], b[nax];

int main(){
    ios_base::sync_with_stdio(false);
    cin.tie(nullptr);
    #ifndef ONLINE_JUDGE
       freopen("input.txt", "r", stdin);
       freopen("output.txt", "w", stdout);
     #endif
           
    // int tt;
    // cin >> tt;
    // loop:
    // while(tt--){}
    int n;
    cin >> n;
    int tot = 0;
    F0r(i, 1, n + 1){
        cin >> a[i] >> b[i];
        tot += b[i];
    }
    ck[0][0] = 1;
    F0r(i, 1, n + 1){
        F0rd(j, i, -1){
            f0r(sum, nax * nax){
                if(ck[j][sum]){
                    dp[j + 1][sum + b[i]] = max(dp[j + 1][sum + b[i]], dp[j][sum] + (a[i] - b[i]));
                    ck[j + 1][sum + b[i]] = 1;
                }
            }
        }
    }
    F0r(i, 1, n + 1){
        ld ans = 0.0;
        f0r(sum, nax * nax){
            if(!ck[i][sum])
                continue;
            ld tans = sum + min(1.0 * dp[i][sum], 1.0 * (tot - sum) / 2.0);
            ans = max(ans, tans);
        }
        cout << fixed << setprecision(10) << ans << " ";
    }

    return 0;
}