castles stand in a row. The current height of castle is a positive integer .
The dwarf may change every height to any positive integer. Increasing the height of castle by one costs , and decreasing it by one costs .
Let the resulting heights be . The castles are harmonious if
for every . Find the minimum cost required to make the castles harmonious.
The input is given in the following format:
For each test case, print the minimum cost modulo .
Each case is given in the following format:
| 2 | 70 | No additional constraints. |