@@ -0,0 +1,1427 @@
+// http://codeforces.com/problemset/problem/701/A%0A%0Aimport java.util.ArrayList;%0Aimport java.util.Arrays;%0Aimport java.util.Collections;%0Aimport java.util.Comparator;%0Aimport java.util.List;%0Aimport java.util.Scanner;%0A%0Apublic class Solution %7B%0A%09%0A%09static class Number %7B%0A%09%09private int index;%0A%09%09private int value;%0A%09%09%0A%09%09public Number(int index, int value) %7B this.index = index; this.value = value; %7D%0A%09%09%0A%09%09public int getIndex() %7B return index; %7D%0A%09%09public void setIndex(int index) %7B this.index = index; %7D%0A%09%09public int getValue() %7B return value; %7D%0A%09%09public void setValue(int value) %7B this.value = value; %7D%0A%09%7D%0A%09%0A%09public static void main(String%5B%5D args) %7B%0A%09%09Scanner read = new Scanner(System.in);%0A%0A%09%09int n = read.nextInt();%0A%09%09%0A%09%09List%3CNumber%3E numbers = new ArrayList%3CNumber%3E();%0A%09%09for (int i = 0; i %3C n; ++i) %7B%0A%09%09%09numbers.add( new Number(i+1, read.nextInt()) );%0A%09%09%7D%0A%09%09%0A%09%09Collections.sort(numbers, new Comparator%3CNumber%3E() %7B%0A%09%09%09@Override%0A%09%09%09public int compare(Number a, Number b) %7B%0A%09%09%09%09if (a.getValue() %3E b.getValue()) %7B return 1; %7D%0A%09%09%09%09else if (a.getValue() %3C b.getValue()) %7B return -1; %7D%0A%09%09%09%09else return 0;%0A%09%09%09%7D%09%0A%09%09%7D);%0A%09%09%0A%09%09int firstNumberIndex = 0;%0A%09%09int secondNumberIndex = (n-1);%0A%09%09for (int i = 0; i %3C (n/2); ++i) %7B%0A%09%09%09System.out.println( %0A%09%09%09%09numbers.get(firstNumberIndex).getIndex() + %22 %22 + %0A%09%09%09%09numbers.get(secondNumberIndex).getIndex()%0A%09%09%09);%0A%09%09%09firstNumberIndex++;%0A%09%09%09secondNumberIndex--;%0A%09%09%7D%0A%09%09%0A%09%09// Close scanner%0A%09%09read.close();%0A%09%7D%0A%09%0A%7D%0A

Create Cards.java