luogu#P5221. Product
Product
Background
: “I heard that combining and is pretty fun?? Then I will...”
Problem Description
has been bored recently and started playing with . He came up with a very simple and interesting expression:
$$\prod_{i=1}^N\prod_{j=1}^N\frac{\operatorname{lcm}(i,j)}{\gcd(i,j)}\pmod{104857601}$$has already computed the value of this expression. Now please help him verify it. only gives you of time.
2024.5.11 upd: The time and memory limits have been relaxed.
Input Format
One line with a positive integer .
Output Format
One line with a positive integer, the value of the answer modulo .
5
585494
Hint
Sample explanation:
| 1 | 2 | 3 | 4 | 5 | |
|---|---|---|---|---|---|
| 1 | 1 | 2 | 3 | 4 | 5 |
| 2 | 2 | 1 | 6 | 2 | 10 |
| 3 | 3 | 6 | 1 | 12 | 15 |
| 4 | 4 | 2 | 12 | 1 | 20 |
| 5 | 5 | 10 | 15 | 20 | 1 |
For of the testdata: .
For of the testdata: .
Translated by ChatGPT 5