OneCompiler

java avgshoe

99

import java.util.Scanner;

class shoe {
int batchnum;
String type;
int size;
double prize;

public int getbatchnum() {
	return batchnum;
}

public String gettype() {
	return type;
}

public int getsize() {
	return size;
}

public double getprize() {
	return prize;
}

public void setbatchnum(int batchnum) {
	this.batchnum=batchnum;
}

public void settype(String type) {
	this.type=type;
}

public void setsize(int size) {
	this.size=size;
}

public void setprize(double prize) {
	this.prize=prize;
}

public shoe(int batchnum,String type,int size,double prize) {
	this.batchnum=batchnum;
	this.type=type;
	this.size=size;
	this.prize=prize;
}

}

class Solut{
public static double GetShoewithMaxPrize (shoe[] shoes) {
double sum=0,count=0;
for(int j=0;j<shoes.length;j++) {
sum=sum+shoes[j].getprize();
count++;

	}
	if(sum!=0) {
	return sum/count;
	}
	else
	{
		return 0;
	}
}
	


public static void main(String[] args) {
	Scanner sc=new Scanner(System.in);
	int a=sc.nextInt();
	shoe[] shoes = new shoe[a];
	for(int i=0;i<a;i++) {
		int batchnum=sc.nextInt();
		sc.nextLine();
		String type=sc.nextLine();
		int size=sc.nextInt();
		double prize=sc.nextDouble();
		shoes[i]=new shoe(batchnum,type,size,prize);
	}
	sc.nextLine();
	double ans= GetShoewithMaxPrize(shoes);
	if(ans!=0){
		System.out.println(ans);
	}
	

}

}