There are cities in a country, numbered through . They are connected with undirected roads in such a way that one can move from one city to any other city through these roads. Each city contains a box filled with coins. The city contains a box with coins, and it requires consecutive seconds to open the box.
Alice is initially in city . While standing in city , Alice can either:
Find the maximum number of coins Alice can collect in seconds.
Alice can visit a city any number of times but can collect the coins only once from a city.
Input format
The third line contains integers , denoting the number of seconds to open the boxes.
Output format
For each query, print the maximum number of coins Alice can collect in seconds.
Constraints
During the first second, Alice moves to city . During the second, Alice collects coins from city . During the third second, he moves to city and collects coins during the fourth and fifth second. So Alice collected total coins.