You are given an array A of integers. You have to select an integer a from the array, square it, and then return the sum of the subarray that has the maximum sum over all subarrays of the resultant array.
You have to select an integer a such that you can maximize the final answer.
Note: The sum of a subarray is the sum of all the integers in the subarray.
Input format
Output format
Input Constraints
1≤n≤500000
−10000000≤Ai≤10000000