Company: De Shaw
Difficulty: medium
You are given an array A of length N , where A[i] represents the productivity score of the employee initially sitting at seat i (1-indexed). Before the workday begins, the manager may perform exactly one global rearrangement of all employees, assigning each employee to a unique seat. If an employee originally seated at position x is moved to position y , the employee contributes A x × |x - y| units to the team's overall productivity score. Your task is to determine the maximum possible total productivity score after the rearrangement. Function Description Complete the function: long long maximizeProductivity(int N, vector<long long>& A) which returns the maximum achievable productivity score. Constraints 2 ≤ N ≤ 2000 1 ≤ A i ≤ 10 9