#include <iostream>
#include <stdio.h>
#include <fstream>
#include <string.h>
#include <iomanip>
using namespace std;
int main(){
//freopen("1.txt","r",stdin);
int n;
double sumPower;
int longestPower;
int battery[1001];
while(scanf("%d",&n)!=EOF){
sumPower = 0;
longestPower = 0;
memset(battery,0,sizeof(battery));
for(int i = 1; i <= n; ++i){
scanf("%d",&battery[i]);
if(longestPower < battery[i])
longestPower = battery[i];
sumPower += battery[i];
}
if(longestPower >= sumPower / 2){
printf("%.1lf\n",(double)(sumPower - longestPower));
continue;
}
else
printf("%.1lf\n",sumPower/2.0);
}
return 0;
}
poj3468电池的寿命
最新推荐文章于 2024-08-18 09:10:06 发布