#P3601. 签到题

    ID: 2651 远端评测题 1000ms 125MiB 尝试: 0 已通过: 0 难度: 7 上传者: 标签>数学洛谷原创O2优化洛谷月赛

签到题

Description

We define a function qiandao(x)\operatorname{qiandao}(x) as the number of integers less than or equal to xx that are not coprime with xx. Given ll and rr, compute:

$$\sum_{i=l}^r \operatorname{qiandao}(i)\bmod 666623333.$$

Input Format

One line with two integers, ll and rr.

Output Format

One line with one integer representing the answer.

233 2333
1056499
2333333333 2333666666
153096296

Hint

  • For 30% of the testdata, l,r103l,r\leq 10^3.
  • For 60% of the testdata, l,r107l,r\leq 10^7.
  • For 100% of the testdata, 1lr10121 \leq l \leq r \leq 10^{12}, rl106r-l \leq 10^6.

Translated by ChatGPT 5