## GUPTA MECHANICAL

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

## [Solution] The Optimal Pairs CodeChef Solution | CodeChef Problem Solution 2022

For two positive integers $a$ and $b$, let $g\left(a,b\right)=$ gcd $\left(a,b\right)+$ lcm$\left(a,b\right)$.

For a positive integer $N$, let $f\left(N\right)$ denote the minimum value of $g\left(a,b\right)$ over all the pairs of positive integers $\left(a,b\right)$ such that $a+b=N$.

Find out the number of ordered pairs $\left(a,b\right)$ such that $a+b=N$ and $g\left(a,b\right)=f\left(N\right)$.

### 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 and only line of each test case contains a positive integer $N$.

### Output Format

For each test case, output the number of ordered pairs $\left(a,b\right)$ such that $a+b=N$ and $g\left(a,b\right)=f\left(N\right)$.

Burgers CodeChef Solution

Waiting Time CodeChef Solution

DNA Storage CodeChef Solution

Joining Date CodeChef Solution

Distinct Palindrome CodeChef Solution

The Optimal Pairs CodeChef Solution

Make them Equal CodeChef Solution

Permutation AND CodeChef Solution

### Constraints

• $1\le T\le 100$