semeru/Code-Code-CloneDetection-POJ104 huggingface dataset:
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);
}
int main()
{
    int n,a[10],b[10],i;
    float GPA,c[10],sum_a,sum_b;
    scanf("%d",&n);
    for(i=1;i<=n;i++)
    {
        scanf("%d",&b[i]);
    }
    for(i=1;i<=n;i++)
    {
        scanf("%d",&a[i]);
    }
    for(i=1;i<=n;i++)
    {
                     if(a[i]<60)
                     c[i]=0;
                     else if(a[i]<=63)
                     c[i]=1.0;
                     else if(a[i]<=67)
                     c[i]=1.5;
                     else if(a[i]<=71)
                     c[i]=2.0;
                     else if(a[i]<=74)
                     c[i]=2.3;
                     else if(a[i]<=77)
                     c[i]=2.7;
                     else if(a[i]<=81)
                     c[i]=3.0;
                     else if(a[i]<=84)
                     c[i]=3.3;
                     else if(a[i]<=89)
                     c[i]=3.7;
                     else
                     c[i]=4.0;
                     c[i]=c[i]*b[i];
                     }
                     for(i=1,sum_a=0,sum_b=0;i<=n;i++)
                     {
                                                      sum_a+=c[i];
                                                      sum_b+=b[i];
                                                      }
                                                      GPA=sum_a/sum_b;
                                                      printf("%.2f",GPA);
                                                      return 0;
                                                      }
void main()
{
	int n,i;
	double sumcredit=0,sumgpa=0;
	double *a,*b;
	scanf("%d",&n);
	a=(double*)malloc(n*sizeof(double));
	b=(double*)malloc(n*sizeof(double));
	for(i=0;i<n;i++)
	{
		scanf("%lf",(a+i));
		sumcredit=sumcredit+*(a+i);
	}
	for(i=0;i<n;i++)
	{
		scanf("%lf",(b+i));
		if(*(b+i)>=90&&*(b+i)<=100)
		{
			*(b+i)=4.0**(a+i);
			sumgpa=sumgpa+*(b+i);
		}
		if(*(b+i)>=85&&*(b+i)<=89)
		{
			*(b+i)=3.7**(a+i);
			sumgpa=sumgpa+*(b+i);
		}
		if(*(b+i)>=82&&*(b+i)<=84)
		{
			*(b+i)=3.3**(a+i);
			sumgpa=sumgpa+*(b+i);
		}
		if(*(b+i)>=78&&*(b+i)<=81)
		{
			*(b+i)=3.0**(a+i);
			sumgpa=sumgpa+*(b+i);
		}
		if(*(b+i)>=75&&*(b+i)<=77)
		{
			*(b+i)=2.7**(a+i);
			sumgpa=sumgpa+*(b+i);
		}if(*(b+i)>=72&&*(b+i)<=74)
		{
			*(b+i)=2.3**(a+i);
			sumgpa=sumgpa+*(b+i);
		}
		if(*(b+i)>=68&&*(b+i)<=71)
		{
			*(b+i)=2.0**(a+i);
			sumgpa=sumgpa+*(b+i);
		}
		if(*(b+i)>=64&&*(b+i)<=67)
		{
			*(b+i)=1.5**(a+i);
			sumgpa=sumgpa+*(b+i);
		}
		if(*(b+i)>=60&&*(b+i)<=63)
		{
			*(b+i)=1.0**(a+i);
			sumgpa=sumgpa+*(b+i);
		}
		if(*(b+i)<60)
		{
			*(b+i)=0;
			sumgpa=sumgpa+*(b+i);
		}
	}
	printf("%.2lf",sumgpa/sumcredit);
}
int main()
{
	int n,xf[10],cj[10],sum2=0,i;
	double xfjd[10],sum=0;
	double jd;
	scanf("%d",&n);
	for(i=0;i<n;i++)
	{
		scanf("%d",&xf[i]);
	}
	for(i=0;i<n;i++)
	{
		scanf("%d",&cj[i]);
		if(cj[i]>89&&cj[i]<101) jd=4.0;
        if(cj[i]>84&&cj[i]<90) jd=3.7;
        if(cj[i]>81&&cj[i]<85) jd=3.3;
        if(cj[i]>77&&cj[i]<82) jd=3.0;
        if(cj[i]>74&&cj[i]<78) jd=2.7;
       if(cj[i]>71&&cj[i]<75) jd=2.3;
        if(cj[i]>67&&cj[i]<72) jd=2.0;
         if(cj[i]>63&&cj[i]<68) jd=1.5;
        if(cj[i]>59&&cj[i]<64) jd=1.0;
        if(cj[i]<60) jd=0;
		xfjd[i]=jd*xf[i];
	}
	for(i=0;i<n;i++)
	{
		sum+=xfjd[i];
		sum2+=xf[i];
	}
	printf("%.2f",(float)sum/sum2);
	return 0;
}
int main()
{
	int n,hr[10],scr[10];
	double s=0,GPA,sc[10];
	scanf("%d",&n);
	int i,shr=0;
	for(i=0;i<n;i++)
	{
		scanf("%d",&hr[i]);
		shr+=hr[i];
	}
	for(i=0;i<n;i++)
	{
		scanf("%d",&scr[i]);
		int x=scr[i];
		if(x>=90&&x<=100)
			sc[i]=4.0;
		if(x>=85&&x<=89)
			sc[i]=3.7;
		if(x>=82&&x<=84)
			sc[i]=3.3;
		if(x>=78&&x<=81)
			sc[i]=3.0;
		if(x>=75&&x<=77)
			sc[i]=2.7;
		if(x>=72&&x<=74)
			sc[i]=2.3;
		if(x>=68&&x<=71)
			sc[i]=2.0;
		if(x>=64&&x<=67)
			sc[i]=1.5;
		if(x>=60&&x<=63)
			sc[i]=1.0;
		if(x<60)
			sc[i]=0;
		s+=sc[i]*hr[i];
	}
	GPA=s/shr;
	printf("%.2f\n",GPA);
	return 0;
}
int main()
{
    /*?????????????????????GPA????????????????????????????????? 
?????????? 
???? ?? 
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 
1??????????=????*???? 
2?????=????????/???????? 
????????????A??????GPA?? 
????
??? ?????n?n<10?? 
??? ???????????????????? 
??? ?????????? 
??????????????
????
??????????????????2?????printf("%.2f",GPA);?*/
    int n1;
    cin>>n1;
    const int n=n1;
    int number[n],grade[n];
    float gpa[n],sum=0,sum1=0,average=0;
    int i;
    for(i=0;i<=n-1;i++)
    {
      cin>>number[i];
      }
    for(i=0;i<=n-1;i++)
    {
      cin>>grade[i];
      }
    for(i=0;i<=n-1;i++)
    {
      if((90<=grade[i])&&(grade[i]<=100))
      gpa[i]=4.0;

       if((85<=grade[i])&&(grade[i]<=89))
      gpa[i]=3.7;

       if((82<=grade[i])&&(grade[i]<=84))
     gpa[i]=3.3;

       if((78<=grade[i])&&(grade[i]<=81))
      gpa[i]=3.0;

       if((75<=grade[i])&&(grade[i]<=77))
      gpa[i]=2.7;

       if((72<=grade[i])&&(grade[i]<=74))
      gpa[i]=2.3;

       if((68<=grade[i])&&(grade[i]<=71))
       gpa[i]=2.0;

       if((64<=grade[i])&&(grade[i]<=67))
       gpa[i]=1.5;

       if((60<=grade[i])&&(grade[i]<=63))
       gpa[i]=1.0;

       if(grade[i]<60)
       gpa[i]=0;

       }
       for(i=0;i<=n-1;i++)
       {
          sum=sum+gpa[i]*number[i];
          sum1=sum1+number[i];
          }
          average=sum/sum1;
 
          printf("%.2f",average);
          
          return 0;
          }
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;

}
int main(){
    int t[MAX],n,i;
	double s,p=0,k[MAX],m=0;
	scanf("%d",&n);
	for(i=0;i<n;i++){
		scanf("%lf",&k[i]);
	}
    for(i=0;i<n;i++){
		m=m+k[i];
	}
	for(i=0;i<n;i++){
		scanf("%d",&t[i]);
	}
	for(i=0;i<n;i++){
		if(t[i]<60)
			p=p+0*k[i];
		else
			if(t[i]>=60&&t[i]<=63)
			      p=p+1*k[i];
			else
				if(t[i]>=64&&t[i]<=67)
		            	p=p+1.5*k[i];
				else
					if(t[i]>=68&&t[i]<=71)
			               p=p+2*k[i];
					else
						if(t[i]>=72&&t[i]<=74)
			                  p=p+2.3*k[i];
						else
							if(t[i]>=75&&t[i]<=77)
			                       p=p+2.7*k[i];
							else
								if(t[i]>=78&&t[i]<=81)
			                           p=p+3*k[i];
								else
									if(t[i]>=82&&t[i]<=84)
			                               p=p+3.3*k[i];
									else
										if(t[i]>=85&&t[i]<=89)
			                                   p=p+3.7*k[i];
										else
											if(t[i]>=90&&t[i]<=100)
			                                         p=p+4*k[i];
	}
	s=p/m;
	printf("%.2lf",s);
	return 0;
	printf("%lf",m);
	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 i,k,n,t,p;
	float jdh=0;
	int xfh=0;
	int xf[10];
	int df[10];
	float jd[10];
	scanf("%d",&n);
	for(i=0;i<n;i++){
		scanf("%d",&xf[i]);
		xfh+=xf[i];
	}
	for(k=0;k<n;k++){
		scanf("%d",&df[k]);
	}
	for(p=0;p<n;p++){
		if(df[p]>89){
			jd[p]=4.0;
		}
		else if(df[p]>84&&df[p]<90){
			jd[p]=3.7;
		}
		else if(df[p]>81&&df[p]<85){
			jd[p]=3.3;
		}
	    else if(df[p]>77&&df[p]<82){
			jd[p]=3.0;
		}
		else if(df[p]>74&&df[p]<78){
			jd[p]=2.7;
		}
		else if(df[p]>71&&df[p]<75){
			jd[p]=2.3;
		}
		else if(df[p]>67&&df[p]<72){
			jd[p]=2.0;
		}
		else if(df[p]>63&&df[p]<68){
			jd[p]=1.5;
		}
		else if(df[p]>59&&df[p]<64){
			jd[p]=1.0;
		}
		else{
			jd[p]=0;
		}
	}
	for(t=0;t<n;t++){
		jdh+=xf[t]*jd[t];
	}
	float zjd=jdh/xfh;
	printf("%.2f",zjd);
	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;
}
void main(){
	int n, i, k, t, j, c, e=0;
	float w=0, sum=0;
	scanf("%d", &n);
	int score[10];
	float GPA[10];
	float credit[10];
	for (i=1;i<=n;i++){
		scanf("%d", &k);
		score[i]=k;
	}
	for (j=1;j<=n;j++){
		scanf("%d", &t);
		if(90<=t&&t<=100){
			GPA[j]=4.0;}
        if(85<=t&&t<=89){
			GPA[j]=3.7;}
		if(82<=t&&t<=84){
			GPA[j]=3.3;}
        if(78<=t&&t<=81){
			GPA[j]=3.0;}
		if(75<=t&&t<=77){
			GPA[j]=2.7;}
		if(72<=t&&t<=74){
			GPA[j]=2.3;}
		if(68<=t&&t<=71){
			GPA[j]=2.0;}
        if(64<=t&&t<=67){
			GPA[j]=1.5;}
        if(60<=t&&t<=63){
			GPA[j]=1.0;}
        if(t<=60){
			GPA[j]=0;}
	}
	for (c=1;c<=n;c++){
		credit[c]=score[c]*GPA[c];
		e+=score[c];
		sum+=credit[c];
	}
	w=sum/e;
	printf("%.2f", w);
}
double score2g(int m)	{
	if(m >= 90 && m <= 100)	{
		return 4.0;
	}
	else if(m >= 85 && m <= 89)	{
		return 3.7;
	}
	else if(m >= 82 && m <= 84)	{
		return 3.3;
	}
	else if(m >= 78 && m <= 81)	{
		return 3.0;
	}
	else if(m >= 75 && m <= 77)	{
		return 2.7;
	}
	else if(m >= 72 && m <= 74)	{
		return 2.3;
	}
	else if(m >= 68 && m <= 71)	{
		return 2.0;
	}
	else if(m >= 64 && m <= 67)	{
		return 1.5;
	}
	else if(m >= 60 && m <= 63)	{
		return 1.0;
	}
	else
		return 0;
}

int main()	{
	int i, n, a[15], b[15], sum2 = 0;
	double sum1 = 0;
	scanf("%d", &n);
	for(i = 0; i < n; ++i)	{
		scanf("%d", &a[i]);
		sum2 += a[i];
	}
	for(i = 0; i < n; ++i)	{
		scanf("%d", &b[i]);
		sum1 += (double)score2g(b[i])*a[i];
	}
	float rel = (double)sum1 / sum2;
	printf("%.2lf\n", rel);
	return 0;
}
int main()
{
	int n,xf[10],i,df[10],zxf=0;
	float jd[10],gpa,zjd=0;
	scanf("%d",&n);
	for(i=0;i<n-1;i++)
	{
		scanf("%d ",&xf[i]);
	}
	scanf("%d",&xf[n-1]);
	
	for(i=0;i<n-1;i++)
	{
		scanf("%d ",&df[i]);
	}
	scanf("%d",&df[n-1]);
	
	for(i=0;i<n;i++)
	{
		if(df[i]>=90)
			jd[i]=4.0;
		else if(df[i]>=85)
			jd[i]=3.7;
		else if(df[i]>=82)
			jd[i]=3.3;
		else if(df[i]>=78)
			jd[i]=3.0;
		else if(df[i]>=75)
			jd[i]=2.7;
		else if(df[i]>=72)
			jd[i]=2.3;
		else if(df[i]>=68)
			jd[i]=2.0;
		else if(df[i]>=64)
			jd[i]=1.5;
		else if(df[i]>=60)
			jd[i]=1.0;
		else
			jd[i]=0;
	}
	for(i=0;i<n;i++)
	{
		zxf+=xf[i];
	}
	for(i=0;i<n;i++)
	{
		zjd+=xf[i]*jd[i];
	}
	gpa=zjd/zxf;
	printf("%.2f",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);
}
void main()
{
	int a[10],n,i,b[10],sum2=0;
	float GPA,c[10],sum1=0;
	scanf("%d",&n);
	for(i=0;i<=(n-1);i++)
	{
		scanf("%d",&a[i]);
	}
    for(i=0;i<=(n-1);i++)
	{
		scanf("%d",&b[i]);
	}
	for(i=0;i<=9;i++)
	{
	if(b[i]>=90) 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;
	}
		for(i=0;i<=(n-1);i++)
		{
			sum1=a[i]*c[i]+sum1;
		}
		for(i=0;i<=(n-1);i++)
		{
			sum2=a[i]+sum2;
		}
		GPA=sum1/sum2;
		printf("%.2f\n",GPA);
}
int main(){
	int n,a[10],b[10],sum1=0;
	double gpa,sum2=0.0;
	scanf("%d",&n);
    for(int i=0;i<n;i++)
	{
	
		scanf("%d",&a[i]);
		sum1+=a[i];
	}
	for(int j=0;j<n;j++)
	{
		scanf("%d",&b[j]);
		if(90<=b[j]&&b[j]<=100)
		{
			sum2+=a[j]*4.0;
		}
		else
		{
			if(85<=b[j]&&b[j]<=89)
			{
				sum2+=a[j]*3.7;
			}
			else
			{
				if(82<=b[j]&&b[j]<=84)
				{
					sum2+=a[j]*3.3;
				}
				else
				{
					if(78<=b[j]&&b[j]<=81)
					{
						sum2+=a[j]*3.0;
					}
					else
					{
						if(75<=b[j] &&b[j]<=77)
						{
							sum2+=a[j]*2.7;
						}
						else
						{
							if(72<=b[j]&&b[j]<=74)
							{
								sum2+=a[j]*2.3;
							}
							else
							{
								if(68<=b[j]&&b[j]<=71)
								{
									sum2+=a[j]*2.0;
								}
								else
								{
									if(64<=b[j]&&b[j]<=67)
									{
										sum2+=a[j]*1.5;
									}
									else
									{
										if(60<=b[j]&&b[j]<=63)
										{
											sum2+=a[j]*1.0;
										}
										else
										{
											sum2=sum2;
										}
									}
								}
							}
						}
					}
				}
			}
		}
	}


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

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

void main()
{
	int i,n,sum=0;
	float x=0;
	int xf[10],cj[10];
	scanf("%d",&n);
	for (i=0;i<n;i++)
	{
		scanf("%d",&xf[i]);
		sum=sum+xf[i];
	}
	for (i=0;i<n;i++)
	{
		scanf("%d",&cj[i]);
		x=x+xf[i]*jd(cj[i]);
	}

	x=x/sum;
	printf("%.2f",x);
}
int main(int argc, char* argv[])
{
   int i,n;
   int sz[10],sum=0;;
   double b[10];
   double c[10];
   double total=0;
   float GPA;
   0<n<10;
    scanf("%d",&n);
   for(i=0;i<n;i++){
     scanf("%d",&sz[i]);}
  for(i=0;i<n;i++){
     scanf("%lf",&b[i]);}
   for(i=0;i<n;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+=sz[i];
	}

	for(i=0;i<n;i++){
		total+=c[i]*sz[i];
	}

      GPA=total/sum;
   printf("%.2f",GPA);
return 0;
}
main()
{
	float b[10];
	int a[2][10];
	float GPA;
	int i,j,n,x=0;
	scanf("%d",&n);
	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]>89)
		   b[j]=4.0;
	   else
		   if(a[1][j]>84)
			   b[j]=3.7;
		   else
			   if(a[1][j]>81)
				   b[j]=3.3;
			   else
				   if(a[1][j]>77)
					   b[j]=3.0;
				   else
					   if(a[1][j]>74)
						   b[j]=2.7;
					   else
						   if(a[1][j]>71)
							   b[j]=2.3;
						   else
							   if(a[1][j]>67)
								   b[j]=2.0;
							   else
								   if(a[1][j]>63)
									   b[j]=1.5;
								   else
									   if(a[1][j]>59)
										   b[j]=1.0;
                                       else
										   b[j]=0;
	}
    GPA=0;
	for(j=0;j<n;j++)
		GPA=(double)a[0][j]*b[j]+GPA;
	for(j=0;j<n;j++)
	   x=x+a[0][j];
	GPA=GPA/x;
	printf("%.2f",GPA);
}