#include <iostream> using namespace std; const int num=11; int credits[num]; int scores[num]; int main() { int n; while(cin>>n && n){ int cre_sum=0; for (int i=0;i<n;i++){ cin>>credits[i]; cre_sum+=credits[i]; } for (int i=0;i<n;i++){ cin>>scores[i]; } float gpa=0; for (int i=0;i<n;i++){ if (scores[i]>=90 && scores[i]<=100) gpa+=4.0*credits[i]; else if(scores[i]>=85 && scores[i]<=89) gpa+=3.7*credits[i]; else if(scores[i]>=82 && scores[i]<=84) gpa+=3.3*credits[i]; else if(scores[i]>=78 && scores[i]<=81) gpa+=3.0*credits[i]; else if(scores[i]>=75 && scores[i]<=77) gpa+=2.7*credits[i]; else if(scores[i]>=72 && scores[i]<=74) gpa+=2.3*credits[i]; else if(scores[i]>=68 && scores[i]<=71) gpa+=2.0*credits[i]; else if(scores[i]>=64 && scores[i]<=67) gpa+=1.5*credits[i]; else if(scores[i]>=60 && scores[i]<=63) gpa+=1.0*credits[i]; else gpa+=0; } float GPA=gpa/cre_sum; printf("%.2f",GPA); } }