import java.util.*;
import java.text.*;
public class cpromH {
public static void main(String [] args) {
Scanner scn = new Scanner(System.in);
while(scn.hasNextInt()) {
int n = scn.nextInt();
int total = 0;
for(int x=0;x<n;x++) {
String s = scn.next();
int sale = scn.nextInt();
total += sale;
}
double price = scn.nextDouble();
double totalPrice = total * price;
int avg = total / n;
DecimalFormat df = new DecimalFormat("0.00");
System.out.println(total +"\\n" +df.format(price) +"\\n" +df.format(totalPrice) +"\\n" +avg);
}
}
}