Noip improving the total square number of simulated questions

Source: Internet
Author: User

Total Square Number

(number.*** (C/cpp/pas), 1000MS,128MB)

"Problem description"

A number if it is the complete square of another integer, then we call this number a complete square (Pefect sqaure), also known as the square number.

Small a thinks that all the squares are very perfect ~

So he gave the little b a task: Multiply all the different positive integers by no more than n to get the total square number, and the smaller a wants the larger the better the square number.

Please help small B to tell small A to satisfy the maximum total square number of test instructions.

Input

The input file name is number.in

Enter only 1 rows, one number n.

Output

Output file name is number.out

The output is only 1 lines, and one number represents the answer. Because the answer can be very large, so please output the answer to 100000007( Note!) 10^8+7 ) After the result of the modulo.

"Input and output Example 1"

Number.in

7

Number.out

144

"Input and output sample interpretation 1"

144=2x3x4x6, is 12 of the total square.

"Input and output Example 2"

number.in

9

Number.out

5184

"Input and Output sample interpretation 2"

5184=3X4X6X8X9, is 72 of the total square.

"Data Range"

For 20% of data,0<n≤ 100;

For 50% of data,0<n≤ 5,000;

For 70% of data,0<n≤ 100,000;

For 100% of data,0<n≤ 5,000,000.

Practices

The total number of factorization per square is even, so we put n! Decompose the factorization and then subtract one of the number of counts of the number of times, and multiply all the factorization by the result.

On the correctness of the odd number of times directly minus one, we will find that each of the decomposition of the mass factor is less than n the positive integer (nonsense), so at the end of the time not to join the factorization itself can be reduced by a number of

Code

I will not give you "enough

The code writes it over and over. "Actually, it's lazy.

Noip improving the total square number of simulated questions

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.