QOJ.ac

QOJ

Time Limit: 1 s Memory Limit: 512 MB Total points: 100

#3241. 最小公倍树

الإحصائيات

题目背景

听说有人嫌题面描述都太长了。

题目描述

对于任意 $V\subset\mathbb{N}^*$,$|V|<+\infty$,构造一张无向完全图 $G=(V,E)$,其中 $(u, v)$ 的边权为 $u,v$ 的最小公倍数 $\mathrm{lcm}(u, v)$。称 $G$ 的最小生成树为 $V$ 的最小公倍树(LCT, Lowest Common Tree)。

现在给出 $L, R$,请你求出 $V=\{L, L+1, \cdots, R\}$ 的最小公倍树 $LCT(V)$。

输入格式

从标准输入读入数据。

输入仅一行,包括两个正整数 $L, R$。

输出格式

输出到标准输出。

输出一个正整数,表示 $LCT(V)$ 的边权和。

样例1输入

3 12

样例1输出

126

样例1解释

其中一种最小公倍树上的边为 $(3, 4), (3, 5), (3, 6), (3, 7), (4, 8), (3, 9), (5, 10), (3, 11), (3, 12)$。

样例2输入

6022 14076

样例2输出

66140507445

样例3输入

13063 77883

样例3输出

3692727018161

样例4输入

325735 425533

样例4输出

1483175252352926

子任务

对于 $100\%$ 的数据,保证 $1\le L\le R\le 10^6$,且 $R-L\le 10^5$。

About Issues

We understand that our problem archive is not perfect. If you find any issues with the problem, including the statement, scoring configuration, time/memory limits, test cases, etc.

You may use this form to submit an issue regarding the problem. A problem moderator will review your issue and proceed it properly.

STOP! Before you submit an issue, please READ the following guidelines:

  1. This is not a place to publish a discussion, editorial, or requests to debug your code. Your issue will only be visible by you and problem moderators. Other users will not be able to view or reply your issues.
  2. Do not submit duplicated issues. If you have already submitted one, please wait for an moderator to review it. Submitting multiple issues will not speed up the review process and might cause your account to be banned.
  3. Issues must be filed in English or Chinese only.
  4. Be sure your issue is related to this problem. If you need to submit an issue regarding another problem, contest, category, etc., you should submit it to the corresponding page.

Active Issues 0

No issues in this category.

Closed/Resolved Issues 0

No issues in this category.