#include<cstdio>
#include<algorithm>
#define int long long
const int Q=100005;
const int INF=(1ll<<57);
using namespace std;
typedef long long ll;
#define rg register int
char buf[1<<21],*p1=buf,*p2=buf;
#define gc() (p1==p2&&(p2=(p1=buf)+fread(buf,1,1<<21,stdin),p1==p2)?EOF:*p1++)
inline bool ig(char c){return c>=48&&c<=57;}
inline void read(int &oi){char c;int f=1,res=0;while(c=gc(),(!ig(c))&&c^'-');c^'-'?res=(c^48):f=-1;while(c=gc(),ig(c))res=res*10+(c^48);oi=f*res;}
inline void print(int oi){if(oi<0)putchar('-'),oi=~oi+1;if(oi>9)print(oi/10);putchar(oi%10+48);}
inline void write(int oi,char c){print(oi);putchar(c);}
inline long double minn(long double x,long double y){return x<y?x:y;}
int n,a[Q],s[Q];
//int ans1=INF,ans2=INF;
long double mn=INF;
signed main(){
	read(n);for(rg i=1;i<=n;++i)read(a[i]);
	sort(a+1,a+1+n);
	for(rg i=1;i<=n;++i)s[i]=s[i-1]+a[i];
	for(rg i=1;i<=n;++i){
		long double x=a[i]/2.0;
		long double now=x*i+s[n]-s[i]-(n-i)*x;
//		printf("%.2Lf  %.6Lf\n",x,now);
		mn=minn(mn,now);
//		double x=a[i]/2.0;
//		int tim1=s[n]-s[i]+2*x*i-n*x;
//		int tim2=((1.0*s[n]-s[i]+2.0*x*i-1.0*n*x)-tim1)*10;
//		if(tim1<ans1||(tim1==ans1&&tim2<ans2))ans1=tim1,ans2=tim2;
	}
//	printf("%lld %lld\n",ans1,ans2);
//	printf("%.10Lf\n",mn);
	printf("%.20Lf\n",1.0*mn/n);
	return 0;
}
#pragma GCC optimize("O3")
#include<bits/stdc++.h> 
using namespace std;
using ll=long long;
using P=pair<ll,ll>;
template<class T> using V=vector<T>; 
#define fi first
#define se second
#define all(v) (v).begin(),(v).end()
const ll inf=(1e18);
//const ll mod=998244353;
const ll mod=1000000007;
const vector<int> dy={-1,0,1,0},dx={0,-1,0,1};
ll GCD(ll a,ll b) {return b ? GCD(b,a%b):a;}
ll LCM(ll c,ll d){return c/GCD(c,d)*d;}
struct __INIT{__INIT(){cin.tie(0);ios::sync_with_stdio(false);cout<<fixed<<setprecision(20);}} __init;
template<class T> bool chmax(T &a, const T &b) { if (a<b) { a=b; return 1; } return 0; }
template<class T> bool chmin(T &a, const T &b) { if (a>b) { a=b; return 1; } return 0; }
template<class T>void debag(const vector<T> &a){cerr<<"debag :";for(auto v:a)cerr<<v<<" ";cerr<<"\n";}
template<class T>void print(const vector<T> &a){for(auto v:a)cout<<v<<" ";cout<<"\n";}
template<typename T>
struct BIT{
    //1-index
    //0-indexで取ると無限ループする
    private:
    V<T> arr;
    int n;

    public:
    BIT(int siz){
        n=siz;
        arr.assign(n+1,0);
    }
    //一点更新 aにvを加える
    void add(T a,T v){
        //x+=(x&-x) 初項a,それ以降a<=2^Nが列挙
        for(T x=a;x<=n;x+=(x&-x)){
            arr[x]+=v;
        }
    }
    T sum(T a){
        // 1からaまでの区間和
        T ret=0;
        for(T x=a;x>0;x-=(x&-x))ret+=arr[x];
        return ret;
    }
    T get(T x){//x番目に大きい数　// 区間和がw以上となる最小のindを返す
        if(x<=0) return 0;
        T N=1;
        while(N*2<=n)N*=2;
        T v=0;
        for(T i=N;i>0;i/=2){
            if(v+i<=n&&arr[v+i]<x){
                x-=arr[v+i];
                v+=i;
            }
        }
        return v+1;
    }
    T query(int l,int r){
        return sum(r)-sum(l);
    }
};
struct Q{
    int t,x;
    ll y;
    Q(){}
};
map<ll,ll> mp;
int main(){
    ll n,m,q;
    cin>>n>>m>>q;
    mp[0];
    V<Q> d(q);
    V<ll> a(n,0),b(m,0);
    for(int i=0;i<q;i++){
         cin>>d[i].t>>d[i].x>>d[i].y;
         d[i].x--;
         mp[d[i].y];
    }
    int id=1;
    for(auto &p:mp){
          p.se=id++;
    }
    BIT<ll> da(id+5),db(id+5),suma(id+5),sumb(id+5);
    da.add(mp[0],n);
    db.add(mp[0],m);
    ll ans=0;
    for(int i=0;i<q;i++){
          ll t=d[i].t,x=d[i].x,y=d[i].y;
          if(t==1){
                ans-=db.query(0,mp[a[x]])*a[x]+sumb.query(mp[a[x]],id+5);
                da.add(mp[a[x]],-1);
                suma.add(mp[a[x]],-a[x]);
                a[x]=y;
                da.add(mp[a[x]],1);
                suma.add(mp[a[x]],a[x]);
                ans+=db.query(0,mp[a[x]])*a[x]+sumb.query(mp[a[x]],id+5);
          }else{
                ans-=da.query(0,mp[b[x]])*b[x]+suma.query(mp[b[x]],id+5);
                db.add(mp[b[x]],-1);
                sumb.add(mp[b[x]],-b[x]);
                b[x]=y;
                db.add(mp[b[x]],1);
                sumb.add(mp[b[x]],b[x]);
                ans+=da.query(0,mp[b[x]])*b[x]+suma.query(mp[b[x]],id+5);
          }
         cout<<ans<<"\n";
    }
}