#include <stdio.h>

float gpa(int n, float* xuefen, float* jidian) {
    float sum = 0, xuefensum = 0;
    for (int i = 0; i < n; i++) {
        sum += (xuefen[i] * jidian[i]);
        xuefensum += xuefen[i];
    }
    return sum / xuefensum;
}

int main() {
    int n;
    scanf("%d", &n);
    float xuefen[n], score[n], jidian[n];
    for (int i = 0; i < n; i++) {
        scanf("%f", &xuefen[i]);
    }
    for (int i = 0; i < n; i++) {
        scanf("%f", &score[i]);
    }
    for (int i = 0; i < n; i++) {
        if (score[i] >= 90) jidian[i] = 4.0;
        else if (score[i] >= 85) jidian[i] = 3.7;
        else if (score[i] >= 82) jidian[i] = 3.3;
        else if (score[i] >= 78) jidian[i] = 3.0;
        else if (score[i] >= 75) jidian[i] = 2.7;
        else if (score[i] >= 72) jidian[i] = 2.3;
        else if (score[i] >= 68) jidian[i] = 2.0;
        else if (score[i] >= 64) jidian[i] = 1.5;
        else if (score[i] >= 60) jidian[i] = 1.0;
        else  jidian[i] = 0;
    }
    printf("%.2f", gpa(n, xuefen, jidian));
    return 0;
}