QOJ.ac

QOJ

Límite de tiempo: 1 s Límite de memoria: 512 MB Puntuación total: 100

#3241. Least Common Multiple Tree

Estadísticas

Background

It is said that some people find problem descriptions too long.

Description

For any finite set $V \subset \mathbb{N}^*$, construct an undirected complete graph $G=(V, E)$, where the weight of the edge $(u, v)$ is the least common multiple $\mathrm{lcm}(u, v)$. The minimum spanning tree of $G$ is called the Least Common Tree (LCT) of $V$.

Given $L$ and $R$, find the sum of edge weights of the LCT for $V=\{L, L+1, \cdots, R\}$.

Input

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

Output

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

Examples

Input 1

3 12

Output 1

126

Note 1

One possible set of edges in the LCT is $(3, 4), (3, 5), (3, 6), (3, 7), (4, 8), (3, 9), (5, 10), (3, 11), (3, 12)$.

Input 2

6022 14076

Output 2

66140507445

Input 3

13063 77883

Output 3

3692727018161

Input 4

325735 425533

Output 4

1483175252352926

Subtasks

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

Discussions

About Discussions

The discussion section is only for posting: General Discussions (problem-solving strategies, alternative approaches), and Off-topic conversations.

This is NOT for reporting issues! If you want to report bugs or errors, please use the Issues section below.

Open Discussions 0
No discussions in this category.

Issues

About Issues

If you find any issues with the problem (statement, scoring, time/memory limits, test cases, etc.), you may submit an issue here. A problem moderator will review your issue.

Guidelines:

  1. This is not a place to publish discussions, editorials, or requests to debug your code. Issues are only visible to you and problem moderators.
  2. Do not submit duplicated issues.
  3. Issues must be filed in English or Chinese only.
Active Issues 0
No issues in this category.
Closed/Resolved Issues 0
No issues in this category.