## GUPTA MECHANICAL

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

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

Given two positive integers $a$ and $b$, we define $f\left(a,b\right)=\text{lcm}\left(a,b\right)-gcd\left(a,b\right)$, where $\text{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\left(a,b\right)$ over all pairs $\left(a,b\right)$ 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.

• 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\left(a,b\right)$ that can be obtained while satisfying the conditions on $a$ and $b$.

### Constraints

• $1\le T\le {10}^{5}$