标签:des style http color java os strong io
3 1 100 10 100 2 100 24 20 30 3 100 24 20 20 30
0 0.00 100 0.20 300 0.23
开始一直以为V就是100.。。发现我TM真逗比。。。
#include<cstdio> #include<cstring> #include<iostream> #include<algorithm> #include<vector> #include<queue> using namespace std; const int maxn = 1000 + 50; int cas; int n, v; int w; int a[maxn]; int ans; double b; int main() { scanf("%d", &cas); while(cas--) { scanf("%d%d%d", &n, &v, &w); memset(a, 0, sizeof(a)); ans = 0; b = 0.0; int flag = 0; for(int i=0; i<n; i++)scanf("%d", &a[i]); sort(a, a+n); double sum=0.0; int i; for(i=0; i<n; i++) { if((sum*i+a[i])/(i+1)<=w) sum=(sum*i+a[i])/(i+1); else break; } printf("%d %.2f\n",i*v,sum/100); } return 0; }
标签:des style http color java os strong io
原文地址:http://blog.csdn.net/u013487051/article/details/38331941