P28648 [洛谷] Check-in Problem
提高
题目描述

Problem Background

This is a check-in problem!

It is recommended to carefully read the data range before attempting the problem!

Problem Description

We define a function: $\operatorname{qiandao}(x)$ as the count of numbers less than or equal to $x$ that are not coprime with $x$.

As this is a check-in problem, given $l$ and $r$, compute:

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

Input Format

A single line containing two integers, $l$ and $r$.

Output Format

A single line containing one integer representing the answer.

Sample Input and Output

Sample Input #1

233 2333

Sample Output #1

1056499

Sample Input #2

2333333333 2333666666

Sample Output #2

153096296

Notes

  • For $30\%$ of the data, $l, r \leq 10^3$.
  • For $60\%$ of the data, $l, r \leq 10^7$.
  • For $100\%$ of the data, $1 \leq l \leq r \leq 10^{12}$, $r - l \leq 10^6$.
输入格式

见题面 Input 部分

输出格式

见题面 Output 部分

样例输入
233 2333
样例输出
1056499