@@ -0,0 +1,1049 @@
+// https://codeforces.com/problemset/problem/1216/B%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%09int n = read.nextInt();%0A%09%09%0A%09%09List%3CElement%3E elements = new ArrayList%3C%3E();%0A%09%09for (int i = 0; i %3C n; ++i) %7B%0A%09%09%09int a = read.nextInt();%0A%09%09%09elements.add( new Element(i+1, a) );%0A%09%09%7D%0A%09%09%0A%09%09Collections.sort(elements);%0A%09%09Collections.reverse(elements);%0A%09%09%0A%09%09int minShots = 0;%0A%09%09int x = 0;%0A%09%09for (int i = 0; i %3C n; ++i) %7B%0A%09%09%09minShots += (elements.get(i).value * x) + 1;%0A%09%09%09x++;%0A%09%09%7D%0A%09%09%0A%09%09System.out.println(minShots);%0A%09%09for (Element e : elements) %7B%0A%09%09%09System.out.print(e.index + %22 %22);%0A%09%09%7D%0A%09%09%0A%09%09// Close scanner%0A%09%09read.close();%0A%09%7D%0A%0A%7D%0A%0Aclass Element %0A%09implements Comparable%3CElement%3E %0A%7B%0A    int index, value;%0A%0A    Element(int index, int value)%7B%0A        this.index = index;%0A        this.value = value;%0A    %7D%0A%0A    public int compareTo(Element e) %7B%0A        return this.value - e.value;%0A    %7D%0A%7D%0A

Create Shooting.java