semeru/Code-Code-CloneDetection-POJ104 huggingface dataset:
void main()
{
	int i,n,b[10];
	float f=0,a[10],t=0;
	scanf("%d",&n);
	for(i=0;i<n;i++)
	{
		scanf("%f",&a[i]);
	}
	for(i=0;i<n;i++)
	{
		scanf("%d",&b[i]);
	}
	for(i=0;i<n;i++)
	{
		if(b[i]>=90) f=f+4.0*a[i];
		else if(b[i]>=85) f=f+3.7*a[i];
		else if(b[i]>=82) f=f+3.3*a[i];
		else if(b[i]>=78) f=f+3.0*a[i];
		else if(b[i]>=75) f=f+2.7*a[i];
		else if(b[i]>=72) f=f+2.3*a[i];
		else if(b[i]>=68) f=f+2.0*a[i];
		else if(b[i]>=64) f=f+1.5*a[i];
		else if(b[i]>=60) f=f+1.0*a[i];
	}
	for(i=0;i<n;i++)
		t=t+a[i];
	printf("%.2f",f/t);
}
double score(int a){
	double result;
	if(a>=90){
		result=4.0;
	}
	else if(a>=85&&a<=89){
		result=3.7;
	}
	else if(a>=82&&a<=84){
		result=3.3;
	}
	else if(a>=78&&a<=81){
		result=3.0;
	}
	else if(a>=75&&a<=77){
		result=2.7;
	}
	else if(a>=72&&a<=74){
		result=2.3;
	}
	else if(a>=68&&a<=71){
		result=2.0;
	}
	else if(a>=64&&a<=67){
		result=1.5;
	}
	else if(a>=60&&a<=63){
		result=1.0;
	}
	else {
		result=0;
	}
	return result;
}
int main()
{
	int n,i;
	int sz1[50],sz2[50];
	double sz3[50];
	scanf("%d",&n);
	for(i=0;i<n;i++)
	{
		scanf("%d",&sz1[i]);
	}
	for(i=0;i<n;i++)
	{
         scanf("%d",&sz2[i]);
	}
double x,a=0;
int y=0;
	for(i=0;i<n;i++)
	{   
		x=score(sz2[i]);
			sz3[i]=x*sz1[i];
	}
	for(i=0;i<n;i++)
	{
		a+=sz3[i];
		y+=sz1[i];
	}
	
	printf("%.2lf\n",a/y);
	return 0;
}
int main()
{
	int n,i;
	int a[10],b[10];
	double sum=0,c[10],e=0;
	scanf("%d",&n);
	for(i=0;i<n;i++){
		scanf("%d",&(a[i]));
                e=e+a[i];
	}
        for(i=0;i<n;i++){
		scanf("%d",&(b[i]));
		if(b[i]>=90&&b[i]<=100)c[i]=4.0;
                if(b[i]>=85&&b[i]<=89)c[i]=3.7;
                if(b[i]>=82&&b[i]<=84)c[i]=3.3;
                if(b[i]>=78&&b[i]<=81)c[i]=3.0;
                if(b[i]>=75&&b[i]<=77)c[i]=2.7;
                if(b[i]>=72&&b[i]<=74)c[i]=2.3;
                if(b[i]>=68&&b[i]<=71)c[i]=2.0;
                if(b[i]>=64&&b[i]<=67)c[i]=1.5;
                if(b[i]>=60&&b[i]<=63)c[i]=1.0;
		if(b[i]<60)c[i]=0;
	}
        for(i=0;i<n;i++){
		sum=(double)(sum+a[i]*c[i]);
	}
	sum=(double)sum/e;
	printf("%.2f",sum);
	return 0;
}
int main(){
   int n,i,k,a;
   a=0;
   scanf("%d",&n);
   float d,e,g;
   d=0; 
   int c[n],b[n];
   for(i=0;i<n;i++){
   scanf("%d ",&c[i]);
   a=a+c[i];
}
   for(k=0;k<n;k++){
   if(k!=n-1){
   scanf("%d ",&b[k]);
}
   else{
   scanf("%d",&b[k]);
}
   if(b[k]<=100&&b[k]>=90){
      e=c[k]*4.0;
}
   if(b[k]<=89&&b[k]>=85){
      e=c[k]*3.7;
}
   if(b[k]<=84&&b[k]>=82){
      e=c[k]*3.3;
}
   if(b[k]<=81&&b[k]>=78){
      e=c[k]*3.0;
}
    if(b[k]<=77&&b[k]>=75){
      e=c[k]*2.7;
}
     if(b[k]<=74&&b[k]>=72){
      e=c[k]*2.3;
}
    if(b[k]<=71&&b[k]>=68){
      e=c[k]*2.0;
}
     if(b[k]<=67&&b[k]>=64){
      e=c[k]*1.5;
}
     if(b[k]<=63&&b[k]>=60){
      e=c[k]*1.0;
}
     if(b[k]<60){
      e=0;
}
    d=d+e;
}
    g=d/a;    
    printf("%.2f",g);
    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);
}
int main(){
    int n,a=0;
    scanf("%d\n",&n);
    int xf[n-1],cj[n-1];
    double jd[n-1],GPA,z=0;
    for(int i=0;i<n;i++){
        if(i==n-1){
            scanf("%d\n",&xf[i]);
        }
        else{
            scanf("%d",&xf[i]);
        }
    } 
    for(int i=0;i<n;i++){
        scanf("%d\n",&cj[i]);
    }
    for(int i=0;i<n;i++){
        if(cj[i]<=100&&cj[i]>=90){
            jd[i]=4.0;
        }else{
            if(cj[i]<=89&&cj[i]>=85){
                jd[i]=3.7;
            }else{
                if(cj[i]<=84&&cj[i]>=82){
                    jd[i]=3.3;
                }else{
                    if(cj[i]<=81&&cj[i]>=78){
                        jd[i]=3.0;
                    }else{
                        if(cj[i]<=77&&cj[i]>=75){
                            jd[i]=2.7;
                        }else{
                            if(cj[i]<=74&&cj[i]>=72){
                                jd[i]=2.3;
                            }else{
                                if(cj[i]<=71&&cj[i]>=68){
                                    jd[i]=2.0;
                                }else{
                                    if(cj[i]<=67&&cj[i]>=64){
                                        jd[i]=1.5;
                                    }else{
                                        if(cj[i]<=63&&cj[i]>=60){
                                            jd[i]=1.0;
                                        }else{
                                            jd[i]=0.0;                         
                                         }
                                     }
                                 }
                             }
                         }
                     }
                 }
             }
        }
    }
    for(int i=0;i<n;i++){
        z+=xf[i]*jd[i];
    }
    for(int i=0;i<n;i++){
        a+=xf[i] ;
    }
    GPA=z/a;
    printf("%.2lf",GPA);
    return 0;
}
int main(){
    int n,a[10],i,k,s=0;
    double b[10],m,l=0;
    scanf("%d/n",&n);
    for(i=0;i<n;i++){
        scanf("%d ",&(a[i]));
        s+=a[i];
    }
    for(i=0;i<n;i++){
        scanf("%lf ",&(b[i]));
        if(b[i]>=90)b[i]=4.0;
        else{
            if(b[i]>=85)b[i]=3.7;
            else{
                if(b[i]>=82)b[i]=3.3;
                else{
                    if(b[i]>=78)b[i]=3.0;
                    else{
                        if(b[i]>=75)b[i]=2.7;
                        else{
                            if(b[i]>=72)b[i]=2.3;
                            else{
                                if(b[i]>=68)b[i]=2.0;
                                else{
                                    if(b[i]>=64)b[i]=1.5;
                                    else{
                                        if(b[i]>=60)b[i]=1.0;
                                        else b[i]=0;
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
        b[i]=b[i]*a[i];
        l+=b[i];
    }
    m=l/s;
    printf("%.2lf",m);
    return 0;
}
int main()
{
    int n;
    scanf("%d",&n);
    int xf[100],cj[100];
    double jd[100];
    int i;
    for(i=0;i<n;i++)
    {
        scanf("%d",&xf[i]);
    }
    int fz=0;
    for(i=0;i<n;i++){fz+=xf[i];}
    for(i=0;i<n;i++)
    {
        scanf("%d",&cj[i]);
    }
    for(i=0;i<n;i++)
    {
        if(cj[i]>=90){jd[i]=4.0*xf[i];}
        else if(cj[i]<=89&&cj[i]>=85){jd[i]=3.7*xf[i];}
        else if(cj[i]<=84&&cj[i]>=82){jd[i]=3.3*xf[i];}
        else if(cj[i]<=81&&cj[i]>=78){jd[i]=3.0*xf[i];}
        else if(cj[i]<=77&&cj[i]>=75){jd[i]=2.7*xf[i];}
        else if(cj[i]<=74&&cj[i]>=72){jd[i]=2.3*xf[i];}
        else if(cj[i]<=71&&cj[i]>=68){jd[i]=2.0*xf[i];}
        else if(cj[i]<=67&&cj[i]>=64){jd[i]=1.5*xf[i];}
        else if(cj[i]<=63&&cj[i]>=60){jd[i]=1.0*xf[i];}
        else if(cj[i]<=60){jd[i]=0;}
    }
    double z=0;
    for(i=0;i<n;i++){z+=jd[i];}
    printf("%.2lf",z/fz);
    return 0;
}
int main()
{
      int i,b,n;
      float GPA,e;
      scanf("%d ",&n);
      float sz[n],xy[n],mm[n];
      for(i=0;i<n;i++){
      scanf("%f",&sz[i]);
      e+=sz[i];
      }
      for(i=0;i<n;i++){
      scanf("%f",&xy[i]);
      }
      for(i=0;i<n;i++){
      if(xy[i]>=90)
         mm[i]=4.0;
      else{
          if(xy[i]>=85)
             mm[i]=3.7;
           else{
                if(xy[i]>=82)
                       mm[i]=3.3;
                    else{
                        if(xy[i]>=78)
                           mm[i]=3.0;
                        else{
                            if(xy[i]>=75)
                            mm[i]=2.7;
                            else{
                                if(xy[i]>=72)
                                   mm[i]=2.3;
                                else{
                                    if(xy[i]>=68)
                                    mm[i]=2.0;
                                    else{
                                        if(xy[i]>=64)
                                           mm[i]=1.5;
                                        else{
                                            if(xy[i]>=60)
                                               mm[i]=1.0;
                                            else{
                                                mm[i]=0.0;}}}}}}}}}
      }
      for(i=0;i<n;i++){
      GPA+=sz[i]*mm[i]/e;
      }
      printf("%.2f",GPA);
      return 0;
}
void main()
{
   int n,a[10],b[10],i,j,k,l,d;
   float c[10],sum=0,GPA,m=0;
   scanf("%d",&n);
   for(i=0;i<=n-1;i++)
     scanf("%d",&a[i]);
   for(l=0;l<=n-1;l++)
	   scanf("%d",&b[l]);
   for(j=0;j<=n-1;j++)
   {   d=b[j];
	   if(90<=d&&d<=100) c[j]=4.0;
        else if(85<=d&&d<=89) c[j]=3.7;
         else if(82<=d&&d<=84) c[j]=3.3;
         else if(78<=d&&d<=81) c[j]=3.0;
         else if(75<=d&&d<=77) c[j]=2.7;
         else if(72<=d&&d<=74) c[j]=2.3;
         else if(68<=d&&d<=71) c[j]=2.0;
         else if(64<=d&&d<=67) c[j]=1.5;
         else if(60<=d&&d<=63) c[j]=1.0;
         else if(d<60) c[j]=0;}
    for(k=0;k<=n-1;k++)
        {sum=sum+a[k]*c[k];
        m=m+a[k];}
    GPA=sum/m;
    printf("%.2f",GPA);
}
void main()
{
	int t=0,i,n,a[10],b[10];float sum,aver,c[10];
	scanf("%d",&n);
    for(i=0;i<n;i++)
		scanf("%d",&a[i]);
    for(i=0;i<n;i++)
	scanf("%d",&b[i]);
	sum=0;aver=0;
	for(i=0;i<n;i++)
	{
		if(90<=b[i]&&b[i]<=100)c[i]=4.0;
		else{ if(85<=b[i]&&b[i]<=89)c[i]=3.7;
		else {if(82<=b[i]&&b[i]<=84)c[i]=3.3;
		else {if(78<=b[i]&&b[i]<=81)c[i]=3.0;
		else {if(75<=b[i]&&b[i]<=77)c[i]=2.7;
		else {if(72<=b[i]&&b[i]<=74)c[i]=2.3;
		else {if(68<=b[i]&&b[i]<=71)c[i]=2.0;
		else {if(64<=b[i]&&b[i]<=67)c[i]=1.5;
		else {if(60<=b[i]&&b[i]<=63)c[i]=1.0;
		else c[i]=0;}}}}}}}}
		sum=sum+a[i]*c[i];
        t=t+a[i];
	}
	aver=sum/t;
	printf("%.2f",aver);
}
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);
}
void main()
{
	int a[10],b[10],i,j,n,t,x,sum1;
	float c,d=0,average;
	scanf("%d",&n);
	for(i=0;i<n;i++)
	{
		scanf("%d",&a[i]);
		
	}
	
	for(j=0;j<n;j++)
	{scanf("%d",&b[j]);}

	
	for(j=0;j<n;j++)
	{
	    t=a[j];
	    x=b[j];
		if(x>=90)
		{c=4.0;
		d+=t*c;continue;}
		else if(x<90&&x>=85)
		{c=3.7;
		d+=t*c;continue;}
		else if(x<85&&x>=82)
		{c=3.3;
		d+=t*c;continue;}
		else if(x<82&&x>=78)
		{c=3.0;
		d+=t*c;continue;}
		else if(x<78&&x>=75)
		{c=2.7;
		d+=t*c;continue;}
		else if(x<75&&x>=72)
		{c=2.3;
		d+=t*c;continue;}
		else if(x<72&&x>=68)
		{c=2.0;
		d+=t*c;continue;}
		else if(x<68&&x>=64)
		{c=1.5;
		d+=t*c;continue;}
		else if(x<64&&x>=60)
		{c=1.0;
		d+=t*c;continue;}
		else 
		d+=0;
	}
	sum1=0;
    for(i=0;i<n;i++)
    {
    	
    	sum1+=a[i];
    }
    average=(float)d/sum1;
    printf("%.2f",average);
}
double score(int i)
{
	double p;
	if (90<=i && i<=100) p=4.0;
	if (85<=i && i<=89) p=3.7;
	if (82<=i && i<=84) p=3.3;
	if (78<=i && i<=81) p=3.0;
	if (75<=i && i<=77) p=2.7;
	if (72<=i && i<=74) p=2.3;
	if (68<=i && i<=71) p=2.0;
	if (64<=i && i<=67) p=1.5;
	if (60<=i && i<=63) p=1.0;
	if (i<60) p=0.0;
	return p;
}
void main()
{
	double gpa;
	gpa=0;
	int n,i,nm[10],sc[10],s;
	s=0;
	scanf("%d",&n);
	for (i=1;i<=n;i++) scanf("%d",&nm[i]);
	for (i=1;i<=n;i++) scanf("%d",&sc[i]);
	for (i=1;i<=n;i++) 
	{
		//printf("%.2lf\n",score(sc[i]));
		gpa=gpa+score(sc[i])*nm[i];
		s=s+nm[i];
	}
	//printf("%.2f\n",gpa);
	//printf("%d\n",s);
	gpa=gpa/s;
	printf("%.2f\n",gpa);
}
int main()
{
	int n,i=0,e=0;
	scanf("%d",&n);
	double s=0.00,a=0.00;
	double cj[2][10];
	for(i=0;i<2;i++){
		for(e=0;e<n;e++){
			scanf("%lf",&cj[i][e]);
		}
	}
	for(e=0;e<n;e++){
		if(cj[1][e]>=90&&cj[1][e]<=100){
			cj[1][e]=4.0;
		}
		else if(cj[1][e]>=85&&cj[1][e]<=89){
			cj[1][e]=3.7;
		}
		else if(cj[1][e]>=82&&cj[1][e]<=84){
			cj[1][e]=3.3;
		}
        else if(cj[1][e]>=78&&cj[1][e]<=81){
			cj[1][e]=3.0;
		}
        else if(cj[1][e]>=75&&cj[1][e]<=77){
			cj[1][e]=2.7;
		}
        else if(cj[1][e]>=72&&cj[1][e]<=74){
			cj[1][e]=2.3;
		}
        else if(cj[1][e]>=68&&cj[1][e]<=71){
			cj[1][e]=2.0;
		}
        else if(cj[1][e]>=64&&cj[1][e]<=67){
			cj[1][e]=1.5;
		}
        else if(cj[1][e]>=60&&cj[1][e]<=63){
			cj[1][e]=1.0;
		}
		else if(cj[1][e]<60){
			cj[1][e]=0;
		}
		s=s+cj[0][e]*cj[1][e];
		a=a+cj[0][e];
	}
	s=s/a;
	printf("%.2lf",s);
	return 0;
}
int main(){
    int n,i,s=0;
	float t,p=0,q;
	int a[10];
	int sz[10];
	scanf("%d",&n);
	for(i=0;i<n;i++){
		scanf("%d",&a[i]);
	}
    for(i=0;i<n;i++){
		s=s+a[i];
	}
	for(int m=0;m<n;m++){
		scanf("%d",&sz[m]);
		i=m;
	   if(sz[m]<=100&&sz[m]>=90){    
			    t=4.0;				
	   }
	   if(sz[m]<=89&&sz[m]>=85)	{	
				t=3.7;				
	   }				
	   if(sz[m]<=84&&sz[m]>=82){
				t=3.3;			
	   }
	   if(sz[m]<=81&&sz[m]>=78){
				t=3.0;				
	   }
	   if(sz[m]<=77&&sz[m]>=75){
				t=2.7;			
	   }
	   if(sz[m]<=74&&sz[m]>=72){
				t=2.3;				
	   }
       if(sz[m]<=71&&sz[m]>=68){
				t=2.0;			
	   }
       if(sz[m]<=67&&sz[m]>=64){
				t=1.5;				
	   }
       if(sz[m]<=63&&sz[m]>=60){
				t=1.0;				
	   }
	   if(sz[m]<=59){				
				t=0;				
	   }
       p=p+t*a[i];
	}
q=p/s;
	printf("%.2f",q);
	return 0;
}
int main(){
int n,i,b,c=0,d;
float x,e=0;
float a[10];
scanf("%d",&n);
for(i=0;i<=n-1;i++){
	scanf("%d",&b);
	a[i]=b;
    c=c+b;
}
for(i=0;i<=n-1;i++){
	scanf("%d",&d);
	if(d<=100&&d>=90){
		e=e+4.0*a[i];
	}
    if(d<=89&&d>=85){
		e=e+3.7*a[i];
	}
    if(d<=84&&d>=82){
		e=e+3.3*a[i];
	}
    if(d<=81&&d>=78){
		e=e+3.0*a[i];
	}
    if(d<=77&&d>=75){
		e=e+2.7*a[i];
	}
    if(d<=74&&d>=72){
		e=e+2.3*a[i];
	}
    if(d<=71&&d>=68){
		e=e+2.0*a[i];
	}
    if(d<=67&&d>=64){
		e=e+1.5*a[i];
	}
    if(d<=63&&d>=60){
		e=e+1.0*a[i];
	}
        }
x=e/c;
printf("%.2f",x);
return 0;
}
int main(){
	int n,i,xf[10],df[10],zxf;
	float GPA,jd[10],xfjd[10],zxfjd;
	zxfjd=0;
	zxf=0;
	scanf("%d",&n);
	for(i=0;i<n;i++){
		scanf("%d",&(xf[i]));
	}
	for(i=0;i<n;i++){
		scanf("%d",&(df[i]));
	}
	for(i=0;i<n;i++){
		if(df[i]>=90&&df[i]<100){
			jd[i]=4.0;
			xfjd[i]=xf[i]*jd[i];
		}
		if(df[i]>=85&&df[i]<=89){
			jd[i]=3.7;
			xfjd[i]=xf[i]*jd[i];
		}
		if(df[i]>=82&&df[i]<=84){
			jd[i]=3.3;
			xfjd[i]=xf[i]*jd[i];
		}
		if(df[i]>=78&&df[i]<=81){
			jd[i]=3.0;
			xfjd[i]=xf[i]*jd[i];
		}
		if(df[i]>=75&&df[i]<=77){
			jd[i]=2.7;
			xfjd[i]=xf[i]*jd[i];
		}
		if(df[i]>=72&&df[i]<=74){
			jd[i]=2.3;
			xfjd[i]=xf[i]*jd[i];
		}
		if(df[i]>=68&&df[i]<=71){
			jd[i]=2.0;
			xfjd[i]=xf[i]*jd[i];
		}
		if(df[i]>=64&&df[i]<=67){
			jd[i]=1.5;
			xfjd[i]=xf[i]*jd[i];
		}
		if(df[i]>=60&&df[i]<=63){
			jd[i]=1.0;
			xfjd[i]=xf[i]*jd[i];
		}
		if(df[i]<60){
			jd[i]=0;
			xfjd[i]=xf[i]*jd[i];
		}
		
	}
	for(i=0;i<n;i++){
		zxfjd+=xfjd[i];	
	}
	for(i=0;i<n;i++){
		zxf+=xf[i];
	}
	GPA=zxfjd/zxf;
	printf("%.2f",GPA);
return 0;

}
int main()
{
	int i,n,a[1000];
	scanf("%d",&n);
	for(i=0;i<n;i++)
	{
		scanf("%d",&a[i]);
	}
	int k=a[0],b=a[0];
	for(i=0;i<n;i++)
	{
		if(a[i]>k)
		{
			k=a[i];
		}
	}
	for(i=0;i<n;i++)
	{
		if(a[i]>b&&a[i]!=k)
		{
			b=a[i];
		}
	}
	printf("%d\n%d\n",k,b);
	return 0;
}
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,n,m1=2,m2=0;
	int zzz[100];
	scanf("%d",&n);
	for(i=0;i<n;i++){
		scanf("%d",&zzz[i]);
	}
	for(i=0;i<n;i++){
		if(zzz[i]>m1){
			m1=zzz[i];
		}
	}
	for(i=0;i<n;i++){
		if(zzz[i]==m1){
			zzz[i]=0;
			break;
		}
	}
	for(i=0;i<n;i++){
		if(zzz[i]>m2){
			m2=zzz[i];
		}
	}
	printf("%d\n%d\n",m1,m2);
	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;

	return 0;
}
void main()
{
	int i,j,k,l,m,n,a[100];
	scanf("%d",&n);
	for(i=1;i<=n;i++)
		scanf("%d",&a[i]);
	m=a[1];
	for(i=2;i<=n;i++)
	{
		if(a[i]>m)
			m=a[i];
	}
	printf("%d\n",m);
    for(i=1;i<=n;i++)
	{
		if(a[i]<m)
			k=a[i];
		break;
	}
	for(i=1;i<=n;i++)
	{
		if(a[i]>k&&a[i]<m)
			k=a[i];
	}
	printf("%d",k);
}
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 x,i,j,t,sz[100];
	scanf("%d\n",&x);	
	for(i=0;i<x;i++){
		scanf("%d\n",&sz[i]);		
	}
	for(i=x;i<100;i++){
	sz[i]=0;
	}
	for(j=0;j<99;j++)
		for(i=0;i<99-j;i++){
			if(sz[i]>sz[i+1]){
		t=sz[i];sz[i]=sz[i+1];sz[i+1]=t;
			}
		}
		printf("%d\n%d\n",sz[99],sz[98]);
	return 0;
}
int main(){
	int e,n,i,sz[100];
	scanf("%d\n",&n);
	i=1;
	while(i<=n){
		scanf("%d",&sz[i]);
		i++;
	}
	for(int k=1;k<=n;k++){
		for(i=1;i<=k;i++){
			if(sz[i]>sz[i+1]){
				e=sz[i+1];
				sz[i+1]=sz[i];
				sz[i]=e;
			}
		}
	}
	printf("%d\n%d\n",sz[n],sz[n-1]);
	return 0;
}
int main()
{
	int a[100];
	int n,i,j,m,max;
	scanf("%d",&n);
	for (i=0;i<n;i++){
		scanf("%d",&a[i]);
	};
    for (j=0;j<2;j++){
		max=a[j];
		for (i=j+1;i<n;i++){
			if (a[i]>a[j]){
				m=a[i];
				a[i]=a[j];
				a[j]=m;
			}
		}
	}
		printf("%d\n",a[0]);
		printf("%d\n",a[1]);
	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;
}
int main()
{
	int a[100],i,n,j,temp;
	scanf("%d",&n);
	for(i=1;i<=n;i++)
		scanf("%d",&a[i]);
	for(j=1;j<=2;j++)
	{
		for(i=2;i<=n;i++)
		{
			if(a[j]<a[i])
			{
				temp=a[j];
			    a[j]=a[i];
			    a[i]=temp;
			}
		}
	}
	printf("%d\n%d",a[1],a[2]);
}
int main()
{
    int a[100];
    int i;
    int n;
    int e=0,f=0;
    scanf("%d",&n);
    for(i=0;i<n;i++)
	{
    scanf("%d",&a[i]);
	}
    for(i=0;i<n;i++)
	{
    if(e<=a[i])
	{
    e=a[i];
	}

	}
    for(i=0;i<n;i++)
	{
    if(f<=a[i])
	{
     if(a[i]==e)
	 {
      continue;
	 }
      f=a[i]; 
	}
	}
    printf("%d\n%d\n",e,f);
    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 n;
	int a[100],c[100];
	int i,b;
	int x=0;
	int y=0;

	scanf ("%d", &n);
	for (i=0; i<n; i++) {
		scanf ("%d", &a[i]);
	}
	for (i=0; i<n; i++) {
		b=a[i];
		if (b>x) {
			x=b;
		}
	}
	for (i=0; i<n; i++) {
		if (a[i]!=x){
			c[i]=a[i];
		}
	}
	for (i=0; i<n; i++) {
		b=c[i];
		if (b>y) {
			y=b;
		}
	}
	printf("%d\n",x);
	printf("%d\n",y);
	return 0;
}