AT_arc182_e [ARC182E] Sum of Min of Mod of Linear

Description

[problemUrl]: https://atcoder.jp/contests/arc182/tasks/arc182_e 正整数 $ N,M,K $ と非負整数 $ C $ と長さ $ N $ の整数列 $ A=(A_1,A_2,\ldots,A_N) $ が与えられます。 $ \displaystyle\ \sum_{k=0}^{K-1}\min_{1\le\ i\le\ N}\lbrace(Ck+A_i)\ \mathrm{mod}\ M\ \rbrace $ を求めてください。

Input Format

N/A

Output Format

N/A

Explanation/Hint

### 制約 - $ 1\le\ N\le\ 10^5 $ - $ 1\le\ M\le\ 10^9 $ - $ 0\le\ C\