#2991. Yet Another Problem About gcd

Yet Another Problem About gcd

Yet Another Problem About gcd

题目描述

设:

$F(l,r)=\max\limits_{i=l}^{r}(\max\limits_{j=i+1}^{r}\gcd(i,j))$

试求 j=l+1rF(l,j)mod993244853\sum\limits_{j=l+1}^{r}F(l,j)\mod 993244853

其中 gcd(i,j)gcd(i,j) 表示 iijj 的最大公因数。

输入格式

l rl\ r

输出格式

ansans

样例 #1

样例输入 #1

5 8

样例输出 #1

4

提示

样例解释

F(5,6)=1F(5,6)=1

F(5,7)=1F(5,7)=1

F(5,8)=2F(5,8)=2

所以答案为 44

【数据范围】

1l,r1071 \le l,r \le 10^7

数据点 l,rl,r\le 特殊性质
11 100100
2,32,3 10310^3
4,54,5 10610^6 数据随机
6106-10 10710^7