BZOJ 1257: [CQOI2007] Sum of remainders

1257: [CQOI2007] Sum of remainders

Time Limit: 5 Sec  Memory Limit: 128 MB

Description

Given positive integers n and k, compute the value of j(n, k)=k mod 1 + k mod 2 + k mod 3 + … + k mod n
where k mod i represents the remainder of k divided by i.
例如 j (5, 3) = 3 mod 1 + 3 mod 2 + 3 mod 3 + 3 mod 4 + 3 mod 5 = 0 + 1 + 0 + 3 + 3 = 7

Input

The input is only one line, containing two integers n, k.
1<=n ,k<=10^9

 

Output

The output is only one line, i.e. j(n, k).

Sample Input

5 3

Sample Output

7

HINT

 

Source

 

topic link

 

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=324767620&siteId=291194637