Author: Ismail Hosen
Daffodil International University
Problem Link
//Please follow from main function
#include<bits/stdc++.h>
using namespace std;
int main()
{
int tc, n, k;
cin>>tc;
while(tc--){
cin>>n>>k;
string s="";
for(int i=0; i<n; i++){
for(int j=0; j<k; j++){
s+=97+j;
if(s.size()==n){
n=1;
break;
}
}
if(n==1)break;
}
cout<<s<<endl;
}
return 0;
}
0 Comments