float GPA(int a)
{
	if(a>=90) return 4;
		else if (a>=85) return 3.7;
		else if (a>=82) return 3.3;
		else if (a>=78) return 3;
		else if (a>=75) return 2.7;
		else if (a>=72) return 2.3;
		else if (a>=68) return 2;
		else if (a>=64) return 1.5;
		else if (a>=60) return 1;
		else return 0;
}
void main()
{
	int n,i,s,a[100]={0};
	float SumGPA=0,Points=0,AveGPA=0;
	scanf("%d",&n);
	SumGPA=0;
	for(i=1;i<=n;i++)
	{
		scanf("%d",&s);
		Points+=s;
        a[i]=s;
	}
	for(i=1;i<=n;i++)
	{
		scanf("%d",&s);
		SumGPA+=GPA(s)*a[i];
	}
	AveGPA=SumGPA/Points;
	printf("%.2f\n",AveGPA);
}


int main(){
    int n,i,x=0;
    scanf("%d",&n);
    int xuefen[n];
    int defen[n];
    double jidian[n];
    double GPA,y=0;
    for(i=0;i<n;i++){
        scanf("%d",&(xuefen[i]));
    }
    for(i=0;i<n;i++){
        scanf("%d",&(defen[i]));
    }
    for(i=0;i<n;i++){
        if(defen[i]>=90){
            jidian[i]=4.0;
        }else if((defen[i]>=85)&&(defen[i]<=89)){
            jidian[i]=3.7;
        }else if((defen[i]>=82)&&(defen[i]<=84)){
            jidian[i]=3.3;
        }else if((defen[i]>=78)&&(defen[i]<=81)){
            jidian[i]=3.0;
        }else if((defen[i]>=75)&&(defen[i]<=77)){
            jidian[i]=2.7;
        }else if((defen[i]>=72)&&(defen[i]<=74)){
            jidian[i]=2.3;
        }else if((defen[i]>=68)&&(defen[i]<=71)){
            jidian[i]=2.0;
        }else if((defen[i]>=64)&&(defen[i]<=67)){
            jidian[i]=1.5;
        }else if((defen[i]>=60)&&(defen[i]<=63)){
            jidian[i]=1.0;
        }else if(defen[i]<60){
            jidian[i]=0.0;
        }
    }
    for(i=0;i<n;i++){
        y+=xuefen[i]*jidian[i];
    }
    for(i=0;i<n;i++){
        x+=xuefen[i];
    }
    GPA=y/x;
    printf("%.2lf",GPA);
    return 0;
}


double fun(int x);
int main()
{
  int n,i;
  int course[10];
  int grade[10];
  int mark[10];
  double jdsum=0;
  int csum=0;
  double jd[10];
  double  GPA;
    scanf("%d",&n);
	for(i=0;i<n;i++)
	 {scanf("%d",&course[i]);
	csum+=course[i];
	 }
	for(i=0;i<n;i++)
	{scanf("%d",&mark[i]);
	 jd[i] = fun(mark[i]);
	 jdsum+=course[i]*jd[i];
	}
	 GPA=1.0*jdsum/csum;
	 printf("%.2lf",GPA);

	return 0;
}
double fun(int x)
{

	if(x>=90)return 4.0;
	if(x>=85)return 3.7;
	if(x>=82)return 3.3;
	if(x>=78)return 3.0;
	if(x>=75)return 2.7;
	if(x>=72)return 2.3;
	if(x>=68)return 2.0;
	if(x>=64)return 1.5;
	if(x>=60)return 1.0;
	return 0;
}


void main()
{
	int n,i;
	float GPA,fen[10],jh=0,xd[10],xh=0,xf[10],score[10];
	scanf("%d",&n);
	for(i=0;i<=n-1;i++)
	{
		scanf("%f",&xf[i]);
		xh=xh+xf[i];
	}
	for(i=0;i<=n-1;i++)
	{
	scanf("%f",&score[i]);
	if(score[i]>=90)
    	fen[i]=4.0;
	else if(score[i]>=85)
		fen[i]=3.7;
	else if(score[i]>=82)
		fen[i]=3.3;
	else if(score[i]>=78)
	    fen[i]=3.0;
	else if(score[i]>=75)
    	fen[i]=2.7;
	else if(score[i]>=72)
		fen[i]=2.3;
	else if(score[i]>=68)
		fen[i]=2.0;
	else if(score[i]>=64)
		fen[i]=1.5;
	else if(score[i]>=60)
    	fen[i]=1.0;
    else
        fen[i]=0;
	xd[i]=fen[i]*xf[i];
	jh=jh+xd[i];
	}
	GPA=jh/xh;
	printf("%.2f",GPA);
}


void main()
{
	int xuefen[10];
	int chengji[10];
	float jidian[10];
	int n,i,he=0;
	float sum=0,GPA;
	scanf("%d",&n);
	for(i=0;i<n;i++)
		scanf("%d",&xuefen[i]);
	for(i=0;i<n;i++){
		scanf("%d",&chengji[i]);
		if(chengji[i]>=90&&chengji[i]<=100)
			jidian[i]=4.0;
		if(chengji[i]>=85&&chengji[i]<=89)
			jidian[i]=3.7;
		if(chengji[i]>=82&&chengji[i]<=84)
			jidian[i]=3.3;
		if(chengji[i]>=78&&chengji[i]<=81)
			jidian[i]=3.0;
		if(chengji[i]>=75&&chengji[i]<=77)
			jidian[i]=2.7;
		if(chengji[i]>=72&&chengji[i]<=74)
			jidian[i]=2.3;
		if(chengji[i]>=68&&chengji[i]<=71)
			jidian[i]=2.0;
		if(chengji[i]>=64&&chengji[i]<=67)
			jidian[i]=1.5;
		if(chengji[i]>=60&&chengji[i]<=63)
			jidian[i]=1.0;
		if(chengji[i]<60)
			jidian[i]=0;
	}
	for(i=0;i<n;i++){
		sum+=(float)xuefen[i]*jidian[i];
		he+=xuefen[i];}
	GPA=(float)sum/he;
	printf("%.2f",GPA);
}


float score[12],point[12];
float GPA[12];

int main(){
	int n,i;
	float tmp;
	cin>>n;
	for(i=0;i<n;i++)
		scanf("%f",&score[i]);
	for(i=0;i<n;i++)
	{
		scanf("%f",&tmp);
		//cout<<tmp<<' ';
		if(tmp<=100&&tmp>=90)
			GPA[i]=4;
		else
			if(tmp<=89&&tmp>=85)
				GPA[i]=3.7;
			else
				if(tmp<=84&&tmp>=82)
					GPA[i]=3.3;
				else
					if(tmp<=81&&tmp>=78)
						GPA[i]=3.0;
					else if(tmp<=77&&tmp>=75)
						GPA[i]=2.7;
					else if(tmp<=74&&tmp>=72)
						GPA[i]=2.3;
					else if(tmp<=71&&tmp>=68)
						GPA[i]=2.0;
					else if(tmp<=67&&tmp>=65)
						GPA[i]=1.5;
					else if(tmp<=64&&tmp>=60)
						GPA[i]=1.0;
					else
						GPA[i]=0;
	//cout<<GPA[i]<<endl;

	}
	float Res=0;
	float sum=0;
	for(i=0;i<n;i++)
	{
		sum+=score[i];
		Res+=(score[i]*GPA[i]);
	}
	Res/=sum;
	printf("%.2f\n",Res);
	return 0;
}


int main()
{
	int n = 0;
	int score[11] = {0};
	int ok[11] ={0};
	double grade[11] = {0};
	int i = 1;
	int m = 1;
	int t = 1;
	double sum1 = 0.0;
	double ave = 0.0;

	cin >> n;

	cout << endl;

	while(i <= n)
	{
		cin >> score[i++];
	}
	cout << endl;

	while(m <= n)
	{
		cin >> ok[m++];
	}

	for(t=1;t<=n;t++)
	{
		if( ok[t]>=90)
		{
			grade[t]=4.0;continue;
		}
		if(ok[t]>=85)
		{
			grade[t]=3.7;continue;
		}
		if(ok[t]>=82)
		{
			grade[t]=3.3 ;continue;
		}
		if(78<=ok[t])
		{
			grade[t]=3.0;continue;
		}
		if(75<=ok[t])
		{
			grade[t]=2.7;continue;
		}
		if(72<=ok[t])
		{
			grade[t]=2.3;continue;
		}
		if(68<=ok[t])
		{
			grade[t]=2.0;continue;
		}
		if(64<=ok[t])
		{
			grade[t]=1.5;continue;
		}
		if(60<=ok[t])
		{
			grade[t]=1.0;continue;
		}
		if(60>ok[t])
		{
			grade[t]=0.0;continue;
		}
	}

	for(i=1;i<=n;i++)
	{
		sum1 += score[i]*grade[i];
	}

	ave = sum1 / ( score[1] + score[2] + score[3] + score[4] + score[5] + score[6] + score[7] + score[8] + score[9] + score[10]);

	cout << fixed << setprecision(2) << ave << endl;

	return 0;

}


float score ( float x )
{
    if(x<60)
      return 0;
    else if(x<=63)
      return 1.0;
    else if(x<=67)
      return 1.5;
    else if(x<=71)
      return 2.0;
    else if(x<=74)
      return 2.3;
    else if(x<=77)
      return 2.7;
    else if(x<=81)
      return 3;
    else if(x<=84)
      return 3.3;
    else if(x<=89)
      return 3.7;
    else
      return 4.0;
}

int main()
{
    int n,i;
    float sum=0,GAP=0,a[10]={0},b[10]={0},c[10]={0};
    scanf("%d",&n);
    for(i=0;i<n;i++)
    {
        scanf("%f",&a[i]);
        sum+=(float)a[i];
    }
    for(i=0;i<n;i++)
    {
        scanf("%f",&b[i]);
        c[i]=score( b[i] );
        GAP+=a[i]*c[i];
    }
    GAP/=sum;
    printf("%.2f\n",GAP);
    return 0;
}


int main()
{
int n,shijifen[10],xuefen[10],i,xuefenzhihe;
double ymxf[10],jidian[10],jidianzhihe,GPA;
scanf("%d\n",&n);
xuefenzhihe=0;
for (i=0;i<n;i++){
scanf("%d",&xuefen[i]);
xuefenzhihe=xuefenzhihe+xuefen[i];
}
for (i=0;i<n;i++){
scanf("%d",&shijifen[i]);
if(shijifen[i]<60){
jidian[i]=0;}else if(shijifen[i]>=60&&shijifen[i]<=63){
jidian[i]=1.0;}else if(shijifen[i]>=64&&shijifen[i]<=67){
jidian[i]=1.5;}else if(shijifen[i]>=68&&shijifen[i]<=71){
jidian[i]=2.0;}else if(shijifen[i]>=72&&shijifen[i]<=74){
jidian[i]=2.3;}else if(shijifen[i]>=75&&shijifen[i]<=77){
jidian[i]=2.7;}else if(shijifen[i]>=78&&shijifen[i]<=81){
jidian[i]=3.0;}else if(shijifen[i]>=82&&shijifen[i]<=84){
jidian[i]=3.3;}else if(shijifen[i]>=85&&shijifen[i]<=89){
jidian[i]=3.7;}else{
jidian[i]=4.0;}
}
jidianzhihe=0;
for (i=0;i<n;i++){
jidianzhihe=jidianzhihe+jidian[i]*xuefen[i];
}
GPA=jidianzhihe/xuefenzhihe;
printf("%.2lf",GPA);
return 0;
}


int main (){
	int numberOfCourse,i,j;
	int sumOfCredits=0;
	float sum=0.0,average,grade;
	int credits[11];
	int grades[11];

	scanf("%d",&numberOfCourse);

	for (i=0;i<numberOfCourse;i++)
		scanf("%d",&credits[i]);

	for (i=0;i<numberOfCourse;i++)
		scanf("%d",&grades[i]);

	for (i=0;i<numberOfCourse;i++)
	{
		if((grades[i]>=90)&&(grades[i]<=100)){
			grade=4;}
		else if((grades[i]>=85)&&(grades[i]<=89)){
			grade=3.7;}
		else if((grades[i]>=82)&&(grades[i]<=84)){
			 grade=3.3;}
		else if((grades[i]>=78)&&(grades[i]<=81)){
			grade=3.0;}
		else if((grades[i]>=75)&&(grades[i]<=77)){
			grade=2.7;}
		else if((grades[i]>=72)&&(grades[i]<=74)){
			grade=2.3;}
		else if((grades[i]>=68)&&(grades[i]<=71)){
			grade=2.0;}
		else if((grades[i]>=64)&&(grades[i]<=67)){
			grade=1.5;}
		else if((grades[i]>=60)&&(grades[i]<=63)){
			grade=1.0;}
		else if((grades[i]>=0)&&(grades[i]<=59)){
			grade=0;}

		sumOfCredits += credits[i];
		sum += credits[i] * grade;
	}
	printf("%.2f",sum/sumOfCredits);
	return 0;

}


void main()
{
	int num,*xuefen,*score,i,txuefen=0;
	float *gpa,total=0,part,GPA;
	scanf("%d",&num);
	xuefen=(int*)malloc(sizeof(int)*num);
	score=(int*)malloc(sizeof(int)*num);
    gpa=(float*)malloc(sizeof(float)*num);
    for(i=0;i<num;i++)
		scanf("%d",xuefen+i);
	for(i=0;i<num;i++)
		scanf("%d",score+i);
	for(i=0;i<num;i++)
	{
		if(score[i]>=90)
			gpa[i]=4.0;
		if(score[i]>=85&&score[i]<=89)
			gpa[i]=3.7;
		if(score[i]>=82&&score[i]<=84)
			gpa[i]=3.3;
		if(score[i]>=78&&score[i]<=81)
			gpa[i]=3.0;
		if(score[i]>=75&&score[i]<=77)
			gpa[i]=2.7;
		if(score[i]>=72&&score[i]<=74)
			gpa[i]=2.3;
		if(score[i]>=68&&score[i]<=71)
			gpa[i]=2.0;
		if(score[i]>=64&&score[i]<=67)
			gpa[i]=1.5;
		if(score[i]>=60&&score[i]<=63)
			gpa[i]=1.0;
		if(score[i]<=59)
			gpa[i]=0;
	}
	for(i=0;i<num;i++)
	{
		part=xuefen[i]*gpa[i];
		total=total+part;
		txuefen=xuefen[i]+txuefen;
	}
	GPA=total/txuefen;
	printf("%.2f",GPA);
}


int main(int argc, char* argv[])
{double GPA;
float c,m,sum=0,mum=0;
int n,i,p,q,u;
	scanf("%d",&n);
	struct majors
	{
	float credit;
	float marks;
	};
	struct majors *jidian;
	jidian=(struct majors *)malloc(sizeof(majors) * n);

	for (i=0;i<n;i++)
		{scanf("%f",&c);
         (jidian+i)->credit=c;
		}

	for (p=0;p<n;p++)
	{scanf("%f",&m);
		if ((m<=100)&&(m>=90))
		{(jidian+p)->marks=4.0;}
		else if ((m<=89)&&(m>=85))
		{(jidian+p)->marks=3.7;}
		else if ((m<=84)&&(m>=82))
		{(jidian+p)->marks=3.3;}
		else if ((m<=81)&&(m>=78))
		{(jidian+p)->marks=3.0;}
		else if ((m<=77)&&(m>=75))
		{(jidian+p)->marks=2.7;}
		else if ((m<=74)&&(m>=72))
		{(jidian+p)->marks=2.3;}
		else if ((m<=71)&&(m>=68))
		{(jidian+p)->marks=2.0;}
		else if ((m<=67)&&(m>=64))
		{(jidian+p)->marks=1.5;}
		else if ((m<=63)&&(m>=60))
		{(jidian+p)->marks=1.0;}
		else if (m<60)
		{(jidian+p)->marks=0;}
	}

	for(q=0;q<n;q++)
	{sum=sum+((jidian+q)->marks)*((jidian+q)->credit);}

	for(u=0;u<n;u++)
	{mum=mum+((jidian+u)->credit);}

	GPA=sum/mum;
	printf("%.2f",GPA);
	free(jidian);
	return 0;

}


void main()
{
   int n=0,xuefen[10]={0},defen[10]={0},i=0;
   float num=0,fen=0,GPA=0,gpa[10]={0};
   scanf("%d",&n);
   for(i=0;i<n;i++) scanf("%d",&xuefen[i]);
   for(i=0;i<n;i++) scanf("%d",&defen[i]);
   for(i=0;i<n;i++)
   {
      if(defen[i]>89) gpa[i]=4;
      else if(defen[i]>84&&defen[i]<90) gpa[i]=3.7;
      else if(defen[i]>81&&defen[i]<85) gpa[i]=3.3;
      else if(defen[i]>77&&defen[i]<82) gpa[i]=3;
      else if(defen[i]>74&&defen[i]<78) gpa[i]=2.7;
      else if(defen[i]>71&&defen[i]<75) gpa[i]=2.3;
      else if(defen[i]>67&&defen[i]<72) gpa[i]=2;
      else if(defen[i]>63&&defen[i]<68) gpa[i]=1.5;
      else if(defen[i]>59&&defen[i]<64) gpa[i]=1;
      else if(defen[i]<60) gpa[i]=0;
   }
   for(i=0;i<n;i++)
   {
      num=num+gpa[i]*xuefen[i];
      fen=fen+xuefen[i];
   }
   GPA=num/fen;
   printf("%.2f\n",GPA);
}


int main()
{
	int score[10],i,n;
	double a[10],sum=0,SUM=0,GPA,t=0,p;
	scanf("%d\n",&n);
	for(i=0;i<n;i++){
		scanf("%lf",&a[i]);
		SUM+=a[i];
	}
	for(i=0;i<n;i++){
	scanf("%d",&score[i]);
	if(90<=score[i])
		p=4.0;
	else if(85<=score[i])
		p=3.7;
	else if(82<=score[i])
	    p=3.3;
	else if(78<=score[i])
	    p=3.0;
	else if(75<=score[i])
	    p=2.7;
    else if(72<=score[i])
	    p=2.3;
	else if(68<=score[i])
	    p=2.0;
	else if(64<=score[i])
	    p=1.5;
	else if(60<=score[i])
	    p=1.0;
		else
		p=0;
	t=p*a[i];
	sum+=t;
	}
	GPA=(double)sum/SUM;
	printf("%.2lf",GPA);
	return 0;
}


double jp(int p)
{
	double jp;
	if(p>=90)
		jp=4.0;
	else if(p>=85)
		jp=3.7;
	else if(p>=82)
		jp=3.3;
	else if(p>=78)
		jp=3.0;
	else if(p>=75)
		jp=2.7;
	else if(p>=72)
		jp=2.3;
	else if(p>=68)
		jp=2.0;
	else if(p>=64)
		jp=1.5;
	else if(p>=60)
		jp=1.0;
	else
		jp=0.0;
	return jp;
}
int main()
{
	int n,p;
	scanf("%d",&n);
	int list1[10];
	double list2[10];
	int i;

	for(i=0;i<n;i++)
		scanf("%d",&list1[i]);
	for(i=0;i<n;i++)
	{
		scanf("%d",&p);
		list2[i]=jp(p)*list1[i];
	}

	int sum1=0;
	double sum2;
	for(i=0;i<n;i++)
         sum1+=list1[i];
	for(i=0;i<n;i++)
		sum2+=(list2[i]/sum1);

	printf("%.2f",sum2);
	return 0;
}


void main()
{
   int i,n,xft=0;
   int xf[10],score[10];
   float GPA=0,jd[10];
   scanf("%d",&n);
   for(i=0;i<=n-1;i++)
   {
	   scanf("%d",&xf[i]);
	   xft=xft+xf[i];
   }
   for(i=0;i<=n-1;i++)
   {
	   scanf("%d",&score[i]);
	   if(score[i]>=90) jd[i]=4.0;
	   else if(score[i]>=85) jd[i]=3.7;
	   else if(score[i]>=82) jd[i]=3.3;
	   else if(score[i]>=78) jd[i]=3.0;
	   else if(score[i]>=75) jd[i]=2.7;
	   else if(score[i]>=72) jd[i]=2.3;
	   else if(score[i]>=68) jd[i]=2.0;
	   else if(score[i]>=64) jd[i]=1.5;
	   else if(score[i]>=60) jd[i]=1.0;
	   else if(score[i]>=0) jd[i]=0;
   }
   for(i=0;i<=n-1;i++)
   {
	   GPA=GPA+xf[i]*jd[i];
   }
   GPA=GPA/xft;
   printf("%.2f",GPA);
}


int main()
{
	int shang[10] = {100,89,84,81,77,74,71,67,63,59};
	int xia[10] = {90,85,82,78,75,72,68,64,60,0};
	double jidian[10] = {4.0,3.7,3.3,3.0,2.7,2.3,2.0,1.5,1.0,0};
	int n;
	cin>>n;
	int xuefen[n];
	double fenshu[n];
	int sumxuefen = 0;
	for(int i = 0; i < n; i++)
	{
		cin>>xuefen[i];
		sumxuefen += xuefen[i];
	}
	for(int i = 0; i < n; i++)
		cin>>fenshu[i];
	double sum = 0;
	for(int i = 0; i < n; i++)
	{
		for(int j = 0; j < 10; j++)
			if(fenshu[i] >= xia[j] && fenshu[i] <= shang[j])
			{
				fenshu[i] = jidian[j]*xuefen[i];
				sum += fenshu[i];
			}
	}

	double result = sum / sumxuefen;
	printf("%.2f",result);

	return 0;
}


double f(int n)
{
       if(n<=100 && n>=90)
           return 4.0;
       if(n<=89 && n>=85)
       return 3.7;
       if(n<=84 && n>=82)
       return 3.3;
       if(n<=81 && n>=78)
       return 3.0;
       if(n<=77 && n>=75)
       return 2.7;
       if(n<=74 && n>=72)
       return 2.3;
       if(n<=71 && n>=68)
       return 2.0;
       if(n<=67 && n>=64)
       return 1.5;
       if(n<=63 && n>=60)
       return 1.0;
       if(n<60)
       return 0;
       }
int main()
{
    int cred[11],score[11],n;
    cin>>n;
      double ans=0;
    for(int i=0;i<n;i++)
    {
        cin>>cred[i];
        ans+=cred[i];
        }
    double sc=0;
    for(int i=0;i<n;i++)
    {
        cin>>score[i];
        sc+=f(score[i])*cred[i];
        }
    ans = sc/ans;
    cout.precision(3);
    cout<<ans<<endl;
}


int main(){
        int chengji[10], i, xuefen[10], n,j;
        int s=0;
		double t=0;
double GPA,point[100];
scanf("%d",&n);
for(j=0;j<n;j++){
        scanf("%d",&xuefen[j]);
        s+=xuefen[j];
}
for(i=0;i<n;i++){
		scanf("%d",&chengji[i]);
	if((chengji[i]>=90)&&(chengji[i]<=100)){
		point[i]=4.0;
	}else if((chengji[i]>=85)&&(chengji[i]<=89)){
		point[i]=3.7;
	}else if((chengji[i]>=82)&&(chengji[i]<=84)){
		point[i]=3.3;
	}else if((chengji[i]>=78)&&(chengji[i]<=81)){
		point[i]=3.0;
	}else if((chengji[i]>=75)&&(chengji[i]<=77)){
		point[i]=2.7;
	}else if((chengji[i]>=72)&&(chengji[i]<74)){
		point[i]=2.3;
	}else if((chengji[i]>=68)&&(chengji[i]<=71)){
		point[i]=2.0;
	}else if((chengji[i]>=64)&&(chengji[i]<=67)){
		point[i]=1.5;
	}else if((chengji[i]>=60)&&(chengji[i]<=63)){
		point[i]=1.0;
	}else {
        point[i]=0;
	}
	t+=point[i]*xuefen[i];

	}
	GPA=1.0*t/s;
	printf("%.2f",GPA);
	return 0;
}


int main()
{
    int i,sum1=0,n,c[10],shiji[10];
float g[10] ,shidejidian[10],sum2=0;
	scanf("%d",&n);
	for(i=0;i<n;i++){
		scanf("%d",&c[i]);
		sum1+=c[i];}
	for(i=0;i<n;i++)	{scanf("%d",&shiji[i]);
	if(shiji[i]>89)g[i]=4.0;
	else if(shiji[i]>84)g[i]=3.7;
	else if(shiji[i]>81)g[i]=3.3;
	else if(shiji[i]>77)g[i]=3.0;
	else if(shiji[i]>74)g[i]=2.7;
	else if(shiji[i]>71)g[i]=2.3;
	else if(shiji[i]>67)g[i]=2.0;
	else if(shiji[i]>63)g[i]=1.5;
	else if(shiji[i]>59)g[i]=1.0;
	else g[i]=0;
	shidejidian[i]=g[i]*c[i];
	sum2+=shidejidian[i];}
	printf("%.2f",(float)sum2/sum1);

}


float mark(int a)
{
	if(a>=90&&a<=100)
		return(4.0);
	else if(a>=85&&a<=89)
		return(3.7);
	else if(a>=82&&a<=84)
		return(3.3);
	else if(a>=78&&a<=81)
		return(3.0);
	else if(a>=75&&a<=77)
		return(2.7);
	else if(a>=72&&a<=74)
		return(2.3);
	else if(a>=68&&a<=71)
		return(2.0);
	else if(a>=64&&a<=67)
		return(1.5);
	else if(a>=60&&a<=63)
		return(1.0);
	else if(a<=59)
		return(0);
}
int main()
{
	int n;
	int all[10]={0};
	int score[10]={0};
	float GPA;
	scanf("%d",&n);
	int i;
	for(i=0;i<n;i++)
		scanf("%d",&all[i]);
	for(i=0;i<n;i++)
		scanf("%d",&score[i]);
	float grade[10]={0};
	for(i=0;i<n;i++)
		grade[i]=mark(score[i]);
	float sum1,sum2;
	for(sum1=0,i=0;i<n;i++)
		sum1+=grade[i]*all[i];
	for(sum2=0,i=0;i<n;i++)
		sum2+=all[i];
	GPA=sum1/sum2;
	printf("%.2f",GPA);
	return(0);
}


double cl(int a){
	if(a>=90)return 4;
	if(a>=85)return 3.7;
	if(a>=82)return 3.3;
	if(a>=78)return 3;
	if(a>=75)return 2.7;
	if(a>=72)return 2.3;
	if(a>=68)return 2;
	if(a>=64)return 1.5;
	if(a>=60)return 1;
	return 0;
}
int main(){
int n;
cin>>n;
double f[10];
double s=0;
for(int i=0;i<n;i++){
	cin>>f[i];
	s+=f[i];
}
double gpa=0;
for(int i=0;i<n;i++){
	int a;
	cin>>a;
	gpa+=cl(a)*f[i];
}
printf("%.2f",gpa/s);
return 0;
}


int main(){
    int n,i,s;
    double GPA,x;
    int xuefen[10];
    int defen[10];
    double jidian[10];
    scanf("%d\n",&n);
    for(i=0;i<=n-2;i++){
        scanf(" %d",&(xuefen[i]));
    }
    scanf(" %d\n",&(xuefen[n-1]));
    for(i=0;i<=n-1;i++){
        scanf(" %d",&(defen[i]));
    }for(i=0,s=0;i<=n-1;i++){
        s=s+xuefen[i];
    }for(i=0;i<=n-1;i++){
        if(defen[i]>=90){
            jidian[i]=4.0;
        }else if(defen[i]>=85&&defen[i]<=89){
            jidian[i]=3.7;
        }else if(defen[i]>=82&&defen[i]<=84){
            jidian[i]=3.3;
        }else if(defen[i]>=78&&defen[i]<=81){
            jidian[i]=3.0;
        }else if(defen[i]>=75&&defen[i]<=77){
            jidian[i]=2.7;
        }else if(defen[i]>=72&&defen[i]<=74){
            jidian[i]=2.3;
        }else if(defen[i]>=68&&defen[i]<=71){
            jidian[i]=2.0;
        }else if(defen[i]>=64&&defen[i]<=67){
            jidian[i]=1.5;
        }else if(defen[i]>=60&&defen[i]<=63){
            jidian[i]=1.0;
        }else if(defen[i]<60){
            jidian[i]=0;
        }
    }for(i=0;i<=n-1;i++){
        x=x+1.0*jidian[i]*xuefen[i];
    }GPA=x/s;
    printf("%.2lf\n",GPA);
    return 0;
}


int main()
{
    int n,i,grade;
    scanf("%d",&n);
    float credit[10],a=0,b=0,GPA;
    for(i=1;i<=n;i++)
    {
                    scanf("%f",&credit[i]);
                    a+=credit[i];
    }
    for(i=1;i<=n;i++)
    {
    scanf("%d",&grade);
    if(90<=grade&&grade<=100)
    b+=credit[i]*4.0;
    else if(85<=grade&&grade<=89)
    b+=credit[i]*3.7;
    else if(82<=grade&&grade<=84)
    b+=credit[i]*3.3;
    else if(78<=grade&&grade<=81)
    b+=credit[i]*3.0;
    else if(75<=grade&&grade<=77)
    b+=credit[i]*2.7;
    else if(72<=grade&&grade<=74)
    b+=credit[i]*2.3;
    else if(68<=grade&&grade<=71)
    b+=credit[i]*2.0;
    else if(64<=grade&&grade<=67)
    b+=credit[i]*1.5;
    else if(60<=grade&&grade<=63)
    b+=credit[i]*1.0;
    else
    b+=credit[i]*0;
    }
    GPA=b/a;
    printf("%.2f",GPA);
}


int main(){
	int n,i,a,sum2;
	int xuefen[10];
	double GPA,sum1;
	double jidian[10];
	sum1=0;
	sum2=0;
	scanf("%d",&n);
	for(i=0;i<n;i++){
		scanf("%d",&xuefen[i]);
	}
	for(i=0;i<n;i++){
		scanf("%d",&a);
		if(a>89&&a<101){
			jidian[i]=4.0;
		}else if(a>84&&a<90){
			jidian[i]=3.7;
		}else if(a>81&&a<85){
			jidian[i]=3.3;
		}else if(a>77&&a<82){
			jidian[i]=3.0;
		}else if(a>74&&a<78){
			jidian[i]=2.7;
		}else if(a>71&&a<75){
			jidian[i]=2.3;
		}else if(a>67&&a<72){
			jidian[i]=2.0;
		}else if(a>63&&a<68){
			jidian[i]=1.5;
		}else if(a>59&&a<64){
			jidian[i]=1.0;
		}else{
			jidian[i]=0.0;
		}
	}

	for(i=0;i<n;i++){
		jidian[i]=jidian[i]*xuefen[i];
	}
	for(i=0;i<n;i++){
		sum1+=jidian[i];
		sum2+=xuefen[i];
	}
	GPA=sum1/sum2;
	printf("%.2f",GPA);
	return 0;
}


int main()
{
	int i,n,zongxuefen=0;
	int chengji[10];
	int xuefen[10];
	double zongpingjidian=0,jidian[10],zongjidian=0;
	scanf("%d",&n);
	for(i=1;i<=n;i++){
      scanf("%d",&xuefen[i]);
	}
    for(i=1;i<=n;i++){
		scanf("%d",&chengji[i]);
	}

	for(i=1;i<=n;i++){
		if((chengji[i]>=90)&&(chengji[i]<=100)){
		jidian[i]=4.0;}
	if((chengji[i]>=85)&&(chengji[i]<=89)){
		jidian[i]=3.7;}
	if((chengji[i]>=82)&&(chengji[i]<=84)){
		jidian[i]=3.3;}
    if((chengji[i]>=78)&&(chengji[i]<=81)){
		jidian[i]=3.0;}
	if((chengji[i]>=75)&&(chengji[i]<=77)){
		jidian[i]=2.7;}
	if((chengji[i]>=72)&&(chengji[i]<=74)){
		jidian[i]=2.3;}
	if((chengji[i]>=68)&&(chengji[i]<=71)){
		jidian[i]=2.0;}
	if((chengji[i]>=64)&&(chengji[i]<=67)){
		jidian[i]=1.5;}
	if((chengji[i]>=60)&&(chengji[i]<=63)){
		jidian[i]=1.0;}
	if(chengji[i]<=60){
		jidian[i]=0;}
    zongjidian+=1.0*xuefen[i]*jidian[i];
			zongxuefen+=xuefen[i];
		}
    zongpingjidian=1.0*zongjidian/zongxuefen;
	printf("%.2lf",zongpingjidian);
return 0;

}


double JiDian(int cj);
int main(){
 int n;
 scanf("%d",&n);
 int cj[10];
 int xf[10];
 int i,j;
 for(j=0;j<n;j++){
  scanf("%d",&(xf[j]));
 }
 for(i=0;i<n;i++){
  scanf("%d",&(cj[i]));
 }
 double x=0;
 double y=0;
 for(i=0,j=0;i<n,j<n;i++,j++){
  x+=JiDian(cj[i])*(xf[j]);
  y+=xf[j];
 }
double GPA;
 GPA=x/y;
 printf("%.2lf\n",GPA);
 return 0;
}
double JiDian(int cj){
 double jidian;
 if(cj<=100&&cj>=90){
  jidian=4.0;
 }else if(cj<=89&&cj>=85){
  jidian=3.7;
 }else if(cj<=84&&cj>=82){
  jidian=3.3;
    }else if(cj<=81&&cj>=78){
  jidian=3.0;
 }else if(cj<=77&&cj>=75){
  jidian=2.7;
 }else if(cj<=74&&cj>=72){
  jidian=2.3;
    }else if(cj<=71&&cj>=68){
  jidian=2.0;
 }else if(cj<=67&&cj>=64){
  jidian=1.5;
 }else if(cj<=63&&cj>=60){
  jidian=1.0;
 }else{
  jidian=0;
 }
 return jidian;
}


int main()
{
	int n;
         scanf("%d",&n);
	int i;
	int sz[10],sz2[10];
	for(i=0;i<n;i++){
		scanf("%d",&sz[i]);
	}
	for(i=0;i<n;i++){
		scanf("%d",&sz2[i]);
	}
	double point[10];
	for(i=0;i<n;i++){
		if(sz2[i]<60)
			point[i]=0;
		else if(sz2[i]<64)
			point[i]=1.0;
		else if(sz2[i]<68)
			point[i]=1.5;
        else if(sz2[i]<72)
			point[i]=2.0;
        else if(sz2[i]<75)
			point[i]=2.3;
        else if(sz2[i]<78)
			point[i]=2.7;
        else if(sz2[i]<82)
			point[i]=3.0;
        else if(sz2[i]<85)
			point[i]=3.3;
        else if(sz2[i]<90)
			point[i]=3.7;
		else if(sz2[i]<=100)
			point[i]=4.0;
	}
	double m=0,result;
	int q=0;
	for(i=0;i<n;i++){
       m=m+point[i]*sz[i];
	   q=q+sz[i];
	   }
    result=m/q;
    printf("%.2lf",result);
return 0;
}


main()
{
	int n,i,score;
	scanf("%d",&n);
	int a[n];
	for(i=0;i<n;i++)
		scanf("%d",&a[i]);
	double b[n];
	for(i=0;i<n;i++)
	{
		scanf("%d",&score);
		if(score>=90)
			b[i]=4.0;
		else if(score>=85)
			b[i]=3.7;
		else if(score>=82)
			b[i]=3.3;
		else if(score>=78)
			b[i]=3.0;
		else if(score>=75)
			b[i]=2.7;
		else if(score>=72)
			b[i]=2.3;
		else if(score>=68)
			b[i]=2.0;
		else if(score>=64)
			b[i]=1.5;
		else if(score>=60)
			b[i]=1.0;
		else
			b[i]=0;
	}
	double sum;
	int x;
	sum=0;
	x=0;
	for(i=0;i<n;i++)
	{
		sum=sum+a[i]*b[i];
		x=x+a[i];
	}
	double ave;
	ave=sum/x;
	printf("%.2lf",ave);
	return 0;
}


float pnt(float scr);

int main()
{
	int n,i;
	float gpa=0,sum=0,score[10],credit[10];

	scanf("%d",&n);

	for(i=0;i<n;i++)
	{
		scanf("%f",&credit[i]);
	}
	for(i=0;i<n;i++)
	{
		scanf("%f",&score[i]);
		gpa+=pnt(score[i])*credit[i];
		sum+=credit[i];
	}

	gpa/=sum;

	printf("%.2f",gpa);

	return 0;
}

float pnt(float scr)
{
	if(scr>89)
		return 4.0;
	else if(scr>84)
		return 3.7;
	else if(scr>81)
		return 3.3;
	else if(scr>77)
		return 3.0;
	else if(scr>74)
		return 2.7;
	else if(scr>71)
		return 2.3;
	else if(scr>67)
		return 2.0;
	else if(scr>63)
		return 1.5;
	else if(scr>59)
		return 1.0;
	else
		return 0;
}


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


int main()
{
	double GPA;
	double xf[100];
	double cj[100];
	double jd[100];
	double s[100];
	double p=0;
	double sumxf=0,sumjd=0;
	int i=0,j=0;
	int n;
	double t;
	double a[100];
	scanf("%d",&n);

	for(i=0;i<n;i++)
	{
	scanf("%lf",&xf[i]);
	sumxf=sumxf+xf[i];

	}

	for(i=0;i<n;i++)
	{
	scanf("%lf",&cj[i]);
	t=cj[i];
	if(t>=90)
		jd[i]=4.0;
	else
		{if(t>=85)
			jd[i]=3.7;
		else
			{if(t>=82)
				jd[i]=3.3;
			else
			{if(t>=78)
				jd[i]=3.0;
			else
				{if(t>=75)
					jd[i]=2.7;
				else
					{if(t>=72)
						jd[i]=2.3;
					else
						{if(t>=68)
							jd[i]=2.0;
						else
						{if(t>=64)
							jd[i]=1.5;
						else
							{if(t>=60)
								jd[i]=1;
							else
								jd[i]=0;}}}}}}}}

	}

	for(i=0;i<n;i++)
	{
	s[i]=xf[i]*jd[i];
	p=p+s[i];
	}
	GPA=p/sumxf;

	printf("%.2lf",GPA);

return 0;

}


int main() {
	int n;
	cin >> n;
	int xuefen[10] = {0};  // input part
	for(int i = 0; i < n; i++)
		cin >> xuefen[i];
	int score[10] = {0};
	double jidian[10] = {0};
	for(int i = 0; i < n; i++) {
		cin >> score[i];
		if(score[i] >= 90 && score[i] <= 100) jidian[i] = 4.0;     // calculate the jidian of this course
		if(score[i] >= 85 && score[i] <= 89) jidian[i] = 3.7;
		if(score[i] >= 82 && score[i] <= 84) jidian[i] = 3.3;
		if(score[i] >= 78 && score[i] <= 81) jidian[i] = 3.0;
		if(score[i] >= 75 && score[i] <= 77) jidian[i] = 2.7;
		if(score[i] >= 72 && score[i] <= 74) jidian[i] = 2.3;
		if(score[i] >= 68 && score[i] <= 71) jidian[i] = 2.0;
		if(score[i] >= 64 && score[i] <= 67) jidian[i] = 1.5;
		if(score[i] >= 60 && score[i] <= 63) jidian[i] = 1.0;
		if(score[i] <= 59) jidian[i] = 0;
	}
	double sum1 = 0, sum2 = 0;
	for(int i = 0; i < n; i++) {
		sum1 += xuefen[i] * jidian[i]; // ????????
		sum2 += xuefen[i];        // ????????
	}
	double GPA = sum1 / sum2;
	printf("%.2f",GPA);
	getchar();
	getchar();
	return 0;
}


void main(){
	int n;
	double zxf=0,xfj=0,gpa;
	int i;
	struct lesson{
		int point;
		int score;
		double jd;
	}sub[10];
	scanf("%d",&n);
	for(i=0;i<n;i++){
		scanf("%d",&sub[i].point);
	}
	for(i=0;i<n;i++){
		scanf("%d",&sub[i].score);
	}
	for(i=0;i<n;i++){
		switch(sub[i].score){
		case 100:
		case 99:
		case 98:
		case 97:
		case 96:
		case 95:
		case 94:
		case 93:
		case 92:
		case 91:
		case 90:
			sub[i].jd=4.0;
			break;
		case 89:
		case 88:
		case 87:
		case 86:
		case 85:
			sub[i].jd=3.7;
			break;
		case 84:
		case 83:
		case 82:
			sub[i].jd=3.3;
			break;
		case 81:
		case 80:
		case 79:
		case 78:
			sub[i].jd=3.0;
			break;
		case 77:
		case 76:
		case 75:
			sub[i].jd=2.7;
			break;
		case 74:
		case 73:
		case 72:
			sub[i].jd=2.3;
			break;
		case 71:
		case 70:
		case 69:
		case 68:
			sub[i].jd=2.0;
			break;
		case 67:
		case 66:
		case 65:
		case 64:
			sub[i].jd=1.5;
			break;
		case 63:
		case 62:
		case 61:
		case 60:
			sub[i].jd=1.0;
			break;
		default:
			sub[i].jd=0;
			break;

		}
	}
	for(i=0;i<n;i++){
		xfj+=sub[i].point*sub[i].jd;
		zxf+=sub[i].point;
	}
	gpa=xfj/zxf;
	printf("%.2lf\n",gpa);
}


//#include<iostream>
//using namespace std;

int main()
{
	int n,i;
	int xuefen[15],chengji[15];
	int sum;
	float jidian[15];
	float sum2;
	float tmp;
	scanf("%d",&n);
	getchar();
	sum=0;
	sum2=0;
	for(i=1;i<=n;i++)
	{
		scanf("%d",&xuefen[i]);
		sum = sum + xuefen[i];
	}
	getchar();
	for(i=1;i<=n;i++)
	{
		scanf("%d",&chengji[i]);
		if(chengji[i]>=90 && chengji[i]<=100)
			jidian[i]=4.0;
		else if(chengji[i]>=85 && chengji[i]<=89)
			jidian[i]=3.7;
		else if(chengji[i]>=82 && chengji[i]<=84)
			jidian[i]=3.3;
		else if(chengji[i]>=78 && chengji[i]<=81)
			jidian[i]=3.0;
		else if(chengji[i]>=75 && chengji[i]<=77)
			jidian[i]=2.7;
		else if(chengji[i]>=72 && chengji[i]<=74)
			jidian[i]=2.3;
		else if(chengji[i]>=68 && chengji[i]<=71)
			jidian[i]=2.0;
		else if(chengji[i]>=64 && chengji[i]<=67)
			jidian[i]=1.5;
		else if(chengji[i]>=60 && chengji[i]<=63)
			jidian[i]=1.0;
		else
			jidian[i]=0;
	}
	sum2;
	for(i=1;i<=n;i++)
	{
		sum2=sum2+jidian[i]*xuefen[i];
	}
	tmp=sum2/sum;
	printf("%.2f",tmp);
	return 0;
}


void main()
{
    float gpa(int point);
    int point[11],mark[11];
    float gpax[11];
    int i,k,sum;
    float summ;
    scanf("%d",&k);
    sum=0;summ=0;
    for(i=1;i<=k;i++)
    {
    	scanf("%d",&mark[i]);
    	sum=sum+mark[i];
    }
    for(i=1;i<=k;i++)
    {
    	scanf("%d",&point[i]);
    	gpax[i]=gpa(point[i]);
    	summ=summ+((float)mark[i])*(gpax[i]);
    }
    printf("%.2f\n",summ/sum);
}

float gpa(int point)
{
	float gpa;
	if(point<60) gpa=0;
	else if(point<64) gpa=1.0;
	else if(point<68) gpa=1.5;
	else if(point<72) gpa=2.0;
	else if(point<75) gpa=2.3;
	else if(point<78) gpa=2.7;
	else if(point<82) gpa=3.0;
	else if(point<85) gpa=3.3;
	else if(point<90) gpa=3.7;
	else gpa=4.0;
	return(gpa);
}


int main(){
	int n,q=0,i,xuefen[10],chengji[10];
	double p=0,zong,GPA[10],xuefenGPA[10];
	scanf("%d",&n);
	for(i=0;i<n;i++){
		scanf("%d",&(xuefen[i]));
	}
    for(i=0;i<n;i++){
        scanf("%d",&(chengji[i]));
	}
    for(i=0;i<n;i++){
		if(chengji[i]>=90){
		GPA[i]=4.0;
		}else if(chengji[i]>=85&&chengji[i]<90){
		GPA[i]=3.7;
		}else if(chengji[i]>=82&&chengji[i]<85){
		GPA[i]=3.3;
		}else if(chengji[i]>=78&&chengji[i]<82){
		GPA[i]=3.0;
		}else if(chengji[i]>=75&&chengji[i]<78){
		GPA[i]=2.7;
		}else if(chengji[i]>=72&&chengji[i]<75){
		GPA[i]=2.3;
		}else if(chengji[i]>=68&&chengji[i]<72){
		GPA[i]=2.0;
		}else if(chengji[i]>=64&&chengji[i]<68){
		GPA[i]=1.5;
		}else if(chengji[i]>=60&&chengji[i]<64){
		GPA[i]=1.0;
		}else{
            GPA[i]=0;
		}
	}
    for(i=0;i<n;i++){
		xuefenGPA[i]=GPA[i]*xuefen[i];
	}
    for(i=0;i<n;i++){
		p+=xuefenGPA[i];
	}
    for(i=0;i<n;i++){
		q+=xuefen[i];
	}
	zong=p/q;
	printf("%.2lf",zong);

	return 0;

}


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


int n,a[15];
double ck(int x)
{
	if(x>=90) return 4.;
	if(x>=85) return 3.7;
	if(x>=82) return 3.3;
	if(x>=78) return 3.;
	if(x>=75) return 2.7;
	if(x>=72) return 2.3;
	if(x>=68) return 2.;
	if(x>=64) return 1.5;
	if(x>=60) return 1.;
	return 0;
}
int main()
{
	while(scanf("%d",&n)==1)
	{
		int sum1=0;
		double sum2=0;
		for(int i=0;i<n;i++)
		{
			scanf("%d",a+i);
			sum1+=a[i];
		}
		for(int i=0;i<n;i++)
		{
			int tmp;
			scanf("%d",&tmp);
			sum2+=ck(tmp)*a[i];
		}

		printf("%.2f\n",sum2/sum1);
	}
	return 0;
}


int main(){
    int i,n;
    int sz[10];
    double mark[10];
    scanf("%d",&n);
    for(i=0;i<n;i++){
        scanf("%d ",&sz[i]);
    }
    for(i=0;i<n;i++){
        scanf("%lf ",&mark[i]);
    }
    for(i=0;i<n;i++){
        if(mark[i]>=90){
            mark[i]=4.0;
            }else if(
            85<=mark[i]&&mark[i]<=89){
                mark[i]=3.7;
            }else if(
            82<=mark[i]&&mark[i]<=84){
                mark[i]=3.3;
            }else if(
            78<=mark[i]&&mark[i]<=81){
                mark[i]=3.0;
            }else if(
            75<=mark[i]&&mark[i]<=77){
                mark[i]=2.7;
            }else if(
            72<=mark[i]&&mark[i]<=74){
                mark[i]=2.3;
            }else if(
            68<=mark[i]&&mark[i]<=71){
                mark[i]=2.0;
            }else if(
            64<=mark[i]&&mark[i]<=67){
                mark[i]=1.5;
            }else if(
            60<=mark[i]&&mark[i]<=63){
                mark[i]=1.0;
            }else if(
            mark[i]<60){
                mark[i]=0;
            }

    }
    double sum[10];
    for(i=0;i<n;i++){
        sum[i]=mark[i]*sz[i];
    }
    double sumGPA=0,xuefen=0;
    for(i=0;i<n;i++){
        sumGPA+=sum[i];
    }
    for(i=0;i<n;i++){
        xuefen+=sz[i];
    }
    double result;
    result=sumGPA/xuefen;
    printf("%.2lf",result);
    return 0;
}


int main(){
	int n,defen[10],i,zongxuefen=0,xuefen[10];
	double result,sum=0,jidian[10];
	scanf("%d",&n);
	for(i=0;i<n;i++){
		scanf("%d",&xuefen[i]);
		zongxuefen+=xuefen[i];
	}
	for(i=0;i<n;i++){
		scanf("%d",&defen[i]);
		if(defen[i]>=90){
			jidian[i]=4.0;
		}
		else if(defen[i]>=85){
			jidian[i]=3.7;
		}
		else if(defen[i]>=82){
			jidian[i]=3.3;
		}
		else if(defen[i]>=78){
			jidian[i]=3.0;
		}
		else if(defen[i]>=75){
			jidian[i]=2.7;
		}
		else if(defen[i]>=72){
			jidian[i]=2.3;
		}
		else if(defen[i]>=68){
			jidian[i]=2.0;
		}
		else if(defen[i]>=64){
			jidian[i]=1.5;
		}
		else if(defen[i]>=60){
			jidian[i]=1.0;
		}
		else{
			jidian[i]=0;
		}
	}
		for(i=0;i<n;i++){
			sum+=jidian[i]*xuefen[i];
		}
        result=sum/zongxuefen;
		printf("%.2lf",result);
		return 0;
	}


int main(int argc, char* argv[])
{
	int n,i,xuefen[10],chengji[10],sum1=0;
    scanf("%d",&n);
	for(i=0;i<n;i++){
	     scanf("%d",&xuefen[i]);
		 sum1=sum1+xuefen[i];
	}
	for(i=0;i<n;i++){
		scanf("%d",&chengji[i]);
	}
	float jidian[10];
	for(i=0;i<n;i++){
	if(chengji[i]<=100&&chengji[i]>=90) jidian[i]=4.0;
	if(chengji[i]<=89&&chengji[i]>=85) jidian[i]=3.7;
	if(chengji[i]<=84&&chengji[i]>=82) jidian[i]=3.3;
	if(chengji[i]<=81&&chengji[i]>=78) jidian[i]=3.0;
    if(chengji[i]<=77&&chengji[i]>=75) jidian[i]=2.7;
    if(chengji[i]<=74&&chengji[i]>=72) jidian[i]=2.3;
	if(chengji[i]<=71&&chengji[i]>=68) jidian[i]=2.0;
    if(chengji[i]<=67&&chengji[i]>=64) jidian[i]=1.5;
    if(chengji[i]<=63&&chengji[i]>=60) jidian[i]=1.0;
    if(chengji[i]<=59) jidian[i]=0;
	}
	float xuefenjidian[10],sum2=0;
	int j;
	for(j=0;j<i;j++){
		xuefenjidian[j]=jidian[j]*xuefen[j];
		sum2=sum2+xuefenjidian[j];
	}
	float GPA;
	GPA=sum2/sum1;
	printf("%.2f",GPA);
     return 0;
}


int main(int argc, char* argv[])
{int n,score[10],i,grade[10],zongfen=0;
double zong=0,jidian[10];
scanf("%d\n",&n);
for(i=0;i<n-1;i++)
scanf("%d ",&grade[i]);
scanf("%d\n",&grade[n-1]);
for(i=0;i<n-1;i++)
scanf("%d ",&score[i]);
scanf("%d",&score[n-1]);
for(i=0;i<n;i++){
	if(90<=score[i]&&score[i]<=100)
		jidian[i]=4.0*grade[i];
	else if(85<=score[i]&&score[i]<=89)
        jidian[i]=3.7*grade[i];
	else if(82<=score[i]&&score[i]<=84)
		jidian[i]=3.3*grade[i];
	else if(78<=score[i]&&score[i]<=81)
		jidian[i]=3.0*grade[i];
	else if(75<=score[i]&&score[i]<=77)
		jidian[i]=2.7*grade[i];
	else if(72<=score[i]&&score[i]<=74)
		jidian[i]=2.3*grade[i];
	else if(68<=score[i]&&score[i]<=71)
		jidian[i]=2.0*grade[i];
	else if(64<=score[i]&&score[i]<=67)
		jidian[i]=1.5*grade[i];
	else if(60<=score[i]&&score[i]<=63)
		jidian[i]=1.0*grade[i];
	else if(score[i]<60)
		jidian[i]=0*grade[i];
	zong+=jidian[i];
	zongfen+=grade[i];
}
double GPA=zong/zongfen;
printf("%.2lf\n",GPA);

	return 0;
}


int main()
{
	int n;
	scanf("%d",&n);
	int xuefen[10];
	int sum1=0;
	float defen[10];
	float jidian[10];
	float xueji[10];
	float gpa;
	int i,j;
	for(i=0;i<n;i++)
	{
		scanf("%d",&xuefen[i]);
		sum1+=xuefen[i];
	}
	for(j=0;j<n;j++)
	{
		scanf("%f",&defen[j]);
		if(defen[j]>=90)
			jidian[j]=4.0;
		else if(defen[j]>=85&&defen[j]<=89)
			jidian[j]=3.7;
        else if(defen[j]>=82&&defen[j]<=84)
			jidian[j]=3.3;
        else if(defen[j]>=78&&defen[j]<=81)
			jidian[j]=3.0;
        else if(defen[j]>=75&&defen[j]<=77)
			jidian[j]=2.7;
        else if(defen[j]>=72&&defen[j]<=74)
			jidian[j]=2.3;
        else if(defen[j]>=68&&defen[j]<=71)
			jidian[j]=2.0;
        else if(defen[j]>=64&&defen[j]<=67)
			jidian[j]=1.5;
        else if(defen[j]>=60&&defen[j]<=63)
			jidian[j]=1.0;
        else
			jidian[j]=0;
	}
	int k;
	float sum2;
	for(k=0;k<n;k++)
	{
		xueji[k]=jidian[k]*xuefen[k];
		sum2+=xueji[k];
	}
	gpa=sum2/(float)sum1;
	printf("%.2f",gpa);
	return 0;
}


void main()
{
	int n;
	int xf[10],score[10],a;
	float jd[10],sjd[10],sum,GPA;
	int i,j;
	sum=0.0;
	a=0;

	scanf("%d",&n);
	for(i=0;i<n;i++)
		scanf("%d",&xf[i]);
	for(i=0;i<n;i++)
		scanf("%d",&score[i]);
	for(j=0;j<n;j++)
	{
		if(score[j]>=90)
			jd[j]=4.0;
		else if(score[j]>=85)
			jd[j]=3.7;
		else if(score[j]>=82)
			jd[j]=3.3;
		else if(score[j]>=78)
			jd[j]=3.0;
		else if(score[j]>=75)
			jd[j]=2.7;
		else if(score[j]>=72)
			jd[j]=2.3;
		else if(score[j]>=68)
			jd[j]=2.0;
		else if(score[j]>=64)
			jd[j]=1.5;
		else if(score[j]>=60)
			jd[j]=1.0;
		else jd[j]=0;
	}
	for(j=0;j<n;j++)
	{
		sjd[j]=jd[j]*xf[j];
		sum=sum+sjd[j];
		a=a+xf[j];
	}
	GPA=sum/a;
	printf("%.2f",GPA);
}


int main(int argc, char *argv[])
{
  int n,i;
  float gpa,sum=0,all=0,final;
  int point[20],mark[20];
  scanf("%d",&n);
  for(i=1;i<=n;i++)
  {
    scanf("%d",&point[i]);
  }
  for(i=1;i<=n;i++) scanf("%d",&mark[i]);
  for(i=1;i<=n;i++)
  {
    if(mark[i]>=90) gpa=4.0;
    else if(mark[i]>=85) gpa=3.7;
    else if(mark[i]>=82) gpa=3.3;
    else if(mark[i]>=78) gpa=3.0;
    else if(mark[i]>=75) gpa=2.7;
    else if(mark[i]>=72) gpa=2.3;
    else if(mark[i]>=68) gpa=2.0;
    else if(mark[i]>=64) gpa=1.5;
    else if(mark[i]>=60) gpa=1.0;
    else gpa=0;
    all=all+point[i]*gpa;
    sum+=point[i];
  }
  final=all/sum;
  printf("%.2f",final);
  return 0;
}


int main()
{
	int n,i,j,k,GPA,point[11],grade[11],pointsum=0;
	float gpa[11],gradesum=0.0;
	scanf("%d\n",&n);
	for(i=1;i<=n;i++)
		scanf("%d",&point[i]);

	for(j=1;j<=n;j++)
		scanf("%d",&grade[j]);
	for(k=1;k<=n;k++)
	{

			if(grade[k]<=100&&grade[k]>=90) gpa[k]=4.0;
			else if(grade[k]<=89&&grade[k]>=85) gpa[k]=3.7;
			else if(grade[k]<=84&&grade[k]>=82) gpa[k]=3.3;
			else if(grade[k]<=81&&grade[k]>=78) gpa[k]=3.0;
			else if(grade[k]<=77&&grade[k]>=75) gpa[k]=2.7;
			else if(grade[k]<=74&&grade[k]>=72) gpa[k]=2.3;
			else if(grade[k]<=71&&grade[k]>=68) gpa[k]=2.0;
			else if(grade[k]<=67&&grade[k]>=64) gpa[k]=1.5;
			else if(grade[k]<=63&&grade[k]>=60) gpa[k]=1.0;
			else if(grade[k]<=59&&grade[k]>=0)  gpa[k]=0.0;
			else printf("your input is wrong");
		gradesum+=gpa[k]*point[k];
		pointsum+=point[k];

	}

	printf("%.2f",gradesum/pointsum);
	return 0;
}


int main()
{
	int n;
	float grade=0,point[10];
	cin>>n;
	int j;
	for(j=0;j<n;j++)
	{
		cin>>point[j];
	}
	int i;

	int entry,total=0;
	float sum=0;
	for(i=0;i<n;i++)
	{
		cin>>entry;
		if(entry>=90)
		grade=4.0;
		else if(entry>=85)
		grade=3.7;
		else if(entry>=82)
		grade=3.3;
		else if(entry>=78)
		grade=3.0;
		else if(entry>=75)
		grade=2.7;
		else if(entry>=72)
		grade=2.3;
		else if(entry>=68)
		grade=2.0;
		else if(entry>=64)
		grade=1.5;
		else if(entry>=60)
		grade=1.0;
		else
		grade=0;
		sum+=grade*point[i];
		total+=point[i];
	}
	float average=sum/total;
	cout<<fixed<<setprecision(2)<<average<<endl;
	return 0;
}


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


int main ()
{
	int n;
	int sumxuefen = 0;
	int i;
	float sumjidian = 0;
	float sumxuefenjidian = 0;
	float GPA;
	int xuefen[10];
	int scores[10];
	float jidian[10];
	float xuefenjidian[10];
	scanf("%d", &n);
	for(i=0;i<n;i++){
		scanf("%d", &xuefen[i]);
		sumxuefen = sumxuefen + xuefen[i];
	}
	for(i=0;i<n;i++){
		scanf("%d",&scores[i]);
		if(scores[i]==100||scores[i]==99||scores[i]==98||scores[i]==97||scores[i]==96||scores[i]==95||scores[i]==94||scores[i]==93||scores[i]==92||scores[i]==91||scores[i]==90){
			jidian[i] = 4.0;
		}
		else if(scores[i]==89||scores[i]==88||scores[i]==87||scores[i]==86||scores[i]==85){
			jidian[i] = 3.7;
		}
		else if(scores[i]==84||scores[i]==83||scores[i]==82){
			jidian[i] = 3.3;
		}
		else if(scores[i]==81||scores[i]==80||scores[i]==79||scores[i]==78){
			jidian[i] = 3.0;
		}
		else if(scores[i]==77||scores[i]==76||scores[i]==75){
			jidian[i] = 2.7;
		}
		else if(scores[i]==74||scores[i]==73||scores[i]==72){
			jidian[i] = 2.3;
		}
		else if(scores[i]==71||scores[i]==70||scores[i]==69||scores[i]==68){
			jidian[i] = 2.0;
		}
		else if(scores[i]==67||scores[i]==77||scores[i]==65||scores[i]==64){
			jidian[i] = 1.5;
		}
		else if(scores[i]==63||scores[i]==62||scores[i]==61||scores[i]==60){
			jidian[i] = 2.0;
		}
		else {
			jidian[i] = 0;
		}
			sumjidian = sumjidian + jidian[i];
	}
	for(i=0;i<n;i++){
	    xuefenjidian[i] = jidian[i] * xuefen[i];
	}
  for(i=0;i<n;i++){
	  sumxuefenjidian = sumxuefenjidian + xuefenjidian[i];
  }
		GPA = sumxuefenjidian * 1.00/sumxuefen;
		printf("%.2f", GPA);
		return 0;
	}


int main(){
	int n,i,total=0;
	int score[10],mark[10];
	float gpa;
	float avg=0;
	cin>>n;
	for(i=0;i<n;i++){
		cin>>score[i];
		total+=score[i];
	}
	for(i=0;i<n;i++){
		cin>>mark[i];
		int temp=mark[i];
		if(temp<=100&&temp>=90) gpa=4.0;
		else if(temp<90&&temp>84) gpa=3.7;
		else if(temp<85&&temp>81) gpa=3.3;
		else if(temp<82&&temp>77) gpa=3.0;
		else if(temp<=77&&temp>74) gpa=2.7;
		else if(temp<=74&&temp>71) gpa=2.3;
		else if(temp<=71&&temp>67) gpa=2.0;
		else if(temp<=67&&temp>63) gpa=1.5;
		else if(temp<=63&&temp>59) gpa=1.0;
		else if(temp<60) gpa=0.0;
		avg+=gpa*score[i];
	}
	avg/=total;
	printf("%.2f\n",avg);
	//cout<<avg<<endl;
	return 0;
}


/*;
 * src.c
 *
 *  Created on: 2009-11-9
 *      Author: JacksonTB
 */

float calc_gpa(int a);
main()
{
	int gpa_all[10], score[10], gpa_sum = 0;
	float gpa0[10], gpa = 0;

	int n, i;

	scanf("%d", &n);

	for(i = 0;i <= n - 1;i ++)
	{
		scanf("%d", &gpa_all[i]);
		gpa_sum += gpa_all[i];
	}
	for(i = 0;i <= n - 1;i ++)
	{
		scanf("%d", &score[i]);
	}

	for(i = 0;i <= n - 1;i ++)
	{
		gpa += gpa_all[i] * calc_gpa(score[i]);
	}
	gpa /= (float)gpa_sum;
	printf("%.2f", gpa);
}

float calc_gpa(int a)
{
		switch(a)
		{
		case 100:
		case 99:
		case 98:
		case 97:
		case 96:
		case 95:
		case 94:
		case 93:
		case 92:
		case 91:
		case 90:
		{
			return 4.0;
		}
		case 89:
		case 88:
		case 87:
		case 86:
		case 85:
			return 3.7;
		case 84:
		case 83:
		case 82:
			return 3.3;
		case 81:
		case 80:
		case 79:
		case 78:
			return 3;
		case 77:
		case 76:
		case 75:
			return 2.7;
		case 74:
		case 73:
		case 72:
			return 2.3;
		case 71:
		case 70:
		case 69:
		case 68:
			return 2;
		case 67:
		case 66:
		case 65:
		case 64:
			return 1.5;
		case 63:
		case 62:
		case 61:
		case 60:
			return 1;
		default:
			return 0;

	}
}


int main(int argc, char* argv[])
{
	int n, xueke[10], fenshu[10], xuekezong=0;
	double zong = 0.0, j;
	scanf("%d\n", &n);
	int i=0;
	while(i<n){
		if(i == (n-1)){
			scanf("%d\n", &xueke[i]);}
		else{
		scanf("%d", &xueke[i]);}
		xuekezong += xueke[i];
		i++;
	}
	i=0;
	while(i<n){
		if(i == (n-1)){
			scanf("%d\n", &fenshu[i]);}
		else{
		scanf("%d\n", &fenshu[i]);}
		if(90<=fenshu[i]){
			zong += xueke[i]*4.0;}
		else{
			if(85<=fenshu[i]){
				zong += xueke[i]*3.7;}
			else{
				if(82<=fenshu[i]){
					zong += xueke[i]*3.3;}
				else{
					if(78<=fenshu[i]){
						zong += xueke[i]*3.0;}
					else{
						if(75<=fenshu[i]){
							zong += xueke[i]*2.7;}
						else{
							if(72<=fenshu[i]){
								zong += xueke[i]*2.3;}
							else{
								if(68<=fenshu[i]){
									zong += xueke[i]*2.0;}
								else{
									if(64<=fenshu[i]){
										zong += xueke[i]*1.5;}
									else{
										if(60<=fenshu[i]){
											zong += xueke[i]*1.0;}}
									}
								}
							}
						}
					}
				}
		}
		i++;
		}
	j = zong / xuekezong;
	printf("%.2lf\n", j);
	return 0;
}


float kej(int fen);

void main()
{
      int i,n,xfen=0,xf[20],f[20];
	  float xj[20],zj=0;
	  scanf("%d",&n);
	  for(i=0;i<n;i++)
		  scanf("%d",&xf[i]);
	  for(i=0;i<n;i++)
		  scanf("%d",&f[i]);

	  for(i=0;i<n;i++)
		  xfen=xfen+xf[i];
	  for(i=0;i<n;i++)
		  zj=zj+kej(f[i])*xf[i];
	  zj=zj/xfen;
	  printf("%.2f",zj);

}

float kej(int fen)
{
	if(fen>=90&&fen<=100)
		return(4.0);
	else if(fen>=85&&fen<=89)
		return(3.7);
	else if(fen>=82&&fen<=84)
		return(3.3);
	else if(fen>=78&&fen<=81)
		return(3.0);
	else if(fen>=75&&fen<=77)
		return(2.7);
	else if(fen>=72&&fen<=74)
		return(2.3);
	else if(fen>=68&&fen<=71)
		return(2.0);
	else if(fen>=64&&fen<=67)
		return(1.5);
	else if(fen>=60&&fen<=63)
		return(1.0);
	else return(0);
}


int main(int argc, char* argv[])
{
	int n,i;
	int ji[30],fen[30];
	float dian[30];
	double xueji,zongping,xuefenhe;

    scanf("%d",&n);
	for (i=0;i<n;i++)
	{
		scanf("%d",&ji[i]);
	}
	for (i=0;i<n;i++)
	{
		scanf("%d",&fen[i]);
	    if (fen[i]>=90&&fen[i]<=100)
		dian[i]=4.0;
        if (fen[i]>=85&&fen[i]<=89)
		dian[i]=3.7;
        if (fen[i]>=82&&fen[i]<=84)
		dian[i]=3.3;
        if (fen[i]>=78&&fen[i]<=81)
		dian[i]=3.0;
        if (fen[i]>=75&&fen[i]<=77)
		dian[i]=2.7;
        if (fen[i]>=72&&fen[i]<=74)
		dian[i]=2.3;
        if (fen[i]>=68&&fen[i]<=71)
		dian[i]=2.0;
        if (fen[i]>=64&&fen[i]<=67)
		dian[i]=1.5;
        if (fen[i]>=60&&fen[i]<=63)
		dian[i]=1.0;
        if (fen[i]<=60)
		dian[i]=0;

	}
	for (xuefenhe=0,xueji=0,i=0;i<n;i++)
	{
		xueji=xueji+dian[i]*ji[i];
		xuefenhe=xuefenhe+ji[i];
	}
	zongping=xueji/xuefenhe;
	printf("%.2f",zongping);

	return 0;
}


void main()
{
	int xuefen[10],defen[10],t=0;
	int i,n,j,k;
	double gpa[10],total=0;
	scanf("%d\n",&n);
	for(i=0;i<n;i++) scanf("%d",&xuefen[i]);
	for(i=0;i<n;i++) scanf("%d",&defen[i]);
	for(i=0;i<n;i++)
	{
		if(defen[i]>89) gpa[i]=4;
		else if(defen[i]>84) gpa[i]=3.7;
		else if(defen[i]>81) gpa[i]=3.3;
		else if(defen[i]>77) gpa[i]=3;
		else if(defen[i]>74) gpa[i]=2.7;
		else if(defen[i]>71) gpa[i]=2.3;
		else if(defen[i]>67) gpa[i]=2;
		else if(defen[i]>63) gpa[i]=1.5;
		else if(defen[i]>59) gpa[i]=1.0;
		else gpa[i]=0;
		total+=gpa[i]*xuefen[i];
		t+=xuefen[i];
	}
	total=total/t;
	printf("%.2f\n",total);
}


float gpoint(int gr){
	if(gr <= 100 && gr >= 90)
		return 4.0;
	else if(gr <= 89 && gr >= 85)
		return 3.7;
	else if(gr <= 84 && gr >= 82)
		return 3.3;
	else if(gr <= 81 && gr >= 78)
		return 3.0;
	else if(gr <= 77 && gr >= 75)
		return 2.7;
	else if(gr <= 74 && gr >= 72)
		return 2.3;
	else if(gr <= 71 && gr >= 68)
		return 2.0;
	else if(gr <= 67 && gr >= 64)
		return 1.5;
	else if(gr <= 63 && gr >= 60)
		return 1.0;
	return 0.0;
}
int main(){
	int n;
	float total_g = 0, total_f = 0;
	int a[11], b[11];
	scanf("%d", &n);
	int i;
	for(i = 1; i <= n; i++){
		scanf("%d", a+i);
		total_f += a[i];
	}
	for(i = 1; i <= n; i++){
		scanf("%d", b+i);
		total_g += gpoint(b[i])*((float)a[i]);
	}
	printf("%.2f\n", total_g/total_f);
	return 0;
}


int main()
{
	int n,i;
	float GPA,total=0.0,xuefen[20],score[20],zongfen=0.0;
	scanf("%d",&n);
	for(i=0;i<n;i++)
	{
		scanf("%f",&xuefen[i]);
        zongfen=zongfen+xuefen[i];
	}
	for(i=0;i<n;i++)
	{
		scanf("%f",&score[i]);
	}
	for(i=0;i<n;i++)
	{
		if(score[i]>=90&&score[i]<=100)
		{
			score[i]=4.0;
			continue;
		}
		if(score[i]>=85&&score[i]<=89)
		{
			score[i]=(float)3.7;
			continue;
		}
		if(score[i]>=82&&score[i]<=84)
		{
			score[i]=(float)3.3;
			continue;
		}
		if(score[i]>=78&&score[i]<=81)
		{
			score[i]=3.0;
			continue;
		}
		if(score[i]>=75&&score[i]<=77)
		{
			score[i]=(float)2.7;
			continue;
		}
		if(score[i]>=72&&score[i]<=74)
		{
			score[i]=(float)2.3;
			continue;
		}
		if(score[i]>=68&&score[i]<=71)
		{
			score[i]=2.0;
			continue;
		}
		if(score[i]>=64&&score[i]<=67)
		{
			score[i]=1.5;
			continue;
		}
		if(score[i]>=60&&score[i]<=63)
		{
			score[i]=1.0;
			continue;
		}
		if(score[i]<60)
		{
			score[i]=0.0;
			continue;
		}
	}
	for(i=0;i<n;i++)
	{
		total=score[i]*xuefen[i]+total;
	}
	GPA=total/zongfen;
	printf("%.2f\n",GPA);
	return 0;
}


int main()
{
	int a,sum=0,i,j,k,m;
	double SUM;
	scanf("%d",&a);
	int credit[ECO];
	int point[ECO];
	double gpa[ECO];
	for(i=0;i<a;i++)
	{
		scanf("%d",&(credit[i]));
		sum=sum+credit[i];

	}
	for(j=0;j<a;j++)
	{
		scanf("%d",&(point[j]));
	}
	for(k=0;k<a;k++)
	{
		if(point[k]>=90)
			gpa[k]=4.0*credit[k];
		else if(point[k]>=85)
			gpa[k]=3.7*credit[k];
		else if(point[k]>=82)
			gpa[k]=3.3*credit[k];
		else if(point[k]>=78)
			gpa[k]=3.0*credit[k];
		else if(point[k]>=75)
			gpa[k]=2.7*credit[k];
		else if(point[k]>=72)
			gpa[k]=2.3*credit[k];
		else if(point[k]>=68)
			gpa[k]=2.0*credit[k];
		else if(point[k]>=64)
			gpa[k]=1.5*credit[k];
		else if(point[k]>=60)
			gpa[k]=1.0*credit[k];
		else
			gpa[k]=0*credit[k];
	}
	for(m=0,SUM=0;m<a;m++)
	{
		SUM=SUM+gpa[m];
	}
	printf("%.2lf",1.0*SUM/sum);
	return 0;
}


int main()
{
	int n,i;
	scanf("%d",&n);
	float course[10],jidian[10],sum=0,ave=0;
	int mark[10];
	for(i=1;i<=n;i++)
	{
		scanf("%f",&course[i]);

	}

	for(i=1;i<=n;i++)
	{
		sum+=course[i];
	}
	for(i=1;i<=n;i++)
	{
		scanf("%d",&mark[i]);
	}
	for(i=1;i<=n;i++)
	{

		if(mark[i]>=90&&mark[i]<=100)
			jidian[i]=4.0;
		else if(mark[i]>=85&&mark[i]<=89)
			jidian[i]=3.7;
	    else if(mark[i]>=82&&mark[i]<=84)
			jidian[i]=3.3;
		else if(mark[i]>=78&&mark[i]<=81)
			jidian[i]=3.0;
		else if(mark[i]>=75&&mark[i]<=77)
			jidian[i]=2.7;
		else if(mark[i]>=72&&mark[i]<=74)
			jidian[i]=2.3;
		else if(mark[i]>=68&&mark[i]<=71)
			jidian[i]=2.0;
		else if(mark[i]>=64&&mark[i]<=67)
			jidian[i]=1.5;
		else if(mark[i]>=60&&mark[i]<=63)
			jidian[i]=1.0;
		else
			jidian[i]=0;

	}

	for(i=1;i<=n;i++)
	{
		ave+=course[i]*jidian[i]/sum;
	}
	printf("%.2f",ave);
	return 0;

}


float GPA(int n)
{
	int i;
	float result;
	float gpa[10];
	float gpa_1[10];
	float sumxf=0;
	float sumcj=0;
	int chengji[10],xuefen[10];
	for(i=0;i<n;i++)
		scanf("%d",&xuefen[i]);
	for(i=0;i<n;i++)
		scanf("%d",&chengji[i]);
	for(i=0;i<n;i++)
	{
		if(90<=chengji[i]&&chengji[i]<=100)gpa[i]=4.0;
		else if(85<=chengji[i]&&chengji[i]<=89)gpa[i]=3.7;
		else if(82<=chengji[i]&&chengji[i]<=84)gpa[i]=3.3;
		else if(78<=chengji[i]&&chengji[i]<=81)gpa[i]=3.0;
		else if(75<=chengji[i]&&chengji[i]<=77)gpa[i]=2.7;
		else if(72<=chengji[i]&&chengji[i]<=74)gpa[i]=2.3;
		else if(68<=chengji[i]&&chengji[i]<=71)gpa[i]=2.0;
		else if(64<=chengji[i]&&chengji[i]<=67)gpa[i]=1.5;
		else if(60<=chengji[i]&&chengji[i]<=63)gpa[i]=1.0;
		else gpa[i]=0;
	}
	for(i=0;i<n;i++)
	{
	gpa_1[i]=gpa[i]*xuefen[i];
	sumcj+=gpa_1[i];
	sumxf+=xuefen[i];
	}
	result=sumcj/sumxf;
	return result;
}
void main()
{
	int n;
	float gpa;
	scanf("%d",&n);
	gpa=GPA(n);
	printf("%.2f",gpa);
}


int main()
{
    int n;
    double score[20];
    double mark[20];
    double ret=0.0;
    double sum1=0.0,sum2=0.0;

    scanf("%d",&n);
    for(int i=0;i<n;i++)
    {
        scanf("%lf",&score[i]);
        sum1+=score[i];
    }
    for(int i=0;i<n;i++)
    {
        scanf("%lf",&mark[i]);
        if(mark[i]>=90) {mark[i]=4.0;continue;}
        if(mark[i]>=85) {mark[i]=3.7;continue;}
        if(mark[i]>=82) {mark[i]=3.3;continue;}
        if(mark[i]>=78) {mark[i]=3.0;continue;}
        if(mark[i]>=75) {mark[i]=2.7;continue;}
        if(mark[i]>=72) {mark[i]=2.3;continue;}
        if(mark[i]>=68) {mark[i]=2.0;continue;}
        if(mark[i]>=64) {mark[i]=1.5;continue;}
        if(mark[i]>=60) {mark[i]=1.0;continue;}
        if(mark[i]<60) {mark[i]=0.0;continue;}
    }
    for(int i=0;i<n;i++)
    {
        sum2+=mark[i]*score[i];
    }
    ret=sum2/sum1;
    printf("%.2lf",ret);

    return 0;
}


int main(){
    int n,i;
    scanf("%d",&n);
    int point[n],score[n];
    double grade[n],gpa[n];
    double average,total,sum;
    total=0;
    sum=0;
    for(i=1;i<=n;i++){
        scanf("%d",&point[i]);
    }
    for(i=1;i<=n;i++){
        scanf("%d",&score[i]);

    }
    for(i=1;i<=n;i++){
        if(score[i]>=90){
            grade[i]=4.0;
        }else if(score[i]>=85){
            grade[i]=3.7;
        }else if(score[i]>=82){
            grade[i]=3.3;
        }else if(score[i]>=78){
            grade[i]=3.0;
        }else if(score[i]>=75){
            grade[i]=2.7;
        }else if(score[i]>=72){
            grade[i]=2.3;
        }else if(score[i]>=68){
            grade[i]=2.0;
        }else if(score[i]>=64){
            grade[i]=1.5;
        }else if(score[i]>=60){
            grade[i]=1.0;
        }else{
            grade[i]=0;
        }
        gpa[i]=grade[i]*point[i];
    }
    for(i=1;i<=n;i++){
        total+=gpa[i];
        sum+=point[i];
    }
    average=total/sum;
    printf("%.2lf",average);
    return 0;
}


double b[10];
double Input(double a[],double n)
{
    int i=0;
	for(i=0;i<n;i++)
		scanf("%lf",&a[i]);
	return a[10];
}
double Sum(double a[],double n,double sum)
{
	int i=0;
	for(i=0;i<n;i++)
		sum=sum+a[i];
	//printf("%lf",sum);
	return sum;
}
double GPAI(double a[],double n)
{
	int i=0;
	for(i=0;i<n;i++)
	{
		if(a[i]>=90&&a[i]<=100)
			a[i]=4;
		else if(a[i]>=85&&a[i]<=89)
			a[i]=3.7;
		else if(a[i]>=82&&a[i]<=84)
			a[i]=3.3;
		else if(a[i]>=78&&a[i]<=81)
			a[i]=3.0;
		else if(a[i]>=75&&a[i]<=77)
			a[i]=2.7;
		else if(a[i]>=72&&a[i]<=74)
			a[i]=2.3;
		else if(a[i]>=68&&a[i]<=71)
			a[i]=2.0;
		else if(a[i]>=64&&a[i]<=67)
			a[i]=1.5;
		else if(a[i]>=60&&a[i]<=63)
			a[i]=1.0;
		else
			a[i]=0;
	}
	return a[10];
}
double GPAII(double a[],double b[],double n)
{
	int i=0;
	for(i=0;i<n;i++)
	{
		a[i]=a[i]*b[i];
	}
	return a[10];
}
void check(double a[10],double n)
{
	int i=0;
	for(i=0;i<n;i++)
		printf("%lf  ",a[i]);
}
int main()
{
	double n;
	scanf("%lf",&n);
	double x[10];
	double y[10];
	Input(x,n);
	Input(y,n);
	GPAI(y,n);
	GPAII(y,x,n);
	double p,q;
	double gpa;
	p=0;
	q=0;
	gpa=0;
	p=Sum(x,n,p);
	q=Sum(y,n,q);
	gpa=1.0*q/p;
	printf("%.2lf",gpa);
	return 0;
}


float ji(int a)
{
	if(a>=90&&a<=100)
	return 4.0;
	else if(a>=85&&a<=89)
	return 3.7;
	else if(a>=82&&a<=84)
	return 3.3;
	else if(a>=78&&a<=81)
	return 3.0;
	else if(a>=75&&a<=77)
	return 2.7;
	else if(a>=72&&a<=74)
	return 2.3;
	else if(a>=68&&a<=71)
	return 2.0;
	else if(a>=64&&a<=67)
	return 1.5;
	else if(a>=60&&a<=63)
	return 1.0;
	else return 0.0;
}
int main()
{
	int n,defen[N],xuefen[N],sum=0,i;
	float jidian[N],GPA=0;//?????????????GPA
	scanf("%d",&n);
	for(i=0;i<n;i++)
	{
		scanf("%d",&xuefen[i]);
	    sum+=xuefen[i];
	}
	for(i=0;i<n;i++)
	{
			scanf("%d",&defen[i]);
			jidian[i]=ji(defen[i]);
			GPA=GPA+jidian[i]*xuefen[i];
	}
    GPA=GPA/sum;
    printf("%.2f",GPA);
	return 0;
}


int main()
{
  int n,a;
  cin>>n;
  int q[n],score[n];
float gpa[n];
float avr,sum=0,psum=0;
  for (int i=0;i<n;i++)
  {
   cin>>q[i];
   }
   for (int i=0;i<n;i++)
   {
    cin>>score[i];
    }
  for (int i=0;i<n;i++)
{
a=score[i];
if(a>=90)
gpa[i]=4.0*q[i];
else if (a>=85)
gpa[i]=3.7*q[i];
else if (a>=82)
gpa[i]=3.3*q[i];
else if (a>=78)
gpa[i]=3.0*q[i];
else if (a>=75)
gpa[i]=2.7*q[i];
else if (a>=72)
gpa[i]=2.3*q[i];
else if (a>=68)
gpa[i]=2.0*q[i];
else if (a>=64)
gpa[i]=1.5*q[i];
else if (a>=60)
gpa[i]=1.0*q[i];
else
gpa[i]=0;
}
for (int i=0;i<n;i++)
{
sum+=gpa[i];
psum+=q[i];
}
avr=sum/psum;
printf("%.2f",avr);
}


int main()
{
int n,i,a;
double GPA,num;
double score [10];
int point [10];
scanf("%d",&n);
i=0;
while(i<n){
	scanf("%d",&point [i]);
	i++;
}
i=0;
while(i<n){
	scanf("%lf",&score [i]);
	i++;
}
i=0;
while(i<n){
	if(score [i]>=90){
		score [i]=4.0;
	}else if(score [i]<90&&score [i]>=85){
		score [i]=3.7;
	}else if(score [i]<85&&score [i]>=82){
		score [i]=3.3;
	}else if(score [i]<82&&score [i]>=78){
		score [i]=3.0;
	}else if(score [i]<78&&score [i]>=75){
		score [i]=2.7;
	}else if(score [i]<75&&score [i]>=72){
		score [i]=2.3;
	}else if(score [i]<72&&score [i]>=68){
		score [i]=2.0;
	}else if(score [i]<68&&score [i]>=64){
		score [i]=1.5;
	}else if(score [i]<64&&score [i]>=60){
		score [i]=1.0;
	}else{
		score [i]=0;
	}
	i++;
}
i=0;
num=0;
while(i<n){
	num=(score [i])*(point [i])+num;
	i++;
}
i=0;
a=0;
while(i<n){
	a=(point [i])+a;
	i++;
}
GPA=num/a;
printf("%.2lf\n",GPA);
return 0;
}


double gc(int m);
int main(){
    int n,s,i;
    s=0;
    scanf("%d",&n);
    double gpa=0;
    int a[n],b[n];
    for(i=0;i<=n-1;i++)
    {
                       scanf("%d",&a[i]);
                       s+=a[i];
    }
    for(i=0;i<=n-1;i++)
    {
                       scanf("%d",&b[i]);
                       gpa+=gc(b[i])*a[i];
    }
    gpa=gpa/s;
    printf("%.2lf",gpa);

    return 0;
}
double gc(int m)
{
       int v=1;
       int x=60;
       while(x<101)
       {
             if(x<=m)v++;else break;
             if((x<=68)||(x==78)) x+=4;
               else
               {if((x<78)||(x==82))x+=3;
                    else
                    {if(x==85)x+=5; else
                       {if(x==90)x=100;
                        else x=101;}
                    }
               }

       }

       switch(v)
       {
              case 1: return 0;
              case 2:return 1.0;break;
              case 3:return 1.5;break;
              case 4:return 2.0;break;
              case 5:return 2.3;break;
              case 6:return 2.7;break;
              case 7:return 3.0;break;
              case 8:return 3.3;break;
              case 9:return 3.7;break;
              case 10:return 4.0;break;
       }
}


int main(){
 struct course{
  float xf;
  float df;
 }course[N];
 float course_jd[N],jd,zxf;
 int n,i;
 scanf("%d\n",&n);
 for(i=0;i<n-1;i++){
  scanf("%f",&(course[i].xf));
 }scanf("%f\n",&(course[n-1].xf));
 for(i=0;i<n;i++){
  scanf("%f",&(course[i].df));
 }
 jd=0;
 for(i=0;i<n;i++){
  if ((course[i].df>=90)&&(course[i].df<=100))
	  course_jd[i]=4.0*course[i].xf;
  if ((course[i].df>=85)&&(course[i].df<=89))
	  course_jd[i]=3.7*course[i].xf;
  if ((course[i].df>=82)&&(course[i].df<=84))
	  course_jd[i]=3.3*course[i].xf;
  if ((course[i].df>=78)&&(course[i].df<=81))
	  course_jd[i]=3.0*course[i].xf;
  if ((course[i].df>=75)&&(course[i].df<=77))
	  course_jd[i]=2.7*course[i].xf;
  if ((course[i].df>=72)&&(course[i].df<=74))
	  course_jd[i]=2.3*course[i].xf;
  if ((course[i].df>=68)&&(course[i].df<=71))
	  course_jd[i]=2.0*course[i].xf;
  if ((course[i].df>=64)&&(course[i].df<=67))
	  course_jd[i]=1.5*course[i].xf;
  if ((course[i].df>=60)&&(course[i].df<=63))
	  course_jd[i]=1.0*course[i].xf;
  if ((course[i].df<=59))
	  course_jd[i]=0*course[i].xf;
  jd=jd+course_jd[i];
 }zxf=0;
 for(i=0;i<n;i++){
  zxf+=course[i].xf;
 }
  printf("%.2f",jd/zxf);
  return 0;
}


float jd(int kccj){
	float kcjd;
	if(kccj>=90){
		kcjd=4;
	}else{
		if(85<=kccj&&kccj<=89){
			kcjd=3.7;
		}else{
			if(82<=kccj&&kccj<=84){
				kcjd=3.3;
			}else{
				if(kccj>=78&&kccj<=81){
					kcjd=3.0;
				}else{
					if(kccj>=75&&kccj<=77){
						kcjd=2.7;
					}else{
						if(kccj>=72&&kccj<=74){
							kcjd=2.3;
						}else{
							if(kccj<=71&&kccj>=68){
								kcjd=2.0;
							}else{
								if(kccj<=67&&kccj>=64){
									kcjd=1.5;
								}else{
									if(kccj<=63&&kccj>=60){
										kcjd=1.0;
									}else{
										kcjd=0;
									}
								}
							}
						}
					}
				}
			}
		}
	}

return kcjd;
	}

int main(){
	int n;

	int xf[10];
	int i;
		scanf("%d",&n);
	for(i=0;i<n;i++){
		scanf("%d",&xf[i]);
	}
	int cj[10];
	for(i=0;i<n;i++){
		scanf("%d",&cj[i]);
	}
	int sum_xf=0;
	for(i=0;i<n;i++){
		sum_xf+=xf[i];
	}
	float xfjd[10];
	for(i=0;i<n;i++){
		xfjd[i]=xf[i]*jd(cj[i]);
	}
	float sum_xfjd=0;
	for(i=0;i<n;i++){
		sum_xfjd+=xfjd[i];
	}
	float gpa;
	gpa=sum_xfjd/sum_xf;
	printf("%.2f",gpa);

	return 0;
}


int main(){
int sz[10];
int score[10];
double jidian[10],sumxuefen,sumjidian;
int n,xuefen,s;

scanf("%d",&n);
for(xuefen=0;xuefen<n;xuefen++){
    scanf("%d",&sz[xuefen]);
    sumxuefen+=sz[xuefen];
}
for(s=0;s<n;s++){
    scanf("%d",&score[s]);

}
for(s=0;s<n;s++){
    if((90<=score[s])&&(score[s]<=100)){
        jidian[s]=4.0;
	}else if((85<=score[s])&&(score[s]<=89)){
        jidian[s]=3.7;
	}else if((82<=score[s])&&(score[s]<=84)){
        jidian[s]=3.3;
	}else if((78<=score[s])&&(score[s]<=81)){
        jidian[s]=3.0;
	}else if((75<=score[s])&&(score[s]<=77)){
        jidian[s]=2.7;
	}else if((72<=score[s])&&(score[s]<=74)){
        jidian[s]=2.3;
	}else if((68<=score[s])&&(score[s]<=71)){
        jidian[s]=2.0;
	}else if((64<=score[s])&&(score[s]<=67)){
        jidian[s]=1.5;
	}else if((60<=score[s])&&(score[s]<=63)){
        jidian[s]=1.0;
	}else if(score[s]<60){
        jidian[s]=0;
	}
    sumjidian+=jidian[s]*sz[s];
}
double GPA;
GPA=sumjidian/sumxuefen;
printf("%.2lf",GPA);

return 0;
}


int main()
{
int i,n,s,k,a[11];
float sum=0;
scanf("%d",&n);
for(i=1;i<=n;i++)
{
scanf("%d",&a[i]);
}
for(i=1;i<=n;i++)
{
scanf("%d",&k);
switch(k)
{
case 90:
case 91:
case 92:
case 93:
case 94:
case 95:
case 96:
case 97:
case 98:
case 99:
case 100:
{
sum+=a[i]*4;
break;
}
case 85:
case 86:
case 87:
case 88:
case 89:
{
sum+=a[i]*3.7;
break;
}
case 82:
case 83:
case 84:
{
sum+=a[i]*3.3;
break;
}
case 78:
case 79:
case 80:
case 81:
{
sum+=a[i]*3;
break;
}
case 75:
case 76:
case 77:
{
sum+=a[i]*2.7;
break;
}
case 72:
case 73:
case 74:
{
sum+=a[i]*2.3;
break;
}
case 68:
case 69:
case 70:
case 71:
{
sum+=a[i]*2;
break;
}
case 64:
case 65:
case 66:
case 67:
{
sum+=a[i]*1.5;
break;
}
case 60:
case 61:
case 62:
case 63:
{
sum+=a[i];
break;
}
}
}
s=0;
for(i=1;i<=n;i++)
{
s+=a[i];
}
sum/=s;
printf("%.2f",sum);
return 0;
}


int main()
{
	float*xuefen;
	float*chengji;
	float*GPA;
	float xf,cj,xuefensum=0,GPAsum=0;
	int n,i;
	scanf("%d",&n);
	xuefen=(float*)malloc(sizeof(float)*n);
	chengji=(float*)malloc(sizeof(float)*n);
	GPA=(float*)malloc(sizeof(float)*n);
	for(i=0;i<n;i++)
	{
		scanf("%f",&xf);
		*(xuefen+i)=xf;
	}
	for(i=0;i<n;i++)
	{
		scanf("%f",&cj);
		*(chengji+i)=cj;
	}
    for(i=0;i<n;i++)
	{
		if(*(chengji+i)>=90&&*(chengji+i)<=100)
		{
			*(GPA+i)=4.0;
		}
		else if(*(chengji+i)>=85&&*(chengji+i)<=89)
		{
			*(GPA+i)=3.7;
		}
		else if(*(chengji+i)>=82&&*(chengji+i)<=84)
		{
			*(GPA+i)=3.3;
		}
		else if(*(chengji+i)>=78&&*(chengji+i)<=81)
		{
			*(GPA+i)=3.0;
		}
		else if(*(chengji+i)>=75&&*(chengji+i)<=77)
		{
			*(GPA+i)=2.7;
		}
		else if(*(chengji+i)>=72&&*(chengji+i)<=74)
		{
			*(GPA+i)=2.3;
		}
		else if(*(chengji+i)>=68&&*(chengji+i)<=71)
		{
			*(GPA+i)=2.0;
		}
		else if(*(chengji+i)>=64&&*(chengji+i)<=67)
		{
			*(GPA+i)=1.5;
		}
		else if(*(chengji+i)>=60&&*(chengji+i)<=63)
		{
			*(GPA+i)=1.0;
		}
		else
		{
			*(GPA+i)=0;
		}
	}
	for(i=0;i<n;i++)
	{
		GPAsum+=(*(GPA+i))*(*(xuefen+i));
	}
	for(i=0;i<n;i++)
	{
		xuefensum+=*(xuefen+i);
	}
	printf("%.2f\n",GPAsum/xuefensum);
	return 0;
}


float a[10];
int b[10];
float c[10];
float d[10];
int main()
{
	int n,i,j;
	float GPA,sum,pts;
	GPA=0;
	sum=0;
	pts=0;
	scanf("%d", &n);
	for(j=0;j<n;j++)
	{
		scanf("%f", &a[j]);
		pts+=a[j];
	}
	for(i=0;i<n;i++)
	{
		scanf("%d", &b[i]);
		switch(b[i])
		{
		case 60:
			c[i]=1;
			break;
case 61:
			c[i]=1;
			break;
case 62:
			c[i]=1;
			break;
case 63:
			c[i]=1;
			break;
case 64:
			c[i]=1.5;
			break;
case 65:
			c[i]=1.5;
			break;
case 66:
			c[i]=1.5;
			break;
case 67:
			c[i]=1.5;
			break;
case 68:
			c[i]=2;
			break;
case 69:
			c[i]=2;
			break;
case 70:
			c[i]=2;
			break;
case 71:
			c[i]=2;
			break;
case 72:
			c[i]=2.3;
			break;
case 73:
			c[i]=2.3;
			break;
case 74:
			c[i]=2.3;
			break;
case 75:
			c[i]=2.7;
			break;
case 76:
			c[i]=2.7;
			break;
case 77:
			c[i]=2.7;
			break;
case 78:
			c[i]=3;
			break;
case 79:
			c[i]=3;
			break;
case 80:
			c[i]=3;
			break;
case 81:
			c[i]=3;
			break;
case 82:
			c[i]=3.3;
			break;
case 83:
			c[i]=3.3;
			break;
case 84:
			c[i]=3.3;
			break;
case 85:
			c[i]=3.7;
			break;
case 86:
			c[i]=3.7;
			break;
case 87:
			c[i]=3.7;
			break;
case 88:
			c[i]=3.7;
			break;
case 89:
			c[i]=3.7;
			break;
case 90:
			c[i]=4;
			break;
case 91:
			c[i]=4;
			break;
case 92:
			c[i]=4;
			break;
case 93:
			c[i]=4;
			break;
case 94:
			c[i]=4;
			break;
case 95:
			c[i]=4;
			break;
case 96:
			c[i]=4;
			break;
case 97:
			c[i]=4;
			break;
case 98:
			c[i]=4;
			break;
case 99:
			c[i]=4;
			break;
case 100:
			c[i]=4;
			break;
default:
			c[i]=0;
			break;
		}
		d[i]=c[i]*a[i];
		sum+=d[i];
	}
	GPA=sum/pts;
	printf("%.2f", GPA);
	return 0;
}


int main()
{
	int i,j,n,point[11],score[11];
	float GPA[11],tol=0,sum=0,result;
	scanf("%d",&n);

	for(i=1;i<n+1;i++)
	{
		scanf("%d",&point[i]);

		sum=sum+point[i];
	}
	for(i=1;i<n+1;i++)
	{
		scanf("%d",&score[i]);
        if(score[i]>=90)   GPA[i]=4.0;
		else if(score[i]>=85) GPA[i]=3.7;
		else if(score[i]>=82) GPA[i]=3.3;
		else if(score[i]>=78) GPA[i]=3.0;
		else if(score[i]>=75) GPA[i]=2.7;
		else if(score[i]>=72) GPA[i]=2.3;
		else if(score[i]>=68) GPA[i]=2.0;
		else if(score[i]>=64) GPA[i]=1.5;
		else if(score[i]>=60) GPA[i]=1.0;
		else  GPA[i]=0;
		tol=tol+GPA[i]*point[i];
	}

	result=tol/sum;
	printf("%.2f",result);
	return 0;
}


int main(){
	int i,sumpoint,n;
	scanf("%d\n",&n);
	int grade[N],point[N];
	double GPA,gradepoint[N],sum;
	sumpoint=0;
	sum=0;
	for(i=0;i<n;i++){
		if(i<n-1)
	    scanf("%d",&(point[i]));
		else{scanf("%d\n",&(point[i]));
        }
	}
	for(i=0;i<n;i++){
	    scanf("%d",&(grade[i]));}
	for(i=0;i<n;i++){
		if(grade[i]<=100&&grade[i]>=90)
		   gradepoint[i]=4.0;
		if(grade[i]<=89&&grade[i]>=85)
		   gradepoint[i]=3.7;
		if(grade[i]<=84&&grade[i]>=82)
		   gradepoint[i]=3.3;
		if(grade[i]<=81&&grade[i]>=78)
		   gradepoint[i]=3.0;
		if(grade[i]<=77&&grade[i]>=75)
		   gradepoint[i]=2.7;
		if(grade[i]<=74&&grade[i]>=72)
		   gradepoint[i]=2.3;
		if(grade[i]<=71&&grade[i]>=68)
		   gradepoint[i]=2.0;
		if(grade[i]<=67&&grade[i]>=64)
		   gradepoint[i]=1.5;
		if(grade[i]<=63&&grade[i]>=60)
		   gradepoint[i]=1.0;
	    if(grade[i]<60)
			gradepoint[i]=0;}
	for(i=0;i<n;i++){
	    sumpoint+=point[i];
	    sum+=gradepoint[i]*point[i];}
	GPA=sum/sumpoint;
	printf("%.2lf",GPA);
	return 0;
}


void main(){
int xf[10],n,s,i;
double gpa;
double sumxuefen,sumxuefenjidian;
sumxuefen=0;
sumxuefenjidian=0;
gpa=0;
scanf("%d",&n);
for(i=0;i<n;i++){
scanf("%d",&xf[i]);
sumxuefen+=xf[i];
}
for(i=0;i<n;i++){
scanf("%d",&s);
if(s>=90&&s<=100)sumxuefenjidian+=4*xf[i];
if(s>=85&&s<=89)sumxuefenjidian+=3.7*xf[i];
if(s>=82&&s<=84)sumxuefenjidian+=3.3*xf[i];
if(s>=78&&s<=81)sumxuefenjidian+=3.0*xf[i];
if(s>=75&&s<=77)sumxuefenjidian+=2.7*xf[i];
if(s>=72&&s<=74)sumxuefenjidian+=2.3*xf[i];
if(s>=68&&s<=71)sumxuefenjidian+=2.0*xf[i];
if(s>=64&&s<=67)sumxuefenjidian+=1.5*xf[i];
if(s>=60&&s<=63)sumxuefenjidian+=1.0*xf[i];
if(s<=59)sumxuefenjidian+=0*xf[i];
}
gpa=sumxuefenjidian/sumxuefen;
printf("%.2lf",gpa);
}


float jidian(int x)
{if(x>=90&&x<=100) return 4.0;
else if(x>=85&&x<=89)  return 3.7;
else if(x>=82&&x<=84)  return 3.3;
else if(x>=78&&x<=81)  return 3.0;
else if(x>=75&&x<=77)  return 2.7;
else if(x>=72&&x<=74)  return 2.3;
else if(x>=68&&x<=71)  return 2.0;
else if(x>=64&&x<=67)  return 1.5;
else if(x>=60&&x<=63)  return 1.0;
else return 0;
}
int main()
{
	int i,n,xuefen[10],fenshu[10],sum1=0;
	float sum2=0,GPA;
	scanf("%d",&n);
	for(i=0;i<n;i++)
		scanf("%d",&xuefen[i]);
	for(i=0;i<n;i++)
		scanf("%d",&fenshu[i]);
	for(i=0;i<n;i++)
	{sum1=sum1+xuefen[i];
	 sum2=sum2+((float)xuefen[i])*(jidian(fenshu[i]));}
	GPA=((float)sum2)/sum1;
	printf("%.2f\n",GPA);
	return 0;
}


int main(){
	int n,i,zxuefen;
	float GPA,zxfjd;
	scanf("%d",&n);
    int *xuefen=(int*)malloc(sizeof(xuefen)* n);
	int *chengji=(int*)malloc(sizeof(chengji)* n);
	float *jidian=(float*)malloc(sizeof(jidian)* n);
	float *xfjd=(float*)malloc(sizeof(xfjd)* n);
	for(i=0;i<n;i++){
		scanf("%d",&xuefen[i]);
	}
	for(i=0;i<n;i++){
		scanf("%d",&chengji[i]);
	}
	for(i=0;i<n;i++){
		if(chengji[i]>=90){
			jidian[i]=4.0;
		}else if(chengji[i]>=85){
			jidian[i]=3.7;
		}else if(chengji[i]>=82){
			jidian[i]=3.3;
		}else if(chengji[i]>=78){
			jidian[i]=3.0;
		}else if(chengji[i]>=75){
			jidian[i]=2.7;
		}else if(chengji[i]>=72){
			jidian[i]=2.3;
		}else if(chengji[i]>=68){
			jidian[i]=2.0;
		}else if(chengji[i]>=64){
			jidian[i]=1.5;
		}else if(chengji[i]>=60){
			jidian[i]=1.0;
		}else {
			jidian[i]=0;
		}
		xfjd[i]=jidian[i]*xuefen[i];
	}
	zxuefen=0;
	zxfjd=0;
	for(i=0;i<n;i++){
		zxuefen+=xuefen[i];
	}

	for(i=0;i<n;i++){
		zxfjd+=xfjd[i];
	}

	GPA=zxfjd/zxuefen;
	printf("%.2f",GPA);
	return 0;
}


int main()
{
    int a,b,c;int xuefen[100],fenshu[100];float d;
    scanf("%d",&a);
    for(b=1;b<=a;b++)
    {
        scanf("%d",&xuefen[b-1]);
    }
    for(c=1;c<=a;c++)
    {
        scanf("%d",&fenshu[c-1]);
    }
     int e;float f,g=0;
     for(e=0;e<a;e++)
     {
         if(fenshu[e]<60)f=0;
         else if(fenshu[e]>=60&&fenshu[e]<=63)f=1;
         else if(fenshu[e]>=64&&fenshu[e]<=67)f=1.5;
         else if(fenshu[e]>=68&&fenshu[e]<=71)f=2;
         else if(fenshu[e]>=72&&fenshu[e]<=74)f=2.3;
         else if(fenshu[e]>=75&&fenshu[e]<=77)f=2.7;
         else if(fenshu[e]>=78&&fenshu[e]<=81)f=3;
         else if(fenshu[e]>=82&&fenshu[e]<=84)f=3.3;
         else if(fenshu[e]>=85&&fenshu[e]<=89)f=3.7;
         else if(fenshu[e]>=90&&fenshu[e]<=100)f=4;
         g=g+f*xuefen[e];
     }
     int i;float h;
     for(i=0;i<a;i++)
     {
         h=h+xuefen[i];
     }
     float j;
     j=g/h;
     printf("%.2f",j);
}


int main()
{
	int n,i,a,max=0,max2=0;
	scanf("%d",&n);
	scanf("%d",&a);
	max=a,max2=a;
	for(i=2;i<=n;i++)
	{
		scanf("%d",&a);
		if(a>max)
		{
			max=a;
		}
		else
		{
			if(a>max2)
			{
				max2=a;
			}
		}
	}
	printf("%d\n%d",max,max2);
	return 0;
}


void main()
{
	int sz[100],n,max1,max2,i;
		scanf("%d",&n);
		max1=sz[0];
		max2=sz[1];
		for(i=0;i<n;i++)
		{
			scanf("%d",&sz[i]);
			if(max1<sz[i])
			{
				max2=max1;
				max1=sz[i];
			}
			else if(max1>sz[i]&&max2<sz[i])
			{
				max2=sz[i];
			}
		}
		printf("%d\n%d",max1,max2);
}


int main()
{
	int i,k,n[100],max,max2;
	cin>>k;
	for(i=0;i<k;i++)cin>>n[i];
	i=0;
	max=0;
	max2=0;
	do
	{
		if(n[i]>max)max=n[i];
		i++;
	}while(i<k);
	i=0;
	do
	{
		if(max2<=n[i]&n[i]<=(max-1))max2=n[i];
		i++;
	}while(i<k);
	cout<<max<<endl;
	cout<<max2;

	return 0;
}


int main(){
	int n,i;
	int a,b;
	int c;
	scanf("%d%d%d",&n,&a,&b);
	if(n>=3){
        for(i=3;i<=n;i++){
		   scanf("%d",&c);
		   if(c>=a||c>=b){
			   if(a>=b){
				   b=c;
			   }
			   else{
				   a=c;
			   }
		   }
		   else{
			   continue;
		   }
		}
		if(a>=b){
			printf("%d\n%d",a,b);
		}
		else{
			printf("%d\n%d",b,a);
		}
	}
    else{
		printf("%d\n%d",a,b);
	}
	return 0;
}


int main()
{
	int n;
	scanf("%d",&n);
	int p[100];
	int i;
	for (i=1;i<=n;i++)
	{
		scanf("%d",&p[i]);
	}
	int max,max2;
	max=0;
	max2=0;
	for (i=1;i<=n;i++)
	{
		if (p[i]>max)
		{
			max2=max;
			 max=p[i];
		}
		else if (p[i]>max2)
		{
			max2=p[i];
		}
	}
	printf("%d\n%d\n",max,max2);
	return 0;
}


int main()
{
 int a,max,cmax;
 int i;
 int num[n];
 max=0;
 cmax=0;
 scanf("%d",&a);
 for(i=0;i<a;i++)
 {
 scanf("%d",&num[i]);
 }
 for(i=0;i<a;i++)
 {
 if(num[i]>max)
  {
  max=num[i];
  }
 }
 for(i=0;i<a;i++)
 {
 if(num[i]>cmax && num[i]<max)
  {
  cmax=num[i];
  }
 }

 printf("%d\n%d\n",max,cmax);

return 0;
}


int main()
{
	int i,k,n[100],max,max2;
	cin>>k;
	for(i=0;i<k;i++)cin>>n[i];
	i=0;
	max=0;
	max2=0;
	do
	{
		if(n[i]>max)max=n[i];
		i++;
	}while(i<k);
	i=0;
	do
	{
		if(max2<=n[i]&n[i]<=(max-1))max2=n[i];
		i++;
	}while(i<k);
	cout<<max<<endl;
	cout<<max2<<endl;
	return 0;
}


void main()
{
   int input[100]={0},i=0,j=0,n=0,t=0;
   scanf("%d",&n);
   for(i=0;i<n;i++) scanf("%d",&input[i]);

   for(i=1;i<n;i++)
   {
      if(input[i]<input[i-1])
      {
	 t=input[i];
	 input[i]=input[i-1];
	 input[i-1]=t;
      }
   }
   printf("%d\n",input[n-1]);
   input[j]=0;

   for(i=1;i<n-1;i++)
   {
      if(input[i]<input[i-1])
      {
	 t=input[i];
	 input[i]=input[i-1];
	 input[i-1]=t;
      }
   }
   printf("%d\n",input[n-2]);
}


int main()
{
	int n,a,b,c,max1,max2,place1,place2;
	scanf("%d",&n);
	scanf("%d\n%d",&a,&b);
	if(a>b) place1=1;
	else place1=2;
	switch(place1)
	{case 1: max1=a;
	        max2=b;
			break;
    case 2: max1=b;
		    max2=a;
			break;}
	n=n-2;
    while(n--)
	{
		scanf("%d",&c);
		if(c<=max2) place2=1;
		else if (c<max1) place2=2;
		else place2=3;
		switch(place2)
		{case 1: break;
		case 2: max2=c;
			    break;
		case 3: max2=max1;
			    max1=c;
				break;}

	}
	printf("%d\n%d",max1,max2);
	return 0;

}


int main (){
	int first,second,tmp;
	int n;
	int i=0;
	scanf("%d",&n);

    first=-10000;
	second=-100000;
		do{
			i++;
		scanf("%d",&tmp);
	     if (tmp>first)
		 {second=first;
		 first=tmp;
		 }
		   else if (tmp>second)
		 { second=tmp;
		 }
		}while (i!=n);

printf("%d\n%d",first,second);
return 0;
}


int main()
{
	int max1,max2,n,num;
	int i=1;
	scanf("%d",&n);
	while(i<=n){
		scanf("%d",&num);
		if(i==1){
                   max1=num;
		   }
		if(i==2){
			if(max1>num){
				max1=max1;
				max2=num;
			}else{
				max2=max1;
				max1=num;
			}
		}else{
			    if((max2>num)){
		     	max1=max1;
			    max2=max2;
				}
			    if((max2<=num)&&(max1>=num)){
				max1=max1;
				max2=num;
                                    }
				if(max1<=num){
					max2=max1;
					max1=num;

				}
			}
		i++;
	}
	printf("%d\n",max1);
	printf("%d\n",max2);
return 0;
}


int main()
{
int n,a,b,c,i,m;
scanf("%d\n%d\n%d\n",&n,&a,&b);
i=2;
if(a<b){
	m=a;
	a=b;
	b=m;
}
while(i<n){
	scanf("%d",&c);
    i+=1;
	if(c>=a){
		b=a;
        a=c;
	}else if(c>=b){
		b=c;
	}
}
printf("%d\n%d\n",a,b);
	return 0;
}


int cmp(const void *a1, const void *a2)	{
	int *p1 = (int *)a1;
	int *p2 = (int *)a2;
	return *p2 - *p1;
};

int main()	{

	int n;
	int m[101];
	scanf("%d", &n);
	int i;
	for(i = 0; i < n; ++i)	{
		scanf("%d", &m[i]);
	}
	qsort(m, n, sizeof(m[0]), cmp);
	printf("%d\n%d\n", m[0], m[1]);
	return 0;
};


int main()
{
	int n;
	scanf("%d",&n);
	int sz[100];
	for (int i=0;i<n;i++)
	{
		scanf("%d",&sz[i]);
	}
	int maxIndex, e;
for(int k  =   1  ;   k <=  n; k++){
	maxIndex = 0;
	for(int i = 0; i <= n-k; i++){
			if(sz[i] > sz[maxIndex]){
					maxIndex = i;
			}
	}
	if(maxIndex != n-k){
		e = sz[maxIndex];
		sz[maxIndex] = sz[n-k];
		sz[n-k] =  e;
	}
}
 printf("%d\n",sz[n-1]);
		printf("%d\n",sz[n-2]);
	return 0;
}


int main()
{
	int n = 0;
	int maxNum = 0;
	int secMax = 0;
	int temp = 0;

	scanf("%d", &n);

	for (int i = 0; i < n; i++)
	{
		scanf("%d", &temp);
		if (temp > maxNum)
		{
			secMax = maxNum;
			maxNum = temp;
		}
		else
		{
			if (temp > secMax)
			{
				secMax = temp;
			}
		}
	}

	printf("%d\n%d\n", maxNum, secMax);
}


int main()
{
	int a, b, max1, max2;
	int n, i, temp;
	scanf("%d %d %d", &n, &a, &b);
	if(a>b)
	{
		max1=a;
		max2=b;
	}
	else
	{
		max1=b;
		max2=a;
	}
	for(i=0; i<n-2; i++)
	{
		scanf("%d", &temp);
		if(temp>max1)
		{
			max2=max1;
			max1=temp;
		}
		else if(temp>max2)
		{
			max1=max1;
			max2=temp;
		}
		else
		{
		   max1=max1;
		   max2=max2;
		}
	}
	printf("%d\n%d", max1, max2);
	return 0;
}


int main()
{
	int n;
	scanf("%d",&n);
	int max, lmax;
	int temp;
	int i = 0;
	if (n <= 1 || n >= 100)
	return 0;

	scanf("%d", &temp);
		max = temp;
	scanf("%d", &temp);
	if (temp > max)
	{
		lmax = max;
		max = temp;
	}
	else
		lmax = temp;

	i += 2;

	while (i < n)
	{
		scanf("%d", &temp);
		i++;
		if(temp > max)
		{
			lmax = max;
			max = temp;
		}
		else if (temp > lmax) {
			lmax = temp;
		}
	}
	printf("%d\n", max);
	printf("%d\n", lmax);
	return 0;
}


int main(int argc, char* argv[])
{
	int n;
	scanf("%d",&n);
	int a,b;
	scanf("%d%d",&a,&b);
	int i;
	for(i=0;i<(n-2);i++)
	{
		int k;
		scanf("%d",&k);
		if(k>a)
		{
			b=a;
			a=k;
		}
		else if(k>b)
		{
			b=k;
		}
	}
	printf("%d\n",a);
    printf("%d\n",b);
	return 0;
}


int main(int argc, char* argv[])
{
	int n,a;
	int i=0;
	int x=0;
	int y=0;
	scanf("%d",&n);
	do{
		scanf("%d",&a);
		if (a>x){
			y=x;
			x=a;
		}
		else if(a>y){
			y=a;
		}
		i++;
	}while(i<n);
	printf("%d\n%d\n",x,y);

	return 0;
}


int main()
{
	int a,b,c,i;
	a=0;
	b=0;
	for (i=1;i<100;i++)
	{
	scanf("%d",&c);
	if(c>a)
		b=a,
		a=c;

	else if(c<a&&c>=b)
		b=c;
else if(c=a)
c=a;
	}

printf("%d\n",a);
printf("%d\n",b);
return 0;
}


int main()
{
	int a,b,c,i,n;
	scanf("%d",&n);
	for(i=0;i<n;i++)
	{
		scanf("%d",&c);
		if(i==0)
		{
			a=c;
			b=c;
		}
		else if(i==1)
		{
			if(c>=a)
			{
				a=c;
				b=b;
			}
			else
			{
				a=a;
				b=c;
			}

		}
		else
		{
			if(c>=a)
			{
				b=a;
				a=c;
			}
	    	else if(c<=b)
			{
				a=a;
				b=b;
			}
			else
			{
				a=a;
				b=c;
			}
		}
	}
        printf("%d\n",a);
        printf("%d\n",b);
		return 0;
}


int main()
{
    int a[100];
    int max=0;
    int second=0;
    int i,n;
    scanf("%d\n",&n);
    for(i=1;i<=n;i++)
    {
        scanf("%d\n",&a[i]);
        if(max<a[i])
        {
           second=max;
           max=a[i];
        }
        else if((max>a[i])&&(a[i]>second))
        {
           second=a[i];
           max=max;
        }
    }
    printf("%d\n%d\n",max,second);
    return 0;
}


int main()
{
 int n,b;
 int w=0;
 int q=0;
 int i=1;
 scanf("%d",&n);
 while(i<=n){
	 scanf("%d",&b);
	 if(b>=w){
		 q=w;
		 w=b;
	 }else{
		 if(b<w&&b>=q){
			 w=w;
			 q=b;
		 }
	 }
	 i++;
 }
 printf("%d\n%d\n",w,q);
 return 0;
}


int main(int argc, char* argv[])
{
	long a[101];
	int n=0;
	long i,max,big;

	scanf("%d",&n);
	max=0;
	big=0;
	for (i=1;i<=n;i++)
	{
		scanf("%d",&a[i]);

		if (a[i]>max)
		{
			big=max;

			max=a[i];

		};

	}
	printf("%d\n",max);
	printf("%d",big);

	return 0;
}


int main()
{
	int n,i,j,u,max=0,max2=0;
	scanf("%d",&n);
	int a[n];
	for(i=0;i<=n-1;i++)
		scanf("%d",&a[i]);
    for(j=1;j<=n;j++)
		if(max<a[j-1]) max=a[j-1];
		else max=max;
    for(u=1;u<=n;u++)
        if(max2<a[u-1]&&max>a[u-1]) max2=a[u-1];
        else max2=max2;

    printf("%d\n",max);
    printf("%d\n",max2);
	return 0;
}


void main()
{
	int n,i=1,x,t,y,sum,num;
	scanf("%d\n",&n);
	scanf("%d\n",&x);
	sum=x;num=-1000000;
	while(i<n)
	{	scanf("%d\n",&t);
	if(sum<t)
	{	y=sum;sum=t;
	  if(t>num)
		  num=y;}
	else
		if(num<t)
		  num=t;
		i++;
	}
	printf("%d\n",sum);
	printf("%d\n",num);
}


int main()
{int n,a,b,p,q;
scanf("%d%d%d",&n,&a,&b);
if(a>=b){p=a;q=b;}
else{p=b;q=a;}
for(int i=2;i<n;i++){
int m;
	scanf("%d",&m);
	if(m>=p){q=p;p=m;}
	else{if(m>=q){q=m;}}
}
printf("%d\n%d\n",p,q);
return 0;
}


int main()
{
	int n,s,a,b,i;
	scanf("%d\n%d",&n,&s);
	a=s;
	b=s;
	for(i=1;i<n;i++){
		scanf("\n%d",&s);
		if(a>s&&b>s){
			a=a;
			b=b;
		}else if(a>s&&b<=s){
			a=a;
			b=s;
		}else{
			b=a;
			a=s;
		}
	}
	printf("%d\n%d\n",a,b);
	return 0;
}


int main()
{
	int n,ma,mi,x,y;
	int i=1;
	scanf("%d",&y);
	while(i<=y)
	{
		scanf("%d",&n);
		if(i==1){
			ma=n;
		}
		else if(i==2){
			if(n>=ma){
			x=ma;
			ma=n;
			mi=x;
			}else{
				mi=n;
				}
		}
		else if(n>=ma){
			x=ma;
			ma=n;
			mi=x;
		}else if(n>=mi){
			mi=n;
		}
	i++;
	}
	printf("%d\n%d\n",ma,mi);
	return 0;
}


int main(void)
{
	int s[100];
	int n,i=0,max,qmax;
	scanf("%d",&n);
	while(i<n)
	{
		scanf("%d",&s[i]);
		i++;
	}
	i=1;
	max=qmax=s[0];
	while(i<n)
	{
		if(max<s[i])
			qmax=max,max=s[i];
		else if(qmax<s[i])
			qmax=s[i];
		i++;
	}
	printf("%d\n%d\n",max,qmax);
	return 0;
}


int main()
{
int n,i,a,b,x,max,cmax;
scanf("%d%d%d",&n,&a,&b);
if(a>=b)
{max=a;
cmax=b;}
else
{max=b;
cmax=a;}
i=1;
while(i<=n-2)
{
	scanf("%d",&x);
	i=i+1;
	if(x>=cmax&&x>=max)
	{cmax=max;
	max=x;}

else
	if(x<=cmax&&x<=max)
	{max=max;
	cmax=cmax;}
	else
	{cmax=x;
	max=max;}
}
printf("%d\n%d\n",max,cmax);
return 0;
}


int main (){
	int i,n,a,b,c,d,e;
	scanf("%d\n%d",&n,&e);
	b=e;
	c=e;
	for(i=2;i<=n;i++)
	{
		scanf("%d",&a);
		if(a>=b) {
			d=b;
		    b=a;
		if(b>d)	c=d;
		}
		else if(a<b&&a>c) e=a;
		if(e>c) c=e;

	}
	printf("%d\n%d\n",b,c);
	return 0;
}


int main()
{
	int n,x,biggest=0,bigger=0;
	cin>>n;
	while (n--)
	{
		cin>>x;
		if (x>biggest)
		{
			bigger=biggest;
			biggest=x;
		}
		else if (x>bigger)
			bigger=x;
	}
	cout<<biggest<<endl<<bigger<<endl;
	return 0;
}


void main()
{
	int n,i,j,l,big,smaller;
	int a[10011];
    scanf("%d\n",&n);
	for(i=0;i<n-1;i++)
	scanf("%d\n",&a[i]);
	i=n-1;
	scanf("%d",&a[i]);

	big=a[0];
	smaller=a[0];
	for(j=1;j<n;j++)
	{
		if(a[j]>=big)
			big=a[j];
	}
	for(l=0;l<n;l++)
	{
		if(a[l]>=smaller&&a[l]<big)
			smaller=a[l];
	}

	printf("%d\n%d",big,smaller);
	}


void selectionSort(int A[],int n)
{
	int i,j,k,t;
	for(i=0;i<n;i++)
    {
		k=i;
		for(j=i+1;j<n;j++)
		{
			if(A[j]>A[k])
				k=j;
		}
		if(k!=i)
		{
			t=A[k];
            A[k]=A[i];
			A[i]=t;
		}
	}
}

 int main()
 {
	  int i;
	  int A[100];
	  int n;
      scanf("%d",&n);
	  for(i=0;i<n;i++)
	  {
		  scanf("%d",&A[i]);
	  }
	  selectionSort(A,n);
	  for(i=0;i<2;i++)
	  {
		  printf("%d\n",A[i]);
	  }
      return 0;
 }


void main()
{
	int max,min,n,x,y;
	min=100;max=1;
	scanf("%d",&n);
	if(n==n)
	{
		scanf("%d",&x);
		max=min=x;
	}
	n=n-1;
	if(n==n)
	{
		scanf("%d",&x);
		max=max>x?max:x;
		min=min<x?min:x;
	}
	n=n-1;
	for(n=n;n>0;n--)
	{
		scanf("%d",&x);
		if(max==x)
			max=x;min=min;
		if(max!=x)
		{
			y=max<x?max:x;
			max=max>x?max:x;
			min=min>y?min:y;
		}
	}
	printf("%d\n%d",max,min);
}


int main()
{
	int i,n,a[100],max,min,x,y;
	scanf("%d",&n);
    scanf("%d",&x);
    scanf("%d",&y);
	if(x>=y)
	{
		max=x;
		min=y;
	}
	else
	{
		max=y;
		min=x;
	}
	for(i=1;i<(n-1);i++)
	{
		scanf("%d",&(a[i]));
		if(a[i]>max)
		{
			min=max;
			max=a[i];
        }
		else if(a[i]<max&&a[i]>min)
		{
			min=a[i];
		}
	}
	printf("%d\n",max);
	printf("%d",min);
	return 0;
}


int main()
{
	int resulta=0;
	int resultb=0;
	int num;
	int n;
	int i=1;
	scanf("%d",&n);
	while (i<=n){
	scanf("%d",&num);
	if (i==1){
	resulta=num;
	}else{
		if(num>resulta){
	resultb=resulta;
	resulta=num;
		}
		else {if(num<resulta&&num>resultb){
			resultb=num;}}
	}
	i++;
	}
	printf("%d\n",resulta);
	printf("%d\n",resultb);

}


void main()
{
	int max(int m,int b[]);
	int i,n,c,a[100];

	scanf("%d",&n);
	for(i=0;i<n;i++)
		scanf("%d",&a[i]);

	c=max(n,a);
	printf("%d\n",c);
	for(i=0;i<n;i++)
	{
		if(a[i]==c)
			a[i]=-1;
	}

	printf("%d\n",max(n,a));
}

int max(int m,int b[])
{
	int i,ma;
	ma=b[0];
	for(i=1;i<m;i++)
	{
		if(ma<b[i])
			ma=b[i];
	}

	return(ma);
}


int main()
{
	int n=100;
	int a,b,i;
	scanf("%d%d",&a,&b);
	if(b>a){
		int p;
		p=b;
		b=a;
		a=p;
	}
	for(i=3;i<n;i++)
	{
		int c,m,k;
		scanf("%d",&c);
		if(c>b&&c<a)
		{
			m=a;
			k=c;
			a=m;
			b=k;
		}
		else if(c>a)
		{
			m=c;
			k=a;
			a=m;
			b=k;
		}
	}
	printf("%d\n%d\n",a,b);
	return 0;
}


int main()
{
	int i,n;
	int a[32767];
	int max=0;
	int secondmax=0;
	cin>>n;

 for (i=1;i<=n;i++)
 {
  cin>>a[i];
 }
 for (i=1;i<=n;i++)
 {
  if (a[i]>max)
  {
   max=a[i];
  }
 }
 for (i=1;i<=n;i++)
 {
	 if (a[i]<max && a[i]>secondmax)
	 {
		 secondmax=a[i];
	 }
 }

	cout<<max<<endl;
	cout<<secondmax<<endl;
	return 0;
}


int max(int num[],int n)
{
	int i,result=num[0];
	for(i=1;i<n;i++)
		if(num[i]>result)
			result=num[i];
		return(result);
}
void main(void)
{
	int n,num[100],m1,m2,i;
	scanf("%d",&n);
	for(i=0;i<n;i++)
	scanf("%d",&num[i]);
	m1=max(num,n);
	printf("%d\n",m1);
	for(i=0;i<n;i++)
		if(num[i]==m1)
			num[i]=-100;
		m2=max(num,n);
		printf("%d\n",m2);
}


int main(int argc, char* argv[])
{
	int n, i, t, m1, m2;
	m1=m2=~((unsigned)-1>>1);
	scanf("%d",&n);
	for(i=0;i<n;i++)
	{
		scanf("%d",&t);
		if(t>m1)
		{
			m2=m1;
			m1=t;
		}
		else if(t>m2)
			m2=t;
	}
	printf("%d\n%d",m1,m2);
	return 0;
}


int main()
{
	int n,max,se,i;
    int a[100];
    scanf("%d",&n);
	i=1;
	scanf("%d",&a[i]);
	max=a[i];
	se=a[i];
	i=2;
	scanf("%d",&a[i]);
	if (a[i]>max)
	{
		se=max;
		max=a[i];
	}
	else
	{
		if (a[i]<se)
		{
			se=a[i];
		}
	}
	i=3;
	while (i<=n)
	{
		scanf("%d",&a[i]);
		if (a[i]>max)
		{
			se=max;
			max=a[i];
		}
		else
		{
			if (max>a[i]&&a[i]>se)
			{
				se=a[i];
			}
		}
		i++;
	}
		printf("%d\n%d",max,se);
	return 0;
}


int main()
{
	int k;
	cin>>k;
	int max=0,max2=0;
	int a;
	for(int i=1;i<=k;i++)
	{
		cin>>a;
		if(a>=max)
		{
			int temp;
			temp=max;
			max=a;
			max2=temp;
		}

		else if( a>max2)
		{
			max2=a;
		}

        //i++;
	}
	cout<<max<<endl;
	cout<<max2<<endl;

	return 0;
}


void main()
{
	int i,n,a,b,c;
	scanf("%d",&n);
	scanf("%d%d",&a,&b);
	if(a<b){a=a+b;b=a-b;a=a-b;}
	else{a=a;b=b;}
    for(i=3;i<=n;i++)
	{
		scanf("%d",&c);
		if(c>a){b=a;a=c;}
		else if(c>b){a=a;b=c;}
		else{a=a;b=b;}

	}
	printf("%d\n",a);
	printf("%d",b);
}


void main()
{
	int ch[100],i,max,max1,n;
	scanf("%d\n",&n);
	for(i=0;i<n-1;i++)
	scanf("%d\n",&ch[i]);
	scanf("%d",&ch[n-1]);
	max=ch[0];
	max1=ch[0];
	for(i=0;i<n;i++)
	{
		if(max<ch[i])
		max=ch[i];
	}
	printf("%d\n",max);
	for(i=0;i<n;i++)
	{
		if(max1<ch[i]&&ch[i]!=max)
			max1=ch[i];
	}
	printf("%d",max1);
}


void bubbleSort(int A[],int n)
{
	int i,j,t;

	for( i=0; i<n; i++ )
	{
		for (j = n-1;j>i;j--)
			{
				if (A[j]<A[j-1])
				{

					t=A[j];
					A[j]=A[j-1];
					A[j-1]=t;
		}
		}
	}
}
int main(int argc, char* argv[])
{
	int length;
	int i;
	int A[N];
	scanf("%d", &length);
	for (i=0;i<length;i++)
	{
		scanf("%d", &A[i]);
	}
	bubbleSort(A,length);

	printf("%d\n",A[length-1]);
	printf("%d\n",A[length-2]);

	return 0;
}


int main()
{
	int a,b,c,n,i,e;
	scanf("%d",&n);
	scanf("%d",&b);
	scanf("%d",&c);
	if(b>c)
	{
		e=b;
		b=c;
		c=e;
	}

	for(i=3;i<=n;i++)
	{
		scanf("%d",&a);

		if(a>c)
		{
			e=c;
			c=a;
			b=e;
		}
		else if((a>b)&&(a<=c))
		{
			b=a;
		}
		else
		{
			continue;
		}

	}

	printf("%d\n%d\n",c,b);
	return 0;
}


int main()
{
	int n;
	scanf("%d",&n);
	int MAX1,MAX2;
	int a,b;
	scanf("%d",&a);
    scanf("%d",&b);
	MAX1=a;
	MAX2=b;
	int x,y;
	if (b>a)
	{
		x=MAX1;
		y=MAX2;
		MAX1=y;
		MAX2=x;
	}
	int i;
	for(i=2;i<n;i++)
	{
		int j;
		scanf("%d",&j);
		if (j>MAX1)
		{
			MAX2=MAX1;
			MAX1=j;
		}
		else if (j>MAX2)
		{
			MAX2=j;
		}
	}
	printf("%d\n%d",MAX1,MAX2);
	return 0;
}


int main()
{
	int z[100],n,i,max,min;
	scanf("%d",&n);
	for(i=0;i<n;i++)
		scanf("%d",&z[i]);
	for(i=1,max=z[0],min=z[0];i<n;i++)
	{
		if(z[i]>max)
		{
			min=max;
			max=z[i];
		}
		else if(z[i]<max&&z[i]>min) min=z[i];
	}
	printf("%d\n%d\n",max,min);
	return 0;
}


int main()
{
	int a;
	scanf("%d",&a);
	int sz[1000];
	int index;
	for(index=0;index<a;index++)
	scanf("%d",&sz[index]);
	int d,x,inde;
	d=sz[0];
	x=sz[0];
	for(inde=1;inde<a;inde++)
    {
	  if(sz[inde]>d)
	  {
		  x=d;
		  d=sz[inde];
      }
	  else if(sz[inde]>x)
		  x=sz[inde];
    }
    printf("%d\n",d);
	printf("%d\n",x);
	return 0;
}


int main(int argc, char *argv[])
{
  int b,i,k;
  i=0;
  k=1;
  int a[100];
  int maxindex,c;
  c=0;
  scanf("%d",&b);
  for(i=0; i < 100; i++)
           a[i] = 0;
  if(b>1 && b<100){
     for(i=0;i<b;i++){
         scanf("%d",&(a[i]));
         }
     for(k=1;k<=2;k++){
        maxindex=0;
        for(i=0;i<=100-k;i++){
           if(a[i]>a[maxindex]){
              maxindex=i;
           }
        }
        if(maxindex!= 100-k){
           c=a[maxindex];
           a[maxindex]=a[100-k];
           a[100-k]=c;
           printf("%d\n",a[100-k]);
        }
      }
  }else{
  printf("error");
  }
  return 0;
}


void main()
{
	int n,i,a,b,c;
	scanf("%d",&n);
	scanf("%d %d",&a,&b);
	if(b>a)
			c=b,b=a,a=c;
	for(i=1;i<=(n-2);i++)
	{
	    scanf("%d",&c);
		if(c>a) b=a,a=c;
		else if(c>b) b=c;
	}
	printf("%d\n%d\n",a,b);
}


int main()
{
	int n,d,x;
	scanf("%d",&n);
	int arr[100]={0};
	for(int i=0;i<n;i++){
		scanf("%d",&arr[i]);
	}
	d=0;
	x=0;
	for(int k=0;k<n;k++){
		if(arr[k]>d){
			d=arr[k];
		}
	}
	for(int j=0;j<n;j++){
			if(x<=arr[j]&&arr[j]<d){
				x=arr[j];
			}
	}
	printf("%d\n%d\n",d,x);
	return 0;
}


int main()
{
	int a[100];
	int n,first=0,second=0,i;
	scanf("%d",&n);
	for(i=0;i<n;i++){
		scanf("%d",&a[i]);
		if(first<a[i]){
			first=a[i];
		}
		else
		{
			first=first;
		}
	}
	for(i=0;i<n;i++){
		if(second<a[i]&&a[i]!=first){
			second=a[i];
		}
		else
		{
			second=second;
		}
	}
	printf("%d\n",first);
	printf("%d\n",second);
	return 0;
}


int main()
{
int n=0;
cin>>n;
int num[100];
int i=0;
int temp1=0,temp2=0,t=0;
for(i=0;i<n;i++)
{
cin>>num[i];
if(temp1<num[i])
{
temp1=num[i];
t=i;
}
}
for(i=0;i<n;i++)
{
if(i==t)continue;
else
{
if(temp2<num[i])temp2=num[i];
}
}
cout<<temp1<<endl<<temp2<<endl;
return 0;
}


int main(int argc, char* argv[])
{   int n,i,max1=0,max,max2=0;
    int*p;
   scanf("%d",&n);
   p=(int*)malloc(sizeof(int)*n);
   for(i=0;i<n;i++){
	   scanf("%d",&p[i]);}
   for(i=0;i<n;i++){
	   if (p[i]>max1) {max1=p[i];}
   }
    max=max1;max1=0;
	for(i=0;i<n;i++){
		if(p[i]>max2&&p[i]!=max){max2=p[i];}
	}
	printf("%d\n%d\n",max,max2);
    free(p);

	return 0;
}


int main()
{
     int n;
	 scanf("%d", &n);
	 int i;
	 int number[1000];
	 int a;
	 for(i=0; i<n; i++)
	 {
	    scanf("%d\n", &number[i]);
	 }
	for(i=1; i<n; i++)
	{
	    if(number[0]<number[i])
		{
		  a=number[i];
		  number[i]=number[0];
		  number[0]=a;
		}
	}
	for(i=2; i<n; i++)
	{
	  if(number[1]<number[i])
	  {
	     a=number[i];
		 number[i]=number[1];
		 number[1]=a;
	  }
	}
	printf("%d\n%d", number[0], number[1]);
	 return 0;
}


int main()
{
  int i,t1,t2,n,num,max1,max2;
  scanf("%d",&n);

max1=max2=0;
    t1=t2=0;
    for(i=1;i<=n;i++)
    {
      scanf("%d",&num);
      if(num>max1)
      {
        t2=t1;
        t1=i;
        max2=max1;
        max1=num;
      }
      else if(num > max2&& num < max1)
      {
        max2=num;
        t2=i;
      }
    }
   printf("%d\n%d\n", max1, max2);
}


void main()
{
	int n,a,b,c,d,i,r;
	scanf("%d",&n);
	scanf("%d",&a);
	b=a;
	c=a;
	for(i=2;i<=n;i++)
	{
		scanf("%d",&d);
		if(d>b)
		{
			r=b;
			b=d;
			if(r>c)
				c=r;
		}
		else if(d>c)
			c=d;
	}
	printf("%d\n%d\n",b,c);
}


int main()
{
	int n,t,max,max2,i;
	scanf("%d",&n);
	scanf("%d",&t);
	max=max2=t;
	for (i=1;i<n;i++)
	{
		scanf("%d",&t);
		if (t>max)
		{
			max2=max;
			max=t;
		}
		else if (t>max2)
			max2=t;
		}
	printf("%d\n",max,max2);
	printf("%d\n",max2);
	return 0;
}


int main(){
	int a,b,c,d,p,q,n,i;
	scanf("%d%d%d%d",&n,&a,&b,&c);
	if(a>b&&a>c&&b>c){
		p=a;
		q=b;
	}else if(a>b&&a>c&&c>b){
		p=a;
		q=c;
	}else if(b>a&&b>c&&a>c){
		p=b;
		q=a;
	}else if(b>a&&b>c&&c>a){
		p=b;
		q=c;
	}else if(c>a&&c>b&&a>b){
		p=c;
		q=a;
	}else if(c>a&&c>b&&b>a){
		p=c;
		q=b;
	}
	i=4;
	while(i<=n){
		scanf("%d",&d);
		if(d>p){
		    q=p;
			p=d;
		}else if(d<p&&d>q){
			q=d;
		}
		i++;
	}
	printf("%d\n%d\n",p,q);
	return 0;
}


int main()
{
	int a;
	int big1,big2,big;
	scanf("%d",&a);
	int b[100];
	scanf("%d",&b[0]);
	big1=b[0];
	scanf("%d",&b[1]);
	big2=b[1];
	if (big2>big1)
	{
		big=big1;
		big1=big2;
		big2=big;
	}
	for (int i=2;i<=a-1;i++)
	{
		scanf("%d",&b[i]);
		if(b[i]>big2)
		{
			big2=b[i];
			if (big2>big1)
			{
			big=big1;
			big1=big2;
			big2=big;
			}
		}
	}
	printf("%d\n%d\n",big1,big2);
	return 0;
}


int main(int argc, char* argv[])
{
	int n,i,p,x,y;
	x=y=0;
	scanf("%d",&n);
	for (i=1;i<=n;i++)
		{scanf("%d",&p);
		if (p>x ){
			y=x;
			x=p;}
		else
			if(p>y)
				y=p;
				}
	printf("%d\n%d",x,y);
	return 0;
}


int main(int argc, char* argv[])
{
	int i,n;
	int t;
	int max,secondmax;
	scanf("%d%d",&n,&t);
	max=secondmax=t;
	for(i=1;i<n;i++)
	{
		scanf("%d",&t);
		if((t<max)&&(t>secondmax))
        {
			secondmax=t;
		}
		else
			if(t>max)
		{
			secondmax=max;
            max=t;
		}
	}
	printf("%d\n%d",max,secondmax);
	return 0;
}


main()
{
  int n,a,b,i=0,c;
  scanf("%d",&n);
  scanf("%d%d",&a,&b);
  if(a<b)
  a=a+b,b=a-b,a=a-b;
  while(i<n-2)
  {
    scanf("%d",&c);
    if(c>=a) b=a,a=c;
    else
    {
    if(c>b) b=c;
     }
    i++;
   }
   printf("%d\n",a);
   printf("%d\n",b);
}


int main()
{
    int n,a,i,max1=-10000,max2=-10000;
	scanf("%d",&n);
	for(i=0;i<n;i++){
		scanf("%d",&a);
        if (a>max1){
			max2=max1;
			max1=a; }
		else if(a<max1&&a>max2)
		    max2=a;
		else if(a<max2)
			;
	}
	printf("%d\n%d",max1,max2);
	return 0;
}


int main()
{
 int a[100];
 int n,i,s,j;
 scanf("%d",&n);
 for(i=0;i<n;i++)
 {
  scanf("%d",&a[i]);
 }
 int max=-10000;
 for(s=0;s<n;s++)
 {
	 if(max<a[s]) max=a[s];
 }
 int secondMax=0;
 for(j=0;j<n;j++)
 {
	 if(secondMax<a[j]&&a[j]<max)
		 secondMax=a[j];
 }
 printf("%d\n",max);
 printf("%d",secondMax);
 return 0;
}


int main()
{
 int arr[100]={0};
 int n=0;
 scanf("%d",&n);
 for(int i=0;i<n;i++)
 {
  scanf("%d",&arr[i]);
 }
 int max=-10000;
 for(int s=0;s<n;s++)
 {
  max=(max>=arr[s])?max:arr[s];
 }
 int secondMax=0;
 for(int j=0;j<n;j++)
 {
  secondMax=(secondMax>=arr[j]||arr[j]==max)?secondMax:arr[j];
 }
 printf("%d\n",max);
 printf("%d",secondMax);
 return 0;
}


// work2 1.cpp : Defines the entry point for the console application.
//

//#include "stdafx.h"

int main(int argc, char* argv[])
{
	int n;
	int arr[100];
	scanf("%d",&n);
	int i,j;

	for (i=0;i<n;i++) {
		scanf("%d",&arr[i]);
	}

	int t,k=0;

	for (i=0;i<n;i++) {
		for (j=i;j<n;j++) {
			if (arr[i]<arr[j]) {
			t=arr[i];
			arr[i]=arr[j];
			arr[j]=t;
//			for (k=0;k<n;i++) {
//		printf("%d  ",arr[i]);
//	}
			}
		}
	}

	for (i=0;i<2;i++) {
		printf("%d\n",arr[i]);
	}
	return 0;
}


int main(int argc, char* argv[])
{
	int n,i,f,s,num;
	scanf("%d",&n);
	for(i=0;i<2;i++)
	{

		scanf("%d",&num);
		if(i==0)
		{
			f=num;
			s=num;
		}
		if(i==1)
		{
			if(num>f)
			{
				s=f;
				f=num;

			}
			else
			{
				f=f;
				s=num;
			}
		}
		for(i=1;i<n;i++)
		{
			scanf("%d",&num);

			{
				if(num>f)
				{
					s=f;
					f=num;

				}
				else
				{
					if(num==f)
					{
						f=f;
						s=s;
					}
					else
					{
						if(num>s)
						{
							s=num;
							f=f;
						}
						else
						{
							s=s;
							f=f;
						}

					}
				}

			}
		}
	}
	printf("%d\n",f);
	printf("%d",s);
	return 0;
}


int main()
{
	int a[10000];
	int i,n;
	int max,max2;
	scanf("%d",&n);
	for(i=0;i<n;i++)
		scanf("%d",&a[i]);
	max=0;
	for(i=0;i<n;i++)
		if(max<=a[i])
		{
			max=a[i];
		}
	max2=0;
	for (i=0;i<n;i++)
		if ((a[i]<max)&&(a[i]>=max2)) max2=a[i];
	printf("%d\n%d\n",max,max2);
	return 0;
}


int main () {
	int i,n,f;
	int e=0;
	int maxi=0;
	int a[100];
	scanf("%d",&n);
	for(i=1;i<=n;i++){
		scanf("%d",&a[i]);
		if(a[i]>maxi){
			f=maxi;
			maxi=a[i];
		}
		else if(a[i]>e){
			e=a[i];
		}
	}
	printf("%d\n",maxi);
	if(f>e){
		printf("%d\n",f);
	}
	else{
		printf("%d\n",e);
	}
	return 0;
}


main()
{int a,b,n,c,i;
 scanf("%d",&n);
 scanf("%d",&a);
 scanf("%d",&b);
 if(a<b){c=a;a=b;b=c;}
 for(i=1;i<=n-2;i++)
 {scanf("%d",&c);
  if(c<=b) continue;
  if(c>b&&c<=a) {b=c;continue;}
  if(c>a){b=a;a=c;}
 }
 printf("%d\n%d\n",a,b);
}


int main()
{
	signed int n,num[1000],i,out[2];
	scanf("%d",&n);
	for(i=0;i<n;i++)
	{
		scanf("%d",&num[i]);
	}
	if(num[0]>num[1])
	{
		out[0]=num[0];
		out[1]=num[1];
	}
	else
	{
		out[0]=num[1];
		out[1]=num[0];
	}
	for(i=2;i<n;i++)
	{
		if(num[i]>out[0])
		{
			out[1]=out[0];
			out[0]=num[i];
		}
		else if(num[i]<out[0]&&num[i]>out[1])
			out[1]=num[i];
		else
			continue;
	}
	printf("%d\n%d\n",out[0],out[1]);
   	return 0;
}


void main()
{
	int n,a,b,c,max,smax,i,r,t;
	scanf("%d",&n);
	scanf("%d",&a);
	scanf("%d",&b);
	if(a<b)
	{
		t=b;
        b=a;
		a=t;
	}
	max=a;
	smax=b;
	for(i=1;i<=n-2;i++)
	{
		scanf("%d",&c);
		if(c>max)
		{
			r=max;
			max=c;
			smax=r;
		}
		else if(c>smax)
		{
		    smax=c;
		}
	}
	printf("%d\n",max);
	printf("%d\n",smax);
}


int main () {
	int a,n,i=0,b,max,secm=0;
	scanf("%d",&n);
	scanf("%d",&max);
	for (; i<n-1; i++) {
		scanf("%d",&b);
		if (max<b) {
			a=max;
			max=b;
			secm=a;
		}
		else if(b>secm){
			secm=b;
		}

	}
	printf("%d\n\n%d",max,secm);
	return 0;
}


void bubbleSort(int A[],int n)
{
	int i,j,t;
	for (i=0;i<n;i++)
	{
		for(j=n-1;j>i;j--)
		{
			if(A[j]<A[j-1])
			{
				t=A[j];
			    A[j]=A[j-1];
				A[j-1]=t;
			}
		}
	}
}
int main()
{
	int s;
	int i;
	int A[N];

	scanf("%d\n",&s);
	for (i=0;i<s;i++)
	{
        scanf("%d",&A[i]);
	}
	bubbleSort(A,s);

	printf("%d\n%d\n",A[s-1],A[s-2]);

	return 0;
}


int main()
{
    int n,a,max1,max2;
    cin>>n;
    cin>>max1>>a;
    if(max1<a)
    {
        max2=max1;
        max1=a;
    }
    else
    {
        max2=a;
    }
    for(int i=2;i<n;i++)
    {
        cin>>a;
        if(a>max1)
        {
            max2=max1;
            max1=a;
        }
        else if(a>max2)
        {
            max2=a;
        }
    }
    cout<<max1<<endl<<max2<<endl;
    return 0;
}


int main()
{
   int n,i,a,b,c,x,y;
      scanf("%d\n",&n);
	  i=1;
      scanf("%d\n%d\n",&a,&b);
	  if(a>b){
		  x=a,y=b;
      }else{
		  x=b,y=a;
	  }
	  while(i<=n-2){
	  scanf("%d",&c);
	  if(c>x){
          y=x,x=c;
	  }
	  else if(c<x&&c>y){
		  x=x,y=c;
	  }
	  else if(c<y){
		  x=x,y=y;
	  }i++;
	  }

	  printf ("%d\n%d",x,y);

   return 0;
}


int main()
{
int count=0;
int a,b,c,n;
int i=1;
scanf("%d",&n);
b=0;
c=0;
while(i<=n)
{
	i++;
    scanf("%d",&a);
	if(a>=b)c=b,b=a;
    if(a>c&&a<b)c=a;
}
printf("%d\n",b);
printf("%d\n",c);
return 0;
}


int main()
{
	int i,n,e;
	int prime[N];
	scanf("%d",&n);
	for(i=0;i<n;i++)
	{
		scanf("%d",&prime[i]);
	}
	for(i=0;i<n;i++)
	{
		if(prime[i]>prime[i+1])
			e=prime[i],prime[i]=prime[i+1],prime[i+1]=e;
	}
	for(i=0;i<n;i++)
	{
		if(prime[i]>prime[i+1])
			e=prime[i],prime[i]=prime[i+1],prime[i+1]=e;
	}
	printf("%d\n",prime[n]);
	printf("%d\n",prime[n-1]);
	return 0;
}


int main(int argc, char* argv[])
{
	int a,i,b,first,second,c,d;
	scanf("%d",&a);
	scanf("%d%d",&c,&d);
	if (c>d)
		first=c;
	    second=d;
	if (c<d)
		first=d;
	    second=c;
    for(i=3;i<=a;i++)
	{
        scanf("%d",&b);
		if(b>first)
		{
			second=first;
			first=b;
		}
		else if(b>second)
			second=b;
	}
	printf("%d\n%d",first,second);
	return 0;
}


int main(int argc, char* argv[])
{
	int n;
	int fir,sen;
	int x,i;
	scanf("%d\n",&n);
	if(n>1&&n<100)
	{
		if(n==1)
		{
			int a;
			scanf("%d",&a);
			fir = sen=a;
		}
		else{
			for(i=0;i<n;i++)
			{
		       scanf("%d",&x);
				if(i==0)
				{
					fir=x;
					sen=0;
				}
				else
				{
					if(fir<x)
					{
						sen=fir;
						fir=x;
					}
				    else if(sen<x)
					{
					    fir=fir;
					    sen=x;
					}
				}

			}
		}
		printf("%d\n%d",fir,sen);
	}
	return 0;
}


void bubblesort(int A[],int n)
{
    int i,j,t;
	for(i=0;i<n;i++)
	{
	   for(j=n;j>i;j--)
	   {
	      if(A[j]<A[j-1])
		  {
			  t=A[j];
			  A[j]=A[j-1];
			  A[j-1]=t;
		  }
	   }
	}
}
int  main()
{
	int n,i;
	int A[100];
	scanf("%d",&n);
	for(i=0;i<n;i++)
	{
	    scanf("\n%d",&A[i]);
	}
	bubblesort(A,n);
	printf("%d\n%d\n", A[n],A[n-1]);
     return 0;
 }