#include <iostream>
using namespace std;
double max(int a, int b, int c) {
    int temp = 0;
    if (a > b) {
        temp = a;
    } else temp = b;
    if (temp > c) {
        temp = c;
    }
    double k = temp * 1.0;
    return k;
}

int main() {
    int P, T, G1, G2, G3, GJ;
    cin >> P >> T >> G1 >> G2 >> G3 >> GJ;
    double result = 0;
    int k = abs(G1 - G2);
    if (k <= T) {
        result = (G1 + G2) / 2.0;
    } else if (G3 <= T && G2 <= T && G1 <= T) {
        result = max(G1, G2, G3);
    } else if (G3 <= T && (G2 <= T || G1 <= T)) {
        if (abs(G3 - G1) < abs(G3 - G2)) {
            result = (G3 + G1) / 2.0;
        } else {
            result = (G3 + G2) / 2.0;
        }
    } else {
        result = GJ * 1.0;
    }
    printf("%0.1f", result);
    return 0;
}