#K16306. Generate a Custom String
Generate a Custom String
Generate a Custom String
Given two integers (N) and (K), you are required to construct a string of length (N) that contains exactly (K) occurrences of the character 'a' and (N-K) occurrences of the character 'b'. All occurrences of 'a' must come before any occurrence of 'b'. If (K > N), then it is impossible to construct such a string, and you should output (-1).
This problem will test your ability to implement basic string operations following simple constraints. Your solution should successfully process multiple test cases provided via standard input and output the results to standard output.
inputFormat
The first line of the input contains a single integer (T), representing the number of test cases. Each of the following (T) lines contains two space-separated integers: (N) and (K).
outputFormat
For each test case, output a single line containing the generated string. If it is impossible to create such a string (i.e., when (K > N)), output (-1).## sample
3
5 2
3 4
4 0
aabbb
-1
bbbb
</p>