## GUPTA MECHANICAL

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

## [Solution] Distinct Palindrome CodeChef Solution | CodeChef Problem Solution 2022

Given integers $N$ and $X$, generate a palindrome of length $N$ consisting of lowercase English alphabets such that the number of distinct characters in the palindrome is exactly $X$.
If it is impossible to do so, print $-1$ instead.

### Input Format

• First line will contain $T$, number of test cases. Then the test cases follow.
• Each test case contains of a single line of input, two integers $N,X$, as mentioned in the

•  statement.

### Output Format

For each test case, output in a single line, a palindrome of length $N$ consisting of lowercase English alphabet such that the number of distinct characters in the palindrome is $X$. If it is not

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

possible to do so, print $-1$ instead.

### Constraints

• $1\le T\le {10}^{4}$
• $1\le N\le {10}^{5}$
• $1\le X\le min\left(N,26\right)$
• Sum of $N$ over all test cases does not exceed