Construct the string codeforces solution
1 #include <iostream>
2 #include <cstdio>
3 #include <cstring>
4 using namespace std;
5 #define scanf scanf_s
6
7 int T;
8 int n, a, b;
9 int main() {
10 scanf("%d", &T);
11 while (T--) {
12 scanf("%d%d%d", &n, &a, &b);
13 char s[10001];
14 for (int i = 0; i < n; i++) {
15 s[i] = 'a' + i % b;
16 }
17 s[n] = '\0';
18 printf("%s\n", s);
19 }
20
21 return 0;
22 }