Approaching by progression
Given a sequence of integers ( a_1, a_2, ..., a_N ). Your task is to find an arithmetic progression ( b_1, b_2, ..., b_N ) such that the magnitude of the progression is minimized. Note that the elements of this progression do not need to be integers.
Input
The first line of the input contains an integer ( N ) (( 2 N 10^4 )) — the number of elements in the sequence. The second line contains the integers ( a_1, a_2, ..., a_N ), each with an absolute value not exceeding ( 10^4 ).
Output
Output two numbers separated by a space: the first term of the desired arithmetic progression and its common difference. Ensure that the absolute or relative error of your answer does not exceed ( 10^-6 ). It is guaranteed that the solution is uniquely determined for all given input data.