#include <stdio.h>
#include <math.h>
int main(){
int p,t,g1,g2,g3,gj;
while(scanf("%d %d %d %d %d %d",&p,&t,&g1,&g2,&g3,&gj) != EOF){
double result;
if(abs(g1 - g2) <= t){
result = (g1 + g2)/2.0;
}else{
int sub1 = t - abs(g3 - g1);
int sub2 = t - abs(g3 - g2);
if(sub1 >= 0 && sub2 >=0){
int max1 = g1 > g2 ? g1:g2;
result = max1 > g3 ? max1:g3;
}else if(sub1 >= 0){
result = (g3 + g1)/2.0;
}else if(sub2 >= 0){
result = (g2 + g3)/2.0;
}else if(sub1 < 0 && sub2 <0){
result = gj;
}
}
printf("%.1lf\n",result);
}
return 0;
}
#include <math.h>
int main(){
int p,t,g1,g2,g3,gj;
while(scanf("%d %d %d %d %d %d",&p,&t,&g1,&g2,&g3,&gj) != EOF){
double result;
if(abs(g1 - g2) <= t){
result = (g1 + g2)/2.0;
}else{
int sub1 = t - abs(g3 - g1);
int sub2 = t - abs(g3 - g2);
if(sub1 >= 0 && sub2 >=0){
int max1 = g1 > g2 ? g1:g2;
result = max1 > g3 ? max1:g3;
}else if(sub1 >= 0){
result = (g3 + g1)/2.0;
}else if(sub2 >= 0){
result = (g2 + g3)/2.0;
}else if(sub1 < 0 && sub2 <0){
result = gj;
}
}
printf("%.1lf\n",result);
}
return 0;
}