#P8207. [THUPC 2022 初赛] 最小公倍树
[THUPC 2022 初赛] 最小公倍树
Background
It is said that some people dislike problem statements that are too long.
Problem Description
For any with , construct an undirected complete graph , where the edge weight of is the least common multiple of and . Call the minimum spanning tree of the least common multiple tree of (LCT, Lowest Common Tree).
Now given , please find the least common multiple tree for .
Input Format
The input contains only one line, with two positive integers .
Output Format
Output one positive integer, representing the sum of edge weights of .
3 12
126
6022 14076
66140507445
13063 77883
3692727018161
325735 425533
1483175252352926
Hint
【Sample Explanation】
One possible set of edges in a least common multiple tree is $(3, 4), (3, 5), (3, 6), (3, 7), (4, 8), (3, 9), (5, 10), (3, 11), (3, 12)$.
【Constraints】
For of the testdata, it is guaranteed that , and .
Translated by ChatGPT 5