P29223 [洛谷] [THUPC2022 Preliminary] Lowest Common Tree
提高
题目描述

Problem Description

For any $V \subset \mathbb{N}^*$, $|V| < +\infty$, construct an undirected complete graph $G = (V, E)$, where the edge weight of $(u, v)$ is the least common multiple of $u$ and $v$, denoted as $\mathrm{lcm}(u, v)$. The minimum spanning tree of $G$ is referred to as the Lowest Common Tree (LCT) of $V$.

Given $L, R$, you are asked to find the Lowest Common Tree $LCT(V)$ for $V = \{L, L+1, \cdots, R\}$.

Input Format

The input consists of a single line containing two positive integers $L$ and $R$.

Output Format

Output a single positive integer, which is the sum of the edge weights of $LCT(V)$.

Sample Input and Output

Sample Input #1

3 12

Sample Output #1

126

Sample Input #2

6022 14076

Sample Output #2

66140507445

Sample Input #3

13063 77883

Sample Output #3

3692727018161

Sample Input #4

325735 425533

Sample Output #4

1483175252352926

Notes

Sample Explanation

One possible set of edges in the Lowest Common Tree includes $(3, 4), (3, 5), (3, 6), (3, 7), (4, 8), (3, 9), (5, 10), (3, 11), (3, 12)$.

Data Range

For $100\%$ of the data, it is guaranteed that $1 \le L \le R \le 10^6$, and $R - L \le 10^5$.

输入格式

见题面 Input 部分

输出格式

见题面 Output 部分

样例输入
3 12
样例输出
126