document.write('
Data hosted with ♥ by Pastebin.com - Download Raw - See Original
  1. import java.util.*;
  2. import java.text.*;
  3. public class cpromH {
  4.     public static void main(String [] args) {
  5.         Scanner scn = new Scanner(System.in);
  6.         while(scn.hasNextInt()) {
  7.             int n = scn.nextInt();
  8.             int total = 0;
  9.             for(int x=0;x<n;x++) {
  10.                 String s = scn.next();
  11.                 int sale = scn.nextInt();
  12.                 total += sale;
  13.             }
  14.             double price = scn.nextDouble();
  15.             double totalPrice = total * price;
  16.             int avg = total / n;
  17.             DecimalFormat df = new DecimalFormat("0.00");
  18.             System.out.println(total +"\\n" +df.format(price) +"\\n" +df.format(totalPrice) +"\\n" +avg);
  19.         }
  20.     }
  21. }
');