| TheForces Round #39 (1000-Forces) |
|---|
| Закончено |
This is the easy version of this problem. In this version, you need to find the minimum possible cost.
Sanjay wanted to solve a problem, but since he had no friends, he handed it over to you. Please solve it for him.
Given an array $$$a$$$ of length $$$n$$$, the cost $$$c$$$ is defined as:
$$$$$$ c = a_1 \cdot 1 + a_2 \cdot 2 + \dots + a_{n} \cdot n $$$$$$
Your task is to find the minimum possible cost that can be achieved after applying any number of left cyclic shift operations on the array.
A left cyclic shift operation moves each element of the array one position to the left, with the first element moving to the end.
For example, $$$$$$ a = [1, 2, 3, 4] \quad$$$$$$ after one left shift becomes $$$$$$a = [2, 3, 4, 1] $$$$$$
241 2 3 431 -1 1
22 0
In the second test case, after performing $$$2$$$ left cyclic shifts, the array becomes $$$[1, 1, -1]$$$, which results in the minimum cost.
| Название |
|---|


