#H2026I. Infinite Horizon
Infinite Horizon
Description
Compute
$$\sum_{x=1}^m \sum_{i=1}^n \left( \left\lfloor\frac{a_i}{x}\right\rfloor + a_i \bmod x \right) $$modulo .
Format
Input Format
The first line contains two positive integers $n,m\,(1\le n\le 10^7, \max_i\{a_i\}\le m\le 10^{11})$.
The second line contains positive integers .
Output Format
Output a single integer representing the result.
Samples
4 5
2 3 4 5
48
10 616
9 1 8 3 2 4 5 10 7 6
33672
相关
在下列比赛中: