GUPTA MECHANICAL

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

Sunday, 5 June 2022

[Solution] The two numbers CodeChef Solution | CodeChef Problem Solution 2022

Given two positive integers a and b, we define f(a,b)=lcm(a,b)gcd(a,b), where lcm denotes the lowest common multiple and gcd denotes the greatest common divisor.

Chef has a positive integer N. He wonders, what is the maximum value of f(a,b) over all pairs (a,b) such that a and b are positive integers, and a+b=N?

Input Format

  • The first line of input will contain an integer T — the number of test cases. 
Solution Click Below:-  CLICK HERE

  • The description of T test cases follows.
  • The first line of each test case contains an integer N, as described in the problem statement.

Output Format

For each test case, output the maximum value of f(a,b) that can be obtained while satisfying the conditions on a and b.

Constraints

  • 1T105

No comments:

Post a Comment