Logo
(追記) (追記ここまで)

18764번 - LCM Sum 다국어

시간 제한메모리 제한제출정답맞힌 사람정답 비율
7 초 512 MB3718736.842%

문제

Are you sick of solving problems like computing the prefix sum of a random number theory function? As a terrible problem writer, here I present another one for you.

Compute

\[\sum_{x=1}^{n}{\text{lcm}(x, x+1, \dots, x+k)}\text{.}\]

The answer can be large, so output it modulo 109 + 7.

입력

The first line contains two integers n, k (1 ≤ n ≤ 1018, 0 ≤ k ≤ 30).

출력

Output one integer: the answer.

제한

예제 입력 1

10 3

예제 출력 1

18936

예제 입력 2

10000 6

예제 출력 2

43482752

예제 입력 3

1000000000 15

예제 출력 3

688102997

힌트

출처

Camp > Petrozavodsk Programming Camp > Winter 2020 > Day 9: Yuhao Du Contest 7 L번

Contest > Open Cup > 2019/2020 Season > Stage 12: Grand Prix of Zhejiang L번

(追記) (追記ここまで)

출처

대학교 대회

  • 사업자 등록 번호: 541-88-00682
  • 대표자명: 최백준
  • 주소: 서울시 서초구 서초대로74길 29 서초파라곤 412호
  • 전화번호: 02-521-0487 (이메일로 연락 주세요)
  • 이메일: contacts@startlink.io
  • 통신판매신고번호: 제 2017-서울서초-2193 호

AltStyle によって変換されたページ (->オリジナル) /