semeru/Code-Code-CloneDetection-POJ104 huggingface dataset:
double JD(int a);
int main ()
{
    int n,a[10],i;
    double b[10],t,x=0,y=0;
    scanf("%d",&n);
    for(i=0;i<n;i++){scanf("%d",&a[i]);}
    for(i=0;i<n;i++){scanf("%lf",&b[i]);}
    
    
    for(i=0;i<n;i++)
        {
            b[i]=JD(b[i])*a[i];
        }
            for(i=0;i<n;i++){x=x+a[i];}
            for(i=0;i<n;i++){y=y+b[i];}
        
    t=y/x;
    printf("%.2lf",t);
    return 0;
    
}


double JD(int a)
{
    double s;
    if(a>=90)s=4.0;
    else if(a<90&&a>=85)s=3.7;
    else if(a<85&&a>=82)s=3.3;
    else if(a<82&&a>=78)s=3.0;
    else if(a<78&&a>=75)s=2.7;
    else if(a<75&&a>=72)s=2.3;
    else if(a<72&&a>=68)s=2.0;
    else if(a<68&&a>=64)s=1.5;
    else if(a<64&&a>=60)s=1.0;
    else s=0;
    return s;
}
int main()
{
	int n,ZXF,i,p;
	double GPA;
	scanf("%d",&n);
	int a[10];
	double b[10];
	for(i=0;i<n;i++)
	{
		scanf("%d",&a[i]);
	}
	for(i=0;i<n;i++)
	{
		scanf("%d",&p);
		if(p>=90)
			b[i]=4.0;
		else if(p>=85)
			b[i]=3.7;
		else if(p>=82)
			b[i]=3.3;
		else if(p>=78)
			b[i]=3.0;
		else if(p>=75)
			b[i]=2.7;
		else if(p>=72)
			b[i]=2.3;
		else if(p>=68)
			b[i]=2.0;
		else if(p>=64)
			b[i]=1.5;
		else if(p>=78)
			b[i]=1.0;
		else if(p>=78)
			b[i]=0;
	}
	ZXF=0;
	for(i=0;i<n;i++)
	{
		ZXF+=a[i];
	} 
	for(i=0;i<n;i++)
	{
		GPA+=1.0*a[i]/ZXF*b[i];
	} 
	printf("%.2lf",GPA);
	return 0;
}
float suan(int a[], int b[],int n,float d) 
{ 
	double c[10];
	int i=0;
	for(i=0;i<n;i++){
		if(b[i]<60)
			c[i]=0;
		else if(b[i]<64)
			c[i]=1.0*a[i];
		else if(b[i]<68)
			c[i]=1.5*a[i];
		else if(b[i]<72)
			c[i]=2.0*a[i];
		else if(b[i]<75)
			c[i]=2.3*a[i];
		else if(b[i]<78)
			c[i]=2.7*a[i];
		else if(b[i]<82)
			c[i]=3.0*a[i];
		else if(b[i]<85)
			c[i]=3,3*a[i];
		else if(b[i]<90)
			c[i]=3.7*a[i];
		else
			c[i]=4.0*a[i];
	}
	float e=0;
	for(i=0;i<n;i++){
		e=e+a[i];
	}
	for(i=0;i<n;i++){
		d=d+c[i];
	}
	d=d/e;
	return d;
}
int main(){
	int n,a[10],b[10];
	int j;
	scanf("%d",&n);
	for(j=0;j<n;j++){
		scanf("%d",&a[j]);
	}
	for(j=0;j<n;j++){
		scanf("%d",&b[j]);
	}
	float GPA=0;
	GPA=suan(a,b,n,GPA);
	printf("%.2f",GPA);
	return 0;
}
void main()
{
	int n,i,t;
	int xuefen[10],chengji[10];
	float xuefenjidian[10],jidian[10],sum1=0,sum2=0,zongping;
	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&&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 if(chengji[i]>=0&&chengji[i]<=59)
		jidian[i]=0;
		xuefenjidian[i]=xuefen[i]*jidian[i];
	}
	for(i=0;i<n;i++)
	{
		sum1=sum1+xuefenjidian[i];
		sum2=sum2+xuefen[i];
	}
	zongping=sum1/sum2;
	printf("%.2f",zongping);
}
int main()
{
    int b[2][10];
    int xuefen=0,i,j,n;
    float zong=0.0;
    float GPA;
    scanf("%d",&n);
    for(i=0;i<=1;i++)
    {
                     for(j=0;j<=n-1;j++)
                     {
                                        scanf("%d",&b[i][j]);
                                        if(i==0)
                                        xuefen=xuefen+b[i][j];
                                        if(i==1)
                                        {
                                               if(b[i][j]>=90&&b[i][j]<=100)
                                               zong=zong+4*b[0][j];
                                                if(b[i][j]>=85&&b[i][j]<=89)
                                               zong=zong+3.7*b[0][j];
                                                if(b[i][j]>=82&&b[i][j]<=84)
                                               zong=zong+3.3*b[0][j];
                                                if(b[i][j]>=78&&b[i][j]<=81)
                                               zong=zong+3.0*b[0][j];
                                                if(b[i][j]>=75&&b[i][j]<=77)
                                               zong=zong+2.7*b[0][j];
                                                if(b[i][j]>=72&&b[i][j]<=74)
                                               zong=zong+2.3*b[0][j];
                                                if(b[i][j]>=68&&b[i][j]<=71)
                                               zong=zong+2*b[0][j];
                                                if(b[i][j]>=64&&b[i][j]<=67)
                                               zong=zong+1.5*b[0][j];
                                                if(b[i][j]>=60&&b[i][j]<=63)
                                               zong=zong+1*b[0][j];
                                        }
                     
                    }
    }
    GPA=(float)zong/xuefen;
     printf("%.2f",GPA);
  
    
}
void main()
{int a[100],b[100];
float c[100];
float sum,GPA;
int n,i,j,p,d;
sum=0;
d=0;
scanf("%d",&n);
for(i=0;i<n;i++)
scanf("%d",&a[i]);
for(j=0;j<n;j++)
scanf("%d",&b[j]);
for(p=0;p<n;p++)
{if(b[p]>=90) c[p]=4;
 if(b[p]<90&&b[p]>84) c[p]=3.7;
 if(b[p]<85&&b[p]>81) c[p]=3.3;
 if(b[p]<82&&b[p]>77) c[p]=3.0;
 if(b[p]<78&&b[p]>74) c[p]=2.7;
 if(b[p]<75&&b[p]>71) c[p]=2.3;
 if(b[p]<72&&b[p]>67) c[p]=2.0;
 if(b[p]<68&&b[p]>63) c[p]=1.5;
 if(b[p]<64&&b[p]>59) c[p]=1.0;
 if(b[p]<60) c[p]=0;}
for(p=0;p<n;p++)
{sum=sum+a[p]*c[p];
d=d+a[p];}
GPA=sum/d;
printf("%.2f",GPA);
}
void main()
{
	int n,i,x;float s1,s2;
	int xf[10],cj[10];
	float jd[10];
	scanf("%d",&n);
	s1=0;s2=0;
	switch(n)
	{case 9:scanf("%d %d %d %d %d %d %d %d %d",&xf[1],&xf[2],&xf[3],&xf[4],&xf[5],&xf[6],&xf[7],&xf[8],&xf[9]);
			scanf("%d %d %d %d %d %d %d %d %d",&cj[1],&cj[2],&cj[3],&cj[4],&cj[5],&cj[6],&cj[7],&cj[8],&cj[9]);
			break;
	case 8:scanf("%d %d %d %d %d %d %d %d",&xf[1],&xf[2],&xf[3],&xf[4],&xf[5],&xf[6],&xf[7],&xf[8]);
			scanf("%d %d %d %d %d %d %d %d",&cj[1],&cj[2],&cj[3],&cj[4],&cj[5],&cj[6],&cj[7],&cj[8]);
			break;
	case 7:scanf("%d %d %d %d %d %d %d",&xf[1],&xf[2],&xf[3],&xf[4],&xf[5],&xf[6],&xf[7]);
			scanf("%d %d %d %d %d %d %d",&cj[1],&cj[2],&cj[3],&cj[4],&cj[5],&cj[6],&cj[7]);
			break;
	case 6:scanf("%d %d %d %d %d %d",&xf[1],&xf[2],&xf[3],&xf[4],&xf[5],&xf[6]);
			scanf("%d %d %d %d %d %d",&cj[1],&cj[2],&cj[3],&cj[4],&cj[5],&cj[6]);
			break;
	case 5:scanf("%d %d %d %d %d",&xf[1],&xf[2],&xf[3],&xf[4],&xf[5]);
			scanf("%d %d %d %d %d",&cj[1],&cj[2],&cj[3],&cj[4],&cj[5]);
			break;
	case 4:scanf("%d %d %d %d",&xf[1],&xf[2],&xf[3],&xf[4]);
			scanf("%d %d %d %d",&cj[1],&cj[2],&cj[3],&cj[4]);
			break;
	case 3:scanf("%d %d %d",&xf[1],&xf[2],&xf[3]);
			scanf("%d %d %d",&cj[1],&cj[2],&cj[3]);
			break;
	case 2:scanf("%d %d",&xf[1],&xf[2]);
			scanf("%d %d",&cj[1],&cj[2]);
			break;
	case 1:scanf("%d",&xf[1]);
			scanf("%d",&cj[1]);
			break;
	}
	for(i=1;i<=n;i++)
	{
		x=cj[i];
		if(x>=90 && x<=100) jd[i]=4.0; 
		else if(x>=85 && x<=89) jd[i]=3.7;
		else if(x>=82 && x<=84) jd[i]=3.3; 
		else if(x>=78 && x<=81) jd[i]=3.0;
		else if(x>=75 && x<=55) jd[i]=2.7;
		else if(x>=72 && x<=74) jd[i]=2.3;
		else if(x>=68 && x<=71) jd[i]=2.0;
		else if(x>=64 && x<=67) jd[i]=1.5;
		else if(x>=60 && x<=63) jd[i]=1.0;
		else jd[i]=0;
		
		s1+=jd[i]*xf[i];
		s2+=xf[i];
	}
	printf("%.2f\n",s1/s2);
}
int main()
{
	int n,i,z=0;
	int a[10];
	int b[10];
	float c[10],g,y=0,t[10]={0};
	scanf("%d",&n);
	for(i=0;i<n;i++)
	{
		scanf("%d",&a[i]);
                  z=z+a[i];
	}
	for(i=0;i<n;i++)
	{
                  scanf("%d",&b[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 if(b[i]<60)
			{c[i]=0;}
		t[i]=c[i]*a[i];
	         y=y+t[i];
	}
	g=y/z;
	printf("%.2f",g);
	return 0;
}
void main()
{
	int n=0,i=0;
	int a[10]={0},b[10]={0};
	double c[10]={0},GPA=0,sum_1=0,sum_2=0;
	scanf("%d",&n);
	for(;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]<60)
			c[i]=0;
		if(b[i]>=60&&b[i]<=63)
			c[i]=1;
		if(b[i]>=64&&b[i]<=67)
			c[i]=1.5;
		if(b[i]>=68&&b[i]<=71)
			c[i]=2;
		if(b[i]>=72&&b[i]<=74)
			c[i]=2.3;
		if(b[i]>=75&&b[i]<=77)
			c[i]=2.7;
		if(b[i]>=78&&b[i]<=81)
			c[i]=3;
		if(b[i]>=82&&b[i]<=84)
			c[i]=3.3;
		if(b[i]>=85&&b[i]<=89)
			c[i]=3.7;
		if(b[i]>=90&&b[i]<=100)
			c[i]=4;
	}
	for(i=0;i<n;i++)
		sum_1+=a[i]*c[i];
	for(i=0;i<n;i++)
		sum_2+=a[i];
	GPA=sum_1/sum_2;
	printf("%.2lf",GPA);
}
int main(){
	int n, z=0;
	float p, q, s=0, GPA;
	scanf("%d", &n);
	int a[10];
	int i=0;
	for(i=0;i<n; i++){
		scanf("%d", &a[i]);
	}
	int b[10];
	for(i=0;i<n; i++){
		scanf("%d", &b[i]);
	}
	for(i=0;i<n; i++){
		int m=(b[i]);
		p=m>=90?4.0:m>=85?3.7:m>=82?3.3:m>=78?3.0:m>=75?2.7:m>=72?2.3:m>=68?2.0:m>=64?1.5:m>=60?1.0:0;
		q=p*(a[i]);
		s=s+q;
		z=z+(a[i]);
	}
	GPA=s/z;
	printf("%.2f",GPA);
		return 0;
}
int main()
{
	int c, n, i, x[20], sx=0;
	double GPA=0.0;
	scanf("%d", &n);
	for(int k=0; k<n; k++)
	{
		scanf("%d", &x[k]);
	}
	for(i=0; i<n; i++)
	{
		scanf("%d", &c);
		if(c>=90&&c<=100) GPA+=x[i]*4.0;
		if(c>=85&&c<=89) GPA+=x[i]*3.7;
		if(c>=82&&c<=84) GPA+=x[i]*3.3;
		if(c>=78&&c<=81) GPA+=x[i]*3.0;
		if(c>=75&&c<=77) GPA+=x[i]*2.7;
		if(c>=72&&c<=74) GPA+=x[i]*2.3;
		if(c>=68&&c<=71) GPA+=x[i]*2.0;
		if(c>=64&&c<=67) GPA+=x[i]*1.5;
		if(c>=60&&c<=63) GPA+=x[i]*1.0;
		if(c<=59) GPA+=0.0;
		sx+=x[i];
	}
	printf("%.2lf", GPA/sx*1.0);
	return 0;
}
int main()
{
    int score[10] = {90, 85, 82, 78, 75, 72, 68, 64, 60, 0};
    double gpa[10] = {4.0, 3.7, 3.3, 3.0, 2.7, 2.3, 2.0, 1.5, 1.0, 0};
    int s;
    double g;    
    int i, j, a, b, c;
    double e=0, f=0, GPA;
    scanf("%d", &b);
    int all[10], real[10];
    for(i=0;i<b;i++)
       scanf("%d", &all[i]);
    for(i=0;i<b;i++)
       scanf("%d", &real[i]);
    
    for(i=0;i<b;i++) {
        for(j=0; j<10; j++)
        {
             if (real[i]>=score[j]) 
             {
                  g=gpa[j];
                  break;
             }
        }
        e+=g*all[i];    
        f+=all[i];
    }
    GPA=e/f;
    printf("%.2lf",GPA);	
}
int main (){
     int n;
     scanf("%d",&n);
     int sz[n];
     int st[n];
     double a,t=0,m=0,GPA;
     for (int i=0;i<n;i++){
         scanf("%d",&(st[i]));
         t+=st[i];
     }
     for(int i=0;i<n;i++){
         scanf("%d",&(sz[i]));
         if(sz[i]>89.0){
             a=4.0;
         }
         else if(sz[i]<90.0&&sz[i]>84.0){
             a=3.7;
         }
         else if(sz[i]>81.0&&sz[i]<85.0){
             a=3.3;
         }
         else if(sz[i]>77.0&&sz[i]<82.0){
             a=3.0;
         }
         else if(sz[i]>74.0&&sz[i]<78.0){
             a=2.7;
         }
         else if(sz[i]>71.0&&sz[i]<75.0){
             a=2.3;
         }
         else if(sz[i]>67.0&&sz[i]<72.0){
             a=2.0;
         }
         else if(sz[i]>63.0&&sz[i]<68.0){
             a=1.5;
         }
         else if(sz[i]>59.0&&sz[i]<64.0){
             a=1.0;
         }
         else {a=0;}
         m+=a*st[i];
     }
    GPA=m/t;
     printf("%.2lf",GPA);
     return 0;
 }
int main(){
    int n,i;
    scanf("%d",&n);
    double a,b,c,x[n],y[n];
    for(i=0;i<n;i++){
        scanf("%lf",&y[i]);
    }
    for(i=0;i<n;i++){
        scanf("%lf",&x[i]);
    }
    for(i=0;i<n;i++){
        if(x[i]>=90){
            x[i]=4.0;
        }
        else if(x[i]>=85&&x[i]<=89){
            x[i]=3.7;
        }
        else if(x[i]>=82&&x[i]<=84){
            x[i]=3.3;
        }
        else if(x[i]>=78&&x[i]<=81){
            x[i]=3.0;
        }
        else if(x[i]>=75&&x[i]<=77){
            x[i]=2.7;
        }
        else if(x[i]>=72&&x[i]<=74){
            x[i]=2.3;
        }
        else if(x[i]>=68&&x[i]<=71){
            x[i]=2.0;
        }
        else if(x[i]>=64&&x[i]<=67){
            x[i]=1.5;
        }
        else if(x[i]>=60&&x[i]<=63){
            x[i]=1.0;
        }
        else if(x[i]<60){
            x[i]=0;
        }
    }
    a=0;
    for(i=0;i<n;i++){
        a=a+x[i]*y[i];
    }
    c=0;
    for(i=0;i<n;i++){
        c=c+y[i];
    }
    b=a/c;
    printf("%.2lf",b);
    return 0;
}
int main()
{
	int n[10],score[10];
	int k,i,m;
	double jd[10];
	double a,sum;
	m=0;
	sum=0.0;
	scanf("%d",&k);
	for(i=0;i<k;i++)
	{
		scanf("%d",&n[i]);
		m+=n[i];
	}
	i=0;
	while(i<k)
	{
		scanf("%d",&score[i]);
		if(score[i]>=90)
		{
			jd[i]=4.0;
		}else
		{
			if((score[i]>=85)&&(score[i]<90))
			{
				jd[i]=3.7;
			}else
			{
				if((score[i]>=82)&&(score[i]<85))
				{
					jd[i]=3.3;
				}else
				{
					if((score[i]>=78)&&(score[i]<82))
					{
						jd[i]=3.0;
					}else
					{
						if((score[i]>=75)&&(score[i]<78))
						{
							jd[i]=2.7;
						}else
						{
							if((score[i]>=72)&&(score[i]<75))
							{
								jd[i]=2.3;
							}else
							{
								if((score[i]>=68)&&(score[i]<72))
								{
									jd[i]=2.0;
								}else
								{
									if((score[i]>=64)&&(score[i]<68))
									{
										jd[i]=1.5;
									}else
									{
										if((score[i]>=60)&&(score[i]<64))
										{
											jd[i]=1.0;
										}else
										{
											jd[i]=0.0;
										}
									}
								}
							}
						}
					}
				}
			}
		}
		sum+=(jd[i])*(n[i]);
		i++;
	}
	a=sum/((double)(m));
	printf("%.2lf",a);
	return 0;
}
float GradePoint(int marks)
{
	if(marks>=90&&marks<=100)
		return 4.0;
	else if(marks>=85&&marks<=89)
		return 3.7;
	else if(marks>=82&&marks<=84)
		return 3.3;
	else if(marks>=78&&marks<=81)
		return 3.0;
	else if(marks>=75&&marks<=77)
		return 2.7;
	else if(marks>=72&&marks<=74)
		return 2.3;
	else if(marks>=68&&marks<=71)
		return 2.0;
	else if(marks>=64&&marks<=67)
		return 1.5;
	else if(marks>=60&&marks<=63)
		return 1.0;
	else 
		return 0;

}
void main()
{
	int n,i,count=0;
	int *XueFen,*Marks;
	float GPA=0;
	scanf("%d",&n);
	XueFen=(int*)malloc(sizeof(int)*n);
	Marks=(int*)malloc(sizeof(int)*n);
	for(i=0;i<n;i++)
	{
		scanf("%d",&XueFen[i]);
	}
	for(i=0;i<n;i++)
	{
		scanf("%d",&Marks[i]);
	}

	
	for(i=0;i<n;i++)
	{
		GPA=GPA+XueFen[i]*GradePoint(Marks[i]);
		count+=XueFen[i];
	}
	printf("%3.2f",GPA/count);

	

}
int main(){
    int n;
    scanf("%d",&n);
    int xf[n],cj[n],i;
    float jd[n],a,b;
    a=0;
    b=0;
    for(i=0;i<n;i++){
    scanf("%d",&xf[i]);
    }
    for(i=0;i<n;i++){
    scanf("%d",&cj[i]);
    if(cj[i]<60){
        jd[i]=0;
    }
    if(cj[i]>=60&&cj[i]<=63){
        jd[i]=1.0;
    }
    if(cj[i]>=64&&cj[i]<=67){
        jd[i]=1.5;
    }
    if(cj[i]>=68&&cj[i]<=71){
        jd[i]=2.0;
    }
    if(cj[i]>=72&&cj[i]<=74){
        jd[i]=2.3;
    }
    if(cj[i]>=75&&cj[i]<=77){
        jd[i]=2.7;
    }
    if(cj[i]>=78&&cj[i]<=81){
        jd[i]=3.0;
    }
    if(cj[i]>=82&&cj[i]<=84){
        jd[i]=3.3;
    }
    if(cj[i]>=85&&cj[i]<=89){
        jd[i]=3.7;
    }
    if(cj[i]>=90&&cj[i]<=100){
        jd[i]=4.0;
    }
    a=a+xf[i]*jd[i];
    b=b+xf[i];
    }
    a=a/b;
    printf("%.2f",a);
    return 0;
}
int main()
{
    int n, c;
    float b, GPAN;
    int i;
    int xuefen[10], score[10];
    float GPA[10];
    float GPAbiao[] = {4.0, 3.7, 3.3, 3.0, 2.7, 2.3, 2.0, 1.5, 1.0, 0};
	b = 0;
	c = 0;
    scanf("%d", &n);
    for(i=0;i<n;i++)
        scanf("%d", &xuefen[i]);
    for(i=0;i<n;i++)
        scanf("%d", &score[i]);
    for(i=0;i<n;i++)
      {
          if(score[i]>=90) GPA[i] = GPAbiao[0] * xuefen[i];
          else if(score[i]>=85&&score[i]<90) GPA[i] = GPAbiao[1] * xuefen[i];
          else if(score[i]>=82&&score[i]<85) GPA[i] = GPAbiao[2] * xuefen[i];
          else if(score[i]>=78&&score[i]<82) GPA[i] = GPAbiao[3] * xuefen[i];
          else if(score[i]>=75&&score[i]<78) GPA[i] = GPAbiao[4] * xuefen[i];
          else if(score[i]>=72&&score[i]<75) GPA[i] = GPAbiao[5] * xuefen[i];
          else if(score[i]>=68&&score[i]<72) GPA[i] = GPAbiao[6] * xuefen[i];
          else if(score[i]>=64&&score[i]<68) GPA[i] = GPAbiao[7] * xuefen[i];
          else if(score[i]>=60&&score[i]<64) GPA[i] = GPAbiao[8] * xuefen[i];
          else GPA[i] = GPAbiao[9] * xuefen[i];
      }
    for(i=0;i<n;i++)
    {
        b = b + GPA[i];
        c = c + xuefen[i];
    }
    GPAN = b/c;
    printf("%.2f", GPAN);
    return 0;
}
int main(){
int a,b,n,m=0;
int sort[10];
int j=0;
float c,d=0,GPA;
scanf("%d",&n);
for(int e=0;e<n;e++){
scanf("%d",&a);
sort[e]=a;
m+=a;
}
while(j<n){
scanf("%d",&b);
if(b<60){c=0;}
else if(b<65){c=1.0;}
 else if (b<68){c=1.5;}
  else if(b<72){c=2.0;}
  else if (b<75){c=2.3;}
  else if(b<78){c=2.7;}
  else if(b<82){c=3.0;}
  else if(b<85){c=3.3;}
  else if (b<90){c=3.7;}
  else if(b<101){c=4.0;}
d+=c*sort[j];
j++;
}
GPA=1.0*d/m;
printf("%.2f",GPA);
return 0;
}
int main()
{
int n,d=0;
float gpa=0;
scanf("%d",&n);
int c[n],p[n];
float gp[n];
for (int i=0;i<n;i++)
   {
   scanf("%d",&c[i]);
   d+=c[i];
   }
for (int j=0;j<n;j++)
   {
   scanf("%d",&p[j]);
   if (p[j]>89) gp[j]=4;
    else if (p[j]>84) gp[j]=3.7;
     else if (p[j]>81) gp[j]=3.3;
      else if (p[j]>77) gp[j]=3;
       else if (p[j]>74) gp[j]=2.7;
        else if (p[j]>71) gp[j]=2.3;
         else if (p[j]>67) gp[j]=2;
          else if (p[j]>63) gp[j]=1.5;
           else if (p[j]>59) gp[j]=1;
            else gp[j]=0;
   gpa+=c[j]*gp[j];
   }
gpa=gpa/d;
printf("%.2f",gpa);
}
void main()
{
	int i,j=0,k=0,n,a[10]={0},b[10]={0};
    float c[10]={0.0},s=0.0,total=0.0;
	scanf("%d\n",&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<10;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;
      for (i=0;i<n;i++)
		  s=s+a[i]*c[i];
	  for (i=0;i<n;i++)
		  total=total+a[i];
	  s=s/total;
	  printf("%.2f",s);
}
int main()
{
    int n;
    scanf("%d",&n);
    int ae[n],vv[n];
    int i;
    double deal[n];
    double a=0;
    double b=0;
    for(i=0;i<n;i++){
        scanf("%d ",&(ae[i]));
    }
    for(i=0;i<n;i++){
        scanf("%d ",&(vv[i]));
    }
    for(i=0;i<n;i++){
        if(vv[i]>=90){
          deal[i]=4.0;  
        }else if(vv[i]>=85){
            deal[i]=3.7;
        }else if(vv[i]>=82){
            deal[i]=3.3;
        }else if(vv[i]>=78){
            deal[i]=3.0;
        }else if(vv[i]>=75){
            deal[i]=2.7;
        }else if(vv[i]>=72){
            deal[i]=2.3;
        }else if(vv[i]>=68){
            deal[i]=2.0;
        }else if(vv[i]>=64){
            deal[i]=1.5;
        }else if(vv[i]>=60){
            deal[i]=1.0;
        }else{deal[i]=0;}
    }
    for(i=0;i<n;i++){
        a=a+deal[i]*ae[i];
        b=b+ae[i];
    }
    printf("%.2lf",a/b);
    return 0;
}
int main(){
	
	int n;
	
    int sz[10];
    int a[10];
	float x=0,y=0,GPA;
	
	scanf("%d",&n);
	
	for(int i=0;i<=n-1;i++){
		
		scanf("%d",&(a[i])); 

		y+=a[i];
	}
	for(int p=0;p<=n-1;p++){
		
		scanf("%d",&(sz[p])); 
	}
    for(int j=0;j<=n-1;j++){
		
		
		if((sz[j])>=90){
			
			x+=4.0*a[j];
			
		}
		else if((sz[j])>=85&&(sz[j])<90){
			
			x+=3.7*a[j];
			
		}
        else if((sz[j])>=82&&(sz[j])<85){
			
			x+=3.3*a[j];
			
		}
		else if((sz[j])>=78&&(sz[j])<82){
			
			x+=3.0*a[j];
			
		}
		else if((sz[j])>=75&&(sz[j])<78){
			
			x+=2.7*a[j];
			
		}
		else if((sz[j])>=72&&(sz[j])<75){
			
			x+=2.3*a[j];
			
		}
		else if((sz[j])>=68&&(sz[j])<72){
			
			x+=2.0*a[j];
			
		}
   	    else if((sz[j])>=64&&(sz[j])<68){
			
			x+=1.5*a[j];
			
		}
		else if((sz[j])>=60&&(sz[j])<64){
			
			x+=1.0*a[j];
			
		}
		else if((sz[j])<60){
			
			x+=0;
			
		}
		
	}
	GPA=x/y;
	
	printf("%.2f",GPA);
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	return 0;
	
}
void main()
{
	int credit[100],score[100];
	float point[100];
	int n,i; 
	float sum=0,sum1=0,average;
	scanf("%d",&n);
	for(i=0;i<n;i++)
	{
		scanf("%d",&credit[i]);
	}
	for(i=0;i<n;i++)
	{
		scanf("%d",&score[i]);
	}
	for(i=0;i<n;i++)
	{
		if(score[i]<=100&&score[i]>=90)
			point[i]=4.0;
		else if(score[i]<=89&&score[i]>=85)
			point[i]=3.7;
		else if(score[i]<=84&&score[i]>=82)
			point[i]=3.3;
		else if(score[i]<=81&&score[i]>=78)
			point[i]=3.0;
		else if(score[i]<=77&&score[i]>=75)
			point[i]=2.7;
		else if(score[i]>=72&&score[i]<=74)
			point[i]=2.3;
		else if(score[i]>=68&&score[i]<=71)
			point[i]=2.0;
		else if(score[i]>=64&&score[i]<=67)
			point[i]=1.5;
		else if(score[i]>=60&&score[i]<=63)
			point[i]=1.0;
		else if(score[i]>=0&&score[i]<=59)
			point[i]=0;
		else
			printf("error");
	}
	for(i=0;i<n;i++)
	{
		sum=sum+credit[i]*point[i];
	}
	for(i=0;i<n;i++)
	{
		sum1=sum1+credit[i];
	}
	average=sum/sum1;
	printf("%.2f",average);
}
int main()
{int i,n,f=0;
int x[10],y[10];
float GPA,j=0;
cin>>n;//?????n
for(i=0;i<n;i++)
	{cin>>x[i];//???????
	f=f+x[i];
	}
for(i=0;i<n;i++)
	cin>>y[i];//?????????
for(i=0;i<n;i++)
/*???? ?? 
90-100 4.0 
85-89  3.7 
82-84  3.3 
78-81  3.0 
75-77  2.7 
72-74  2.3 
68-71  2.0 
64-67  1.5 
60-63  1.0 
60?? 0 */

{if(y[i]>=90&&y[i<=100])
	j=j+4*x[i];
if(y[i]>=85&&y[i]<=89)
	j=j+3.7*x[i];
if(y[i]>=82&&y[i]<=84)
	j=j+3.3*x[i];
if(y[i]>=78&&y[i]<=81)
	j=j+3*x[i];
if(y[i]>=75&&y[i]<=77)
	j=j+2.7*x[i];
if(y[i]>=72&&y[i]<=74)
	j=j+2.3*x[i];
if(y[i]>=68&&y[i]<=71)
	j=j+2*x[i];
if(y[i]>=64&&y[i]<=67)
	j=j+1.5*x[i];
if(y[i]>=60&&y[i]<=63)
	j=j+1*x[i];
if(y[i]<60)
	j=j+0*x[i];
}
GPA=j/f;//??????
cout<<fixed<<setprecision(2)<<GPA<<endl;
return 0;
}
int main(){
int i,n,u[10],d;
float GPA,v[10],s,z[10],a;
scanf("%d",&n);
d=0;
for(i=0;i<n;i++){
scanf("%d",&u[i]);
d=d+u[i];

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

}
float jd(int x){
      if (x>=90&&x<=100) 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.0;
      if (x>=64) return 1.5;
      if (x>=60) return 1.0;
      return 0;
}
int main(){
    int n,i;
	int xuefen[100];
	int xuefensum;
	float score,GPA,scoresum;
	scanf("%d",&n);
	xuefensum=0;
	scoresum=0;
	for(i=0;i<n;i++){
		scanf("%d ",&xuefen[i]);
	    xuefensum=xuefensum+xuefen[i];
	}
	for(i=0;i<n;i++){
		scanf("%f",&score);
		scoresum=scoresum+jd(score)*xuefen[i];
	}
	GPA=scoresum/xuefensum;
	printf("%.2f",GPA);
	return 0;
}
int main ()
{
	int n, a[10], b[10], num = 0;
	int i;
	double G = 0, c[10];
	cin >> n;
	for(i = 0; i < n; i ++)
		cin >> a[i];
	for(i = 0; i < n; i ++)
		cin >> b[i];
	for(i = 0; i < n; i ++)
	{
		if(b[i] >= 90 && b[i] <= 100)
			c[i] = 4.0;
		else if(b[i] >= 85)
			c[i] = 3.7;
		else if(b[i] >= 82)
			c[i] = 3.3;
		else if (b[i] >= 78)
			c[i] = 3.0;
		else if(b[i] >= 75)
			c[i] = 2.7;
		else if(b[i] >= 72)
			c[i] = 2.3;
		else if(b[i] >= 68)
			c[i] = 2.0;
		else if(b[i] >= 64)
			c[i] = 1.5;	
		else if(b[i] >= 60)
			c[i] = 1.0;	
		else 
			c[i] = 0;
		num += a[i];
		G += a[i] * c[i];
	}
	G = G / num;
	cout << fixed << setprecision(2) << G << endl;
	return 0;
}