@@ -0,0 +1,874 @@
+// http://codeforces.com/problemset/problem/160/A%0A%0Aimport java.util.ArrayList;%0Aimport java.util.Collections;%0Aimport java.util.List;%0Aimport java.util.Scanner;%0A%0Apublic class Solution %7B%0A%0A%09public static void main(String%5B%5D args) %7B%0A%09%09Scanner read = new Scanner(System.in);%0A%09%09%0A%09%09List%3CInteger%3E coinValues = new ArrayList%3CInteger%3E();%0A%09%09int minCoinCount = 0;%0A%09%09%0A%09%09int n = read.nextInt();%0A%09%09for (int i = 0; i %3C n; ++i) %7B%0A%09%09%09int coinValue = read.nextInt();%0A%09%09%09coinValues.add(coinValue);%0A%09%09%7D%0A%09%09%0A%09%09Collections.sort(coinValues, Collections.reverseOrder());%0A%09%09%0A%09%09int sum = 0;%0A%09%09for (int i = 0; i %3C n; ++i) %7B%0A%09%09%09sum += coinValues.get(i);%0A%09%09%09int leftOverSum = 0;%0A%09%09%09for (int j = i+1; j %3C n; ++j) %7B%0A%09%09%09%09leftOverSum += coinValues.get(j);%0A%09%09%09%7D%0A%09%09%09minCoinCount++;%0A%09%09%09if (sum %3E leftOverSum) %7B%0A%09%09%09%09break;%0A%09%09%09%7D%0A%09%09%7D%0A%09%09%0A%09%09System.out.println(minCoinCount);%0A%09%09%0A%09%09// Close scanner%0A%09%09read.close();%0A%09%7D%0A%09%0A%7D%0A

Create Twins.java