#P1829. [国家集训队] Crash的数字表格 / JZPTAB

    ID: 782 远端评测题 2000ms 500MiB 尝试: 0 已通过: 0 难度: 8 上传者: 标签>数学2010WC/CTSC/集训队O2优化莫比乌斯反演

[国家集训队] Crash的数字表格 / JZPTAB

Description

In today's math class, Crash learned about the Least Common Multiple. For two positive integers aa and bb, lcm(a,b)\text{lcm}(a, b) denotes the smallest positive integer divisible by both aa and bb. For example, lcm(6,8)=24\text{lcm}(6, 8) = 24.

After returning home, Crash was still thinking about what he learned. To study the Least Common Multiple, he drew an n×mn \times m table. Each cell contains a number, where the cell in the ii-th row and jj-th column contains lcm(i,j)\text{lcm}(i, j).

Looking at this table, Crash thought of many questions. The one he most wants to solve is very simple: what is the sum of all the numbers in this table? When nn and mm are large, Crash cannot handle it, so he asks you to write a program to compute the answer. Since the result can be very large, Crash only wants the sum modulo 2010100920101009.

Input Format

The input contains one line with two integers nn and mm.

Output Format

Output one positive integer, the sum of all numbers in the table modulo 2010100920101009.

4 5
122

Hint

Sample 1 Explanation:

The table is:

11 22 33 44 55
22 66 44 1010
33 66 33 1212 1515
44 1212 44 2020

Constraints:

  • For 30%30\% of the testdata, n,m103n, m \le 10^3.
  • For 70%70\% of the testdata, n,m105n, m \le 10^5.
  • For 100%100\% of the testdata, 1n,m1071 \le n, m \le 10^7.

Translated by ChatGPT 5