GUPTA MECHANICAL

IN THIS WEBSITE I CAN TELL ALL ABOUT TECH. TIPS AND TRICKS APP REVIEWS AND UNBOXINGS ALSO TECH. NEWS .............

Friday, 2 September 2022

[Solution] Madoka and The Best University Codeforces Solution



E. Madoka and The Best University
time limit per test
1 second
memory limit per test
256 megabytes
input
standard input
output
standard output

Madoka wants to enter to "Novosibirsk State University", but in the entrance exam she came across a very difficult task:

Given an integer n, it is required to calculate lcm(c,gcd(a,b)), for all triples of positive integers (a,b,c), where a+b+c=n.

In this problem gcd(x,y) denotes the greatest common divisor of x and y, and lcm(x,y) denotes the least common multiple of x and y.

Solution Click Below:-  👉CLICK HERE👈
👇👇👇👇👇

Solve this problem for Madoka and help her to enter to the best university!

Input

The first and the only line contains a single integer n (3n105).

Output

Print exactly one interger — lcm(c,gcd(a,b)). Since the answer can be very large, then output it modulo 109+7.


Note

In the first example, there is only one suitable triple (1,1,1). So the answer is lcm(1,gcd(1,1))=lcm(1,1)=1.

No comments:

Post a Comment