git reimport

This commit is contained in:
2019-03-15 13:47:54 +04:00
commit 3b461f73de
489 changed files with 1631603 additions and 0 deletions

View File

@@ -0,0 +1,31 @@
package chelper;
import io.InputReader;
import io.OutputWriter;
import misc.SimpleSavingChelperSolution;
public class M extends SimpleSavingChelperSolution {
public void solve(int testNumber, InputReader in, OutputWriter out) {
wrapSolve(testNumber, in, out);
}
@Override
public void solve(int testNumber) {
int n = in.nextInt();
int[] a = in.nextIntArray(n);
boolean ok = true;
int d = a[1] - a[0];
for (int i = 0; i < n - 1; i++) {
int t = a[i + 1] - a[i];
ok &= t == d;
}
out.println(ok ? (a[n - 1] + d) : a[n - 1]);
}
}