luogu#P5221. Product

Product

Background

CYJian{\rm CYJian}: “I heard that combining gcd\gcd and \sum is pretty fun?? Then I will...”

Problem Description

CYJian{\rm CYJian} has been bored recently and started playing with gcd\gcd. 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}$$

CYJian{\rm CYJian} has already computed the value of this expression. Now please help him verify it. CYJian{\rm CYJian} only gives you 0.2s0.2\textrm{s} of time.

2024.5.11 upd: The time and memory limits have been relaxed.

Input Format

One line with a positive integer NN.

Output Format

One line with a positive integer, the value of the answer modulo 104857601104857601.

5

585494

Hint

Sample explanation:

lcmgcd\frac{\operatorname{lcm}}{\gcd} 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 30%30\% of the testdata: 1N50001 \leq N \leq 5000.

For 100%100\% of the testdata: 1N10000001 \leq N \leq 1000000.

Translated by ChatGPT 5