semeru/Code-Code-CloneDetection-POJ104 huggingface dataset:
/*;
 * 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;

	}
}
void main()
{
	int i,j[50],t,a=0,b=0;
	float GPA;
	scanf("%d",&i);
		for(t=0;t<2*i;t++)
		scanf("%d",&j[t]);
for(t=i;t<2*i;t++)
{	if(j[t]>=90)j[t]=40 ;
else if (j[t]>=85&&j[t]<=89)  j[t]=37;
else if (j[t]>=82&&j[t]<=84)  j[t]=33; 
else if (j[t]>=78&&j[t]<=81)  j[t]=30; 
else if (j[t]>=75&&j[t]<=77)  j[t]=27; 
else if (j[t]>=72&&j[t]<=74)  j[t]=23; 
else if (j[t]>=68&&j[t]<=71)  j[t]=20; 
else if (j[t]>=64&&j[t]<=67)  j[t]=15; 
else if (j[t]>=60&&j[t]<=63)  j[t]=10;
else j[t]=0; }
for(t=0;t<i;t++)
j[t+i]=j[t]*j[t+i];
for(t=0;t<i;t++)
{   a=a+j[t+i];
b=b+j[t];}
GPA=(float)a/10.0/b;
printf("%.2f",GPA);
}
int main()
{int a[10],b[10];
 float c[10],e;
 int n,i,f;
 scanf("%d",&n);
 for(i=0;i<n;i++)
    { 
     scanf("%d",&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;  
      }
 c[0]=a[0]*c[0];
 for(i=1;i<n;i++)
  {
   e=c[i]=a[i]*c[i]+c[i-1];
   f=a[i]=a[i]+a[i-1]; 
  }
 printf("%.2f",e/f) ;
 scanf("%d",&n);
 return 0;
}
int s=0;
int g[10],p[10],n;
float grade=0;

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

int main()
{
int i;
scanf("%d",&n);
for(i=0;i<n;i++)
{
scanf("%d",&g[i]);
s+=g[i];
}
for(i=0;i<n;i++)
{
scanf("%d",&p[i]);
}
for(i=0;i<n;i++)
{
grade+=gpa(p[i])*g[i];
}
printf("%.2f\n",grade/s);
return 0;
}
void main()
{
	int n,i,j;
    double b,c,d,e,GPA;d=0;e=0;
	scanf("%d\n",&n);
	int a[3][11];
    for(j=1;j<=n;j++)   
	{scanf("%d ",&a[1][j]); e=e+a[1][j] ;}
	for(i=1;i<=n;i++)
	{scanf("%d ",&a[2][i]);
	if(a[2][i]>=90&&a[2][i]<=100) b=4.0;
	else if(a[2][i]>=85&&a[2][i]<=89) b=3.7;
	else if(a[2][i]>=82&&a[2][i]<=84) b=3.3;
	else if(a[2][i]>=78&&a[2][i]<=81) b=3.0;
	else if(a[2][i]>=75&&a[2][i]<=77) b=2.7;
	else if(a[2][i]>=72&&a[2][i]<=74) b=2.3;
	else if(a[2][i]>=68&&a[2][i]<=71) b=2.0;
	else if(a[2][i]>=64&&a[2][i]<=67) b=1.5;
	else if(a[2][i]>=60&&a[2][i]<=63) b=1.0;
	else b=0;
    c=b*a[1][i];d=d+c;}
    GPA=d/e;
	printf("%.2f",GPA) ;    
	}
void main(void)
{
	int n,point[11],score[11],i,j,k,l,p=0;
	float gpa[11],g=0.0,pa;
	scanf("%d\n",&n);
	for(i=1;i<=n;i++)scanf("%d",&point[i]);
	for(j=1;j<=n;j++)p=p+point[j];
	for(k=1;k<=n;k++)scanf("%d",&score[k]);
	for(k=1;k<=n;k++)
	{
		
		if(90<=score[k],score[k]<=100)gpa[k]=4.0;
		if(85<=score[k],score[k]<=89)gpa[k]=3.7;
		if(82<=score[k],score[k]<=84)gpa[k]=3.3;
		if(78<=score[k],score[k]<=81)gpa[k]=3.0;
		if(75<=score[k],score[k]<=77)gpa[k]=2.7;
		if(72<=score[k],score[k]<=74)gpa[k]=2.3;
		if(68<=score[k],score[k]<=71)gpa[k]=2.0;
		if(64<=score[k],score[k]<=67)gpa[k]=1.5;
		if(60<=score[k],score[k]<=63)gpa[k]=1.0;
		if(score[k]<60)gpa[k]=0.0;
	}
	for(l=1;l<=n;l++)g=g+(point[l]*gpa[l]);
	pa=g/p;
	printf("%.2f",pa);
}
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;
}
int main(){
	int n;
	double GPA;
	scanf("%d",&n);
	int sf[n],df[n];
	double x;
	for(int i=0;i<n;i++){
		scanf("%d",&sf[i]);
		x=x+sf[i];
	}
	double q=0,f=0;
	for(int m=0;m<n;m++){
		scanf("%d",&df[m]);
		if(df[m]>=90){
			q=4.0;
}else if(df[m]>=85){
q=3.7;
}else if(df[m]>=82){
q=3.3;
}else if(df[m]>=78){
q=3.0;
}else if(df[m]>=75){
q=2.7;
}else if(df[m]>=72){
q=2.3;
}else if(df[m]>=68){
q=2.0;
}else if(df[m]>=64){
q=1.5;
}else if(df[m]>=60){
q=1.0;
}else{
q=0;
}
f=f+q*sf[m];

	}
	
	GPA=f/x;
	printf("%.2lf",GPA);
	return 0;
}
int main()
{
	int n,a[10],b[10],i,s=0;
	float GPA=0.0,m[10];
	scanf("%d",&n);
	for(i=0;i<n;i++){
		scanf("%d",&a[i]);
        s+=a[i];
	}
    for(i=0;i<n;i++){
	scanf("%d",&b[i]);
	}
    for(i=0;i<n;i++){
		if(b[i]>=90 && b[i]<=100)
          m[i]=4.0*(a[i]) ;
		if(b[i]>=85 && b[i]<=89)
          m[i]=3.7*(a[i]) ;
        if(b[i]>=82 && b[i]<=84)
          m[i]=3.3*(a[i]) ;
        if(b[i]>=78 && b[i]<=81)
          m[i]=3.0*(a[i]) ;
        if(b[i]>=75 && b[i]<=77)
          m[i]=2.7*(a[i]) ;
          if(b[i]>=72 && b[i]<=74)
          m[i]=2.3*(a[i]) ;
if(b[i]>=68 && b[i]<=71)
          m[i]=2.0*(a[i]) ;
if(b[i]>=64 && b[i]<=67)
          m[i]=1.5*(a[i]) ;
if(b[i]>=60 && b[i]<=63)
          m[i]=1.0*(a[i]) ;
if(b[i]<60)
          m[i]=0 ;
GPA+=m[i];
	}
    
	printf("%.2f",GPA/s);
	return 0;
}
void main()
{
int a[10],b[10],n,i,j,d=0;
float c[10],e=0.0,GPA;
scanf("%d\n",&n);
for(i=0;i<n;i++)
scanf("%d",&a[i]);
scanf("\n");
for(i=0;i<n;i++)
scanf("%d",&b[i]);

for(j=0;j<n;j++)
  {if(b[j]>=90&&b[j]<=100) c[j]=4.0;
   else if(b[j]>=85&&b[j]<=89) c[j]=3.7;
   else if(b[j]>=82&&b[j]<=84) c[j]=3.3;
   else if(b[j]>=78&&b[j]<=81) c[j]=3.0;
   else if(b[j]>=75&&b[j]<=77) c[j]=2.7;
   else if(b[j]>=72&&b[j]<=74) c[j]=2.3;
   else if(b[j]>=68&&b[j]<=71) c[j]=2.0;
   else if(b[j]>=64&&b[j]<=67) c[j]=1.5;
   else if(b[j]>=60&&b[j]<=63) c[j]=1.0;
   else c[j]=0.0;
    d=d+a[j];
    e=e+c[j]*a[j];
   }
GPA=e/(d+0.0);
printf("%.2f",GPA);
}
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 n,i,j,m;
  int a[10],b[10];
  float GPA,e[10],k,p;
  scanf("%d\n",&n);
  for(i=0;i<n-1;i++){
   scanf("%d ",&a[i]);
   }
  scanf("%d\n",&a[n-1]);
  scanf("%d",&b[0]);
  for(i=1;i<n;i++){
   scanf(" %d",&b[i]);
  }
 for(m=0,i=0;i<n;i++){
  m+=a[i];
    }
  for(i=0,k=0;i<n;i++){
    if(b[i]>=90&&b[i]<=100){
      e[i]=4.0;
   }
    if(b[i]>=85&&b[i]<=89){
      e[i]=3.7;
   }
     if(b[i]>=82&&b[i]<=84){
       e[i]=3.3;
   }
      if(b[i]>=78&&b[i]<=81){
       e[i]=3.0;
   }
      if(b[i]>=75&&b[i]<=77){
       e[i]=2.7;
   }
      if(b[i]>=72&&b[i]<=74){
       e[i]=2.3;
   }
      if(b[i]>=68&&b[i]<=71){
        e[i]=2.0;
   }
     if(b[i]>=64&&b[i]<=67){
         e[i]=1.5;
    }
      if(b[i]>=60&&b[i]<=63){
         e[i]=1.0;
     }
      if(b[i]<60){
        e[i]=0;
     }
     p=a[i];
    k+=(float)(e[i]*p);
   }
   GPA=(float)k/(m*1.0);
   printf("%.2f",GPA);
    return 0;
}
float jd(int x){
	if(90<=x&&x<=100){return 4.0;}
	if(85<=x&&x<=89){return 3.7;}
	if(82<=x&&x<=84){return 3.3;}
	if(78<=x&&x<=81){return 3.0;}
	if(75<=x&&x<=77){return 2.7;}
	if(72<=x&&x<=74){return 2.3;}
	if(68<=x&&x<=71){return 2.0;}
	if(64<=x&&x<=67){return 1.5;}
	if(60<=x&&x<=63){return 1.0;}
	else{return 0;}
	}
int main(){
	int x;
	int n,zxf=0;
	float zjd=0;
	float a; 
	int cj[10],xf[10];
	scanf("%d",&n);
	int i=0;
	while(i<n){
		scanf("%d",&xf[i]);
		i++;}
	i=0;
	while(i<n){
		scanf("%d",&cj[i]);
		i++;}
	i=0;
	while(i<n){
		zxf+=xf[i];
		i++;}
	i=0;
	while(i<n){
		zjd+=(jd(cj[i])*xf[i]);
		i++;}                        
a=1.0*zjd/zxf;
printf("%.2f",a);
}
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;
}
int main(){
int p,q,i,j,k,n,a[100],b[100];
double c[100],GPA,m,r;
scanf("%d",&n);
for(i=0;i<n;i++){
scanf("%d",&(a[i]));
}
for(j=0;j<n;j++){
scanf("%d",&(b[j]));
}
for(k=0;k<n;k++){
	if((b[k])>=90&&b[k]<=100){
	c[k]=(double)(4.0)*(a[k]);
	}
	else if((b[k])>=85&&b[k]<=89){
	c[k]=(double)(3.7)*(a[k]);
	}
    else if((b[k])>=82&&b[k]<=84){
	c[k]=(double)(3.3)*(a[k]);
	}
	else if((b[k])>=78&&b[k]<=81){
	c[k]=(double)(3.0)*(a[k]);
	}
	else if((b[k])>=75&&b[k]<=77){
	c[k]=(double)(2.7)*(a[k]);
	}
	else if((b[k])>=72&&b[k]<=74){
	c[k]=(double)(2.3)*(a[k]);
	}
	else if((b[k])>=68&&b[k]<=71){
	c[k]=(double)(2.0)*(a[k]);
	}
	else if((b[k])>=64&&b[k]<=67){
	c[k]=(double)(1.5)*(a[k]);
	}
	else if((b[k])>=60&&b[k]<=63){
	c[k]=(double)(1.0)*(a[k]);
	}
	else if(b[k]<60){
	c[k]=(double)(0.0)*(a[k]);
	}
}
m=0;
for(p=0;p<n;p++){
m=m+c[p];
}
r=0;
for(q=0;q<n;q++){
r=r+a[q];
}
GPA=(double)m/r;
printf("%.2f",GPA);
return 0;
}
int main(){
int n;
int xf[10];
int cj[10];
double G[10];
double a=4.0,b=3.7,c=3.3,d=3.0,e=2.7,f=2.3,g=2.0,h=1.5,i=1.0;
double GPA;
double sum=0;
double J=0;
double Z=0;
int z=0;
scanf("%d",&n);
for(int l=0;l<n;l++){
	scanf("%d",&(xf[l]));
}
for(int k=0;k<n;k++){
	scanf("%d",&(cj[k]));
	if(cj[k]>=90&&cj[k]<=100){G[k]=a;}
	else if(cj[k]>=85&&cj[k]<=89){G[k]=b;}
	else if(cj[k]>=82&&cj[k]<=84){G[k]=c;}
	else if(cj[k]>=78&&cj[k]<=81){G[k]=d;}
	else if(cj[k]>=75&&cj[k]<=77){G[k]=e;}
	else if(cj[k]>=72&&cj[k]<=74){G[k]=f;}
	else if(cj[k]>=68&&cj[k]<=71){G[k]=g;}	
	else if(cj[k]>=64&&cj[k]<=67){G[k]=h;}
	else if(cj[k]>=60&&cj[k]<=63){G[k]=i;}
	else if(cj[k]<60){G[k]=0;}
	}
for(int j=0;j<n;j++){
    J=1.0*G[j];
    z=xf[j];
	sum+=J*z;
	Z+=xf[j];
}

printf("%.2f",GPA=sum/Z);
return 0;
}
int main()
{
int n;
int a[2][10];
scanf("%d",&n);
int i,j;
float k=0.0,m=0.0,q=0.0;
for(i=0;i<2;i++)
{
for(j=0;j<n;j++)
{
scanf("%d",&a[i][j]);
}
}
for(j=0;j<n;j++)
{
if(a[1][j]>=90&&a[1][j]<=100)
k=k+4.0*a[0][j];
if(a[1][j]>=85&&a[1][j]<=89)
k=k+3.7*a[0][j];
if(a[1][j]>=82&&a[1][j]<=84)
k=k+3.3*a[0][j];
if(a[1][j]>=78&&a[1][j]<=81)
k=k+3.0*a[0][j];
if(a[1][j]>=75&&a[1][j]<=77)
k=k+2.7*a[0][j];
if(a[1][j]>=72&&a[1][j]<=74)
k=k+2.3*a[0][j];
if(a[1][j]>=68&&a[1][j]<=71)
k=k+2.0*a[0][j];
if(a[1][j]>=64&&a[1][j]<=67)
k=k+1.5*a[0][j];
if(a[1][j]>=60&&a[1][j]<=63)
k=k+1.0*a[0][j];
if(a[1][j]<60)
k=k;
}
for(j=0;j<n;j++)
{
m=m+a[0][j];
}
q=k/m;
printf("%.2f",q);
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);
}
int main(){
	int i,n,a[10],b[10];
	double c[10],GPA,f;
    GPA=0;
	f=0;
	scanf("%d",&n);
	for(i=0;i<n;i++){
		scanf("%d",&a[i]);
	}
	for(i=0;i<n;i++){
		scanf("%d",&b[i]);
		if(b[i]<=100 && b[i]>=90){
			c[i]=4.0;}
	    else if(b[i]<=89 && b[i]>=85){
			c[i]=3.7;}
		 else if(b[i]<=84 && b[i]>=82){
			c[i]=3.3;}
 else if(b[i]<=81 && b[i]>=78){
			c[i]=3.0;}
 else if(b[i]<=77 && b[i]>=75){
			c[i]=2.7;}
 else if(b[i]<=74 && b[i]>=72){
			c[i]=2.3;}
 else if(b[i]<=71 && b[i]>=68){
			c[i]=2.0;}
 else if(b[i]<=67 && b[i]>=64){
			c[i]=1.5;}
 else if(b[i]<=63 && b[i]>=60){
			c[i]=1.0;}
 else{c[i]=0;}
	}
 for(i=0;i<n;i++){
GPA+=(a[i]*c[i]);
f+=a[i];
}
GPA/= f;
	 printf("%.2lf",GPA);
	return 0;
		}
int main()
{
	double chengji[10],xuefen[10],total=0;
	int i,j,n;

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

	int a[10]={90,85,82,78,75,72,68,64,60};
	double b[10]={4.0,3.7,3.3,3.0,2.7,2.3,2.0,1.5,1.0,0};
	double sum=0;

	for (i=0;i<n;i++)
	{
		j=0;
		while (a[j]>chengji[i])
			j++;
		
		sum+=xuefen[i]*b[j];

	}
	sum /=total;
	printf("%.2f\n",sum);
	return 0;
}
int main(){
	int n;
	scanf("%d",&n);
	int a[11],b[11];
	int i;
	double c[11];
	double k;
	k=0.0;
	double p;
	p=0.0;
	for(i=0;i<n;i++){
		scanf("%d",&a[i]);
		p=p+a[i];
	}
	for(i=0;i<n;i++){
		scanf("%d",&b[i]);
		if(b[i]>=90&&b[i]<=100){
			c[i]=4.0;
		}
		else if(b[i]>=85&&b[i]<=89){
			c[i]=3.7;
		}
		else if(b[i]>=82&&b[i]<=84){
			c[i]=3.3;
		}
		else if(b[i]>=78&&b[i]<=81){
			c[i]=3.0;
		}
		else if(b[i]>=75&&b[i]<=77){
			c[i]=2.7;
		}
		else if(b[i]>=72&&b[i]<=74){
			c[i]=2.3;
		}
		else if(b[i]>=68&&b[i]<=71){
			c[i]=2.0;
		}
		else if(b[i]>=64&&b[i]<=67){
			c[i]=1.5;
		}
		else if(b[i]>=60&&b[i]<=63){
			c[i]=1.0;
		}
		else if(b[i]<60){
			c[i]=0.0;
		}
		k=k+c[i]*a[i];
	}
	double GPA;
	GPA=k/p;
	printf("%.2lf",GPA);
	return 0;
}
int main(int argc, char* argv[])
{int n,a[10],b[10],i,sum1=0;
 float c[10],d[10],sum2=0.0,GPA;
 scanf("%d",&n); 
 for(i=0;i<n;i++)
 {
	 scanf("%d",&a[i]);
     sum1+=a[i];
 }
 for(i=0;i<n;i++)
 {
	 scanf("%d",&b[i]);
     if     (b[i]>=90&&b[i]<=100) c[i]=4.0;
	 else if(b[i]>=85&&b[i]<=89) c[i]=3.7;
	 else if(b[i]>=82&&b[i]<=84) c[i]=3.3;
     else if(b[i]>=78&&b[i]<=81) c[i]=3.0;
	 else if(b[i]>=75&&b[i]<=77) c[i]=2.7;
     else if(b[i]>=72&&b[i]<=74) c[i]=2.3;
     else if(b[i]>=68&&b[i]<=71) c[i]=2.0;
     else if(b[i]>=64&&b[i]<=67) c[i]=1.5;
     else if(b[i]>=60&&b[i]<=63) c[i]=1.0;
	 else                        c[i]=0.0;
     d[i]=a[i]*c[i];
	 sum2+=d[i];
 }
 GPA=sum2/sum1;
 printf("%.2f",GPA);
	return 0;
}
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;
}
void main()
{
	int a[10],b[10];
	double c[10],sum=0,jd[10],e=0;
	int i,n;
	scanf("%d",&n);
	for(i=0;i<n;i++)
		scanf("%d",&a[i]);
	for(i=0;i<n;i++)
		scanf("%d",&b[i]);
	for(i=0;i<n;i++)
	{
		if(b[i]>=90)
			c[i]=4;
	    if(b[i]<90&&b[i]>=85)
			c[i]=3.7;
	    if(b[i]<85&&b[i]>=82)
			c[i]=3.3;
		if(b[i]<82&&b[i]>=78)
			c[i]=3.0;
		if(b[i]<78&&b[i]>=75)
			c[i]=2.7;
		if(b[i]<75&&b[i]>=72)
			c[i]=2.3;
		if(b[i]<72&&b[i]>=68)
			c[i]=2.0;
		if(b[i]<68&&b[i]>=64)
			c[i]=1.5;
		if(b[i]<64&&b[i]>=60)
			c[i]=1.0;
		if(b[i]<60)
			c[i]=0;
		jd[i]=c[i]*a[i];
	}
	for(i=0;i<n;i++)
	{
		sum=sum+jd[i];
		e=e+a[i];
	}
	sum=sum/e;
	printf("%.2f",sum);
}
int main()
{int n,xf[MAX],df[MAX],i,a;
double jd[MAX],b,GPA;
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;
     if(df[i]>=85&&df[i]<=89) jd[i]=3.7;
	 if(df[i]>=82&&df[i]<=84) jd[i]=3.3;
     if(df[i]>=78&&df[i]<=81) jd[i]=3.0;
	 if(df[i]>=75&&df[i]<=77) jd[i]=2.7;
	 if(df[i]>=72&&df[i]<=74) jd[i]=2.3;
     if(df[i]>=68&&df[i]<=71) jd[i]=2.0;
	 if(df[i]>=64&&df[i]<=67) jd[i]=1.5;
     if(df[i]>=60&&df[i]<=63) jd[i]=1.0;
	 if(df[i]>=0&&df[i]<60)	jd[i]=0.0;
	}
a=0;
             for(i=0;i<n;i++)
			 {a=a+xf[i];
			 }
b=0.0;
                for(i=0;i<n;i++)
				{b=b+1.0*xf[i]*jd[i];
				}
GPA=b/a;
printf("%.2f",GPA);
return 0;
}
double b(double x)
{
	if(x>=90&&x<=100)
	{
		return 4.0;
	}if(x>=85&&x<=89)
	{
		return 3.7;
	}if(x>=82&&x<=84)
	{
		return 3.3;
	}if(x>=78&&x<=81)
	{
		return 3.0;
	}if(x>=75&&x<=77)
	{
		return 2.7;
	}if(x>=72&&x<=74)
	{
		return 2.3;
	}if(x>=68&&x<=71)
	{
		return 2.0;
	}if(x>=64&&x<=67)
	{
		return 1.5;
	}if(x>=60&&x<=63)
	{
		return 1.0;
	}if(x<60&&x>=0)
	{
		return 0;
	}
}
int main()
{
	double *p,*q,GPA,sum=0,total=0,a;
	int	n,i;
	scanf("%d",&n);
	p=(double *)malloc(sizeof(double)*n);
	q=(double *)malloc(sizeof(double)*n);
	for(i=0;i<n;i++)
	{
		scanf("%lf",&p[i]);
		total+=p[i];
	}
	for(i=0;i<n;i++)
	{
		scanf("%lf",&q[i]);
	}
	for(i=0;i<n;i++)
	{
		a=b(q[i]);
		sum+=a*p[i];
	}
	GPA=sum/total;
	printf("%.2f",GPA);
	free(p);
	free(q);
	return 0;
}
void main()
{
	int n,i,k,t,a[2][10];
	float sum ;
	scanf("%d",&n);
	for(k=0;k<2;k++)
	for (i=0;i<n;i++)
		scanf("%d",&a[k][i]);
 
	sum=0;
	for (i=0;i<n;i++)
	{
		if (a[1][i]<=100&&a[1][i]>=90)
			sum=sum+4.0*a[0][i];
		else if (a[1][i]<=89&&a[1][i]>=85)
			sum=sum+3.7*a[0][i];
		else if (a[1][i]<=84&&a[1][i]>=82)
			sum=sum+3.3*a[0][i];
		else if (a[1][i]<=81&&a[1][i]>=78)
			sum=sum+3.0*a[0][i];
        else if (a[1][i]<=77&&a[1][i]>=75)
			sum=sum+2.7*a[0][i];
		else if (a[1][i]<=74&&a[1][i]>=72)
			sum=sum+2.3*a[0][i];
		else if (a[1][i]<=71&&a[1][i]>=68)
			sum=sum+2.0*a[0][i];
	   else 	if (a[1][i]<=67&&a[1][i]>=64)
			sum=sum+1.5*a[0][i];
        else	if (a[1][i]<=63&&a[1][i]>=60)
			sum=sum+1.0*a[0][i];
	else 	if (a[1][i]<=60 )
			sum=sum ;
	}
	t=0;
	for (i=0;i<n;i++)
		t=t+a[0][i];
	sum=sum/t;
	printf("%.2f",sum);
}
void main()
{
	int n,i,a[10],b[10],e[10],mark[10];
	float GPA,c=0,d=0;
	scanf("%d",&n);
	for(i=0;i<n;i++)
	{
		scanf("%d",&b[i]);
		c=c+b[i];
	}
	for(i=0;i<n;i++)
	{
		scanf("%d",&a[i]);
	}
	for(i=0;i<n;i++)
	{
		if((a[i]>=90)&&(a[i]<=100))
			mark[i]=40;
		else if((a[i]>=85)&&(a[i]<=89))
			mark[i]=37;
		else if((a[i]>=82)&&(a[i]<=84))
			mark[i]=33;
		else if((a[i]>=78)&&(a[i]<=81))
			mark[i]=30;
		else if((a[i]>=75)&&(a[i]<=77))
			mark[i]=27;
		else if((a[i]>=72)&&(a[i]<=74))
			mark[i]=23;
		else if((a[i]>=68)&&(a[i]<=71))
			mark[i]=20;
		else if((a[i]>=64)&&(a[i]<=67))
			mark[i]=15;
		else if((a[i]>=60)&&(a[i]<=63))
			mark[i]=10;
		else mark[i]=0;
	}
	for(i=0;i<n;i++)
	{
		e[i]=b[i]*mark[i];
		d=d+e[i];
	}
	GPA=d/(c*10);
	printf("%.2f\n",GPA);
}
int main (){
    int i,n,x;
    int sz[10];
    int xf[10];
    double js[10];
    double j,z;
    x=0;
    j=0.0;
    scanf("%d",&n);
    for (i=0;i<n;i++){
        scanf("%d",&(xf[i]));
        x+=xf[i];
    }
    for(i=0;i<n;i++){
        scanf("%d",&(sz[i]));
        if(sz[i]<60){
            js[i]=0.0;
        }
        else if(sz[i]<64&&sz[i]>59){
            js[i]=1.0;
        }
        else if(sz[i]<68&&sz[i]>63){
            js[i]=1.5;
        }
        else if(sz[i]<72&&sz[i]>67){
            js[i]=2.0;
        }
        else if(sz[i]<75&&sz[i]>71){
            js[i]=2.3;
        }
        else if(sz[i]<78&&sz[i]>74){
            js[i]=2.7;
        }
        else if(sz[i]<82&&sz[i]>77){
            js[i]=3.0;
        }    
        else if(sz[i]<85&&sz[i]>81){
            js[i]=3.3;
        }
        else if(sz[i]<90&&sz[i]>84){
            js[i]=3.7;
        }
        else {
            js[i]=4.0;
        }  
        j+=1.0*(js[i]*xf[i]);
    }
    z=1.0*j/x;
    printf("%.2lf\n",z);
    return 0;
}
main()
{     
     int i,j,k,m,n;
     int a[50],b[50];
     float sum=0;
     scanf("%d",&n);

                    m=0;
                    sum=0;
                    for(j=0;j<n;j++)
                    scanf("%d",&a[j]);
                    for(j=0;j<n;j++)
                    scanf("%d",&b[j]);
                    for(j=0;j<n;j++)
                    {if(b[j]<=100&&b[j]>=90)
                    sum=sum+(float)a[j]*4.0;
                    if(b[j]<=89&&b[j]>=85)
                    sum=sum+(float)a[j]*3.7;
                    if(b[j]<=84&&b[j]>=82)
                    sum=sum+(float)a[j]*3.3;
                    if(b[j]<=81&&b[j]>=78)
                    sum=sum+(float)a[j]*3.0;
                    if(b[j]<=77&&b[j]>=75)
                    sum=sum+(float)a[j]*2.7;
                    if(b[j]<=74&&b[j]>=72)
                    sum=sum+(float)a[j]*2.3;
                    if(b[j]<=71&&b[j]>=68)
                    sum=sum+(float)a[j]*2.0;
                    if(b[j]<=67&&b[j]>=64)
                    sum=sum+(float)a[j]*1.5;
                    if(b[j]<=63&&b[j]>=60)
                    sum=sum+(float)a[j]*1.0;}
                    for(j=0;j<n;j++)
                    m=m+a[j];
                    sum=(float)sum/m;
                    printf("%.2f\n",sum);
                                 
                                                      }
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;
}