The local Baladeya has just installed a new automated ticket machine to distribute citizens among $$$N$$$ agents sitting at the counters. At the start of the shift, the Chef Service Fathi configures the ticket machine with two parameters, $$$S$$$ and $$$K$$$. The machine then routes the $$$i$$$-th arriving citizen (starting from $$$i = 0$$$) to agent number $$$(S + i \cdot K) \pmod{N}$$$.
Naturally, the agents are super lazy and want to avoid work at all costs. Due to this routing policy, only a subset of agents will ever actually receive citizens. We call these the unlucky agents (or active agents). Let $$$L$$$ denote the number of unlucky agents.
Each agent $$$k$$$ ($$$0 \le k \lt N$$$) has a "complaining factor" $$$M_k$$$, which represents the amount of headache they cause the manager if they are forced to actually do their work (measured in the number of express coffees they demand, sudden "réseau tayah" excuses and phone calls they make during work).
To survive the day, the Chef Service must maximize the Baladeya's operational efficiency while minimizing his total headache. On one hand, every active agent adds their complaining factor to his daily stress. On the other hand, if too few agents are working, operational efficiency plummets, resulting in massive queues and a severe penalty from angry citizens and higher-ups.
Formally, the Chef Service wants to minimize the total cost (which balances his headache and the inefficiency penalty), defined as: $$$$$$ \text{TotalCost} = \left(\sum_{k \in \text{unlucky}} M_k\right) + \left \lfloor \frac{N}{2} \right \rfloor \cdot (N - L + 1) $$$$$$
Your task is to help the Chef Service find the values of $$$S$$$ and $$$K$$$ that minimize the total cost.
The first line contains a single integer $$$N$$$ ($$$1 \le N \le 2 \cdot 10^5$$$) — the number of agents in the Baladeya.
The second line contains $$$N$$$ integers $$$M_0, M_1, \ldots, M_{N-1}$$$ ($$$1 \le M_i \le 10^9$$$) — the complaining factor of each agent.
Output three integers on a single line: $$$S$$$, $$$K$$$, and the minimum total cost.
The values $$$S$$$ and $$$K$$$ must satisfy $$$0 \le S \lt N$$$ and $$$1 \le K \le N$$$.
If there are multiple solutions with the same minimum cost, output any of them.
65 2 5 1 3 5
3 6 19
1610 10 12 9 8 4 4 16 4 14 7 16 4 12 15 15
0 4 130