Company: Amex_24july
Difficulty: medium
Task 3 Problem Description You are given an integer N . Build an array A of exactly N integers that satisfies all of the following conditions: The sum of all elements of A is exactly 0 . All elements of A have distinct absolute values . In other words, if a value X appears in A , then neither X nor -X may appear anywhere else in the array. The absolute value of every element of A is at most N . (inferred - the source scores five limits: 1,000,000, 40*N, 5*N, 2*N and N; this judge enforces the strictest one, N , which is the only one worth full marks. Every N that has a valid array under any of the five limits also has one under N .) Many arrays can satisfy these conditions. Print the array written in non-decreasing order , and if several valid arrays exist, print the one that is lexicographically smallest in that order. (inferred - the source accepts any valid array; a judge that compares output text needs exactly one answer, so the smallest one is required.) If no valid array exists,