Preparando MOJI

Sum of Remainders

2000ms 262144K

Description:

Calculate the value of the sum: n mod 1 + n mod 2 + n mod 3 + ... + n mod m. As the result can be very large, you should print the value modulo 109 + 7 (the remainder when divided by 109 + 7).

The modulo operator a mod b stands for the remainder after dividing a by b. For example 10 mod 3 = 1.

Input:

The only line contains two integers n, m (1 ≤ n, m ≤ 1013) — the parameters of the sum.

Output:

Print integer s — the value of the required sum modulo 109 + 7.

Sample Input:

3 4

Sample Output:

4

Sample Input:

4 4

Sample Output:

1

Sample Input:

1 1

Sample Output:

0

Informação

Codeforces

Provedor Codeforces

Código CF616E

Tags

implementationmathnumber theory

Submetido 0

BOUA! 0

Taxa de BOUA's 0%

Datas 09/05/2023 09:03:16

Relacionados

Nada ainda