@@ -0,0 +1,1637 @@
+/*%0AID: yashary1%0ALANG: JAVA%0ATASK: gift1%0A*/%0A%0Aimport java.io.*;%0Aimport java.util.*;%0A%0Aclass account%0A%7B%0A%09private String name;%0A%09private int money = 0;%0A%0A%09account(String name)%0A%09%7B%0A%09%09this.name = name;%0A%09%7D%0A%0A%09public void change(int amount)%0A%09%7B%0A%09%09money += amount;%0A%09%7D%0A%0A%09public String getName()%0A%09%7B%0A%09%09return name;%0A%09%7D%0A%0A%09public int getAmount()%0A%09%7B%0A%09%09return money;%0A%09%7D%0A%7D%0A%0Aclass gift1%0A%7B%0A%09private static int getIndex(String name, account peeps%5B%5D)%0A%09%7B%0A%09%09for(int i = 0; i %3C peeps.length; i++)%0A%09%09%7B%0A%09%09%09if(name.equals(peeps%5Bi%5D.getName()))%0A%09%09%09%7B%0A%09%09%09%09return i;%0A%09%09%09%7D%0A%09%09%7D%0A%0A%09%09return -1;%0A%09%7D%0A%0A  public static void main(String %5B%5D args) throws IOException%0A  %7B%0A    BufferedReader f = new BufferedReader(new FileReader(%22gift1.in%22));%0A    PrintWriter out = new PrintWriter(new BufferedWriter(new FileWriter(%22gift1.out%22)));%0A%0A    StringTokenizer st = new StringTokenizer(f.readLine());%0A%0A    int NP = Integer.parseInt(st.nextToken());%0A%0A    account peeps%5B%5D = new account%5BNP%5D;%0A%0A    for(int i = 0; i %3C NP; i++)%0A    %7B%0A    %09peeps%5Bi%5D = new account(f.readLine());%0A    %7D%0A%0A    String name;%0A    while((name = f.readLine()) != null)%0A    %7B%0A    %09st = new StringTokenizer(f.readLine());%0A    %09int amount = Integer.parseInt(st.nextToken());%0A    %09int ppl = Integer.parseInt(st.nextToken());%0A%0A    %09if(amount %3E 0)%0A    %09%7B%0A    %09%09peeps%5BgetIndex(name, peeps)%5D.change(-amount + (amount %25 ppl));%0A    %09%7D%0A%0A    %09for(int i = 0; i %3C ppl; i++)%0A    %09%7B%0A    %09%09String person = f.readLine();%0A    %09%09if(amount %3E 0)%0A    %09%09%09peeps%5BgetIndex(person, peeps)%5D.change(amount / ppl);%0A    %09%7D%0A    %7D%0A%0A    for(int i = 0; i %3C NP; i++)%0A    %7B%0A    %09out.println(peeps%5Bi%5D.getName() + %22 %22 + peeps%5Bi%5D.getAmount());%0A    %7D%0A%0A    out.close();%0A  %7D%0A%7D%0A

Create gift1.java