Online Judge | Problem Set | Authors | Online Contests | User | ||||||
---|---|---|---|---|---|---|---|---|---|---|
Web Board Home Page F.A.Qs Statistical Charts | Current Contest Past Contests Scheduled Contests Award Contest |
5555555555555555555555555555555555555555555555555555555555555555555555555555555555#include<iostream> #include<iomanip> #include<stdlib.h> #define N 500002 using namespace std; int fun(const void *a,const void *b) {return *(int*)a-*(int *)b;} int main() {double t; int i,j,m,n,p,sum; int a[N]; while(1) {sum=0; cin>>m>>n>>p; if(m+n+p==0) break; for(i=1;i<=p;i++) {cin>>a[i];sum+=a[i];} qsort(a+1,p,4,fun); for(i=1;i<=n;i++) sum-=a[i]; for(int t=1,j=p;t<=m;t++,j--) sum-=a[j]; p=p-m-n; t=double(sum)/p; cout<<setprecision(6); cout<<fixed<<t<<endl; } } Followed by: Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator