@@ -0,0 +1,536 @@
+// http://codeforces.com/problemset/problem/38/A%0A%0Aimport java.util.Scanner;%0A%0Apublic class Solution %7B%0A%09%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%09int%5B%5D d = new int%5Bn-1%5D;%0A%09%09for (int i = 0; i %3C n-1; ++i) %7B%0A%09%09%09d%5Bi%5D = read.nextInt();%0A%09%09%7D%0A%09%09%0A%09%09int a = read.nextInt();%0A%09%09int b = read.nextInt();%0A%09%09int numberOfYears = 0;%0A%09%09for (int i = a-1; i %3C b-1; ++i) %7B%0A%09%09%09numberOfYears += d%5Bi%5D;%0A%09%09%7D%0A%09%09%0A%09%09System.out.println(numberOfYears);%0A%09%09%0A%09%09// Close scanner%0A%09%09read.close();%0A%09%7D%0A%09%0A%7D%0A

Create Army.java