#include<cmath>
#include<iomanip>
#include<iostream>
using namespace std;
int MAX(int a,int b,int c)
{
if(a>b) return a>c?a:c;
else return b>c?b:c;
}
int closer(int a,int b,int c)
{
return fabs(c-a)<fabs(c-b)?a:b;
}
int main()
{
int P, T, G1, G2, G3, GJ;
while(cin>>P>>T>>G1>>G2>>G3>>GJ)
{
if(fabs(G1-G2)<=T) cout<<fixed<<setprecision(1)<<(G1+G2)/2.0<<endl;
else if(fabs(G3-G1)<=T&&fabs(G3-G2)<=T) cout<<fixed<<setprecision(1)<<MAX(G1, G2, G3)/1.0<<endl;
else if(fabs(G3-G1)<=T||fabs(G3-G2)<=T) cout<<fixed<<setprecision(1)<<(closer(G1, G2, G3)+G3)/2.0<<endl;
else cout<<fixed<<setprecision(1)<<GJ/1.0<<endl;
}
return 0;
}
1002 Grading 九度Oline Judge
最新推荐文章于 2016-05-16 14:48:39 发布