E. Product Sum
time limit per test
1 second
memory limit per test
256 megabytes
input
standard input
output
standard output
Blake is the boss of Kris, however, this doesn't spoil their friendship. They often gather at the bar to talk about intriguing problems about maximising some values. This time the problem is really special.
You are given an array a of length n. The characteristic of this array is the value — the sum of the products of the valuesai by i