Algorithm
Code Examples
#1 Code Example with C++ Programming
Code -
C++ Programming
#include<bits/stdc++.h>
using namespace std;
#define ll long long
#define endl '\n'
#define debug(n) cout<<(n)<<endl;
const ll INF = 2e18 + 99;
int main(){
ios_base::sync_with_stdio(false);
cin.tie(NULL);
int t;
cin>>t;
while(t--){
int n, a, b;
cin>>n>>a>>b;
string s = "";
char c = 'a';
for(int i = 0; i < n; i++){
if(i % b == 0){
c = 'a';
}
s += c;
c = char(c + 1);
}
cout<<s<<endl;
}
}
Copy The Code &
Try With Live Editor
Input
4
7 5 3
6 1 1
6 6 1
5 2 2
7 5 3
6 1 1
6 6 1
5 2 2
Output
tleelte
qwerty
vvvvvv
abcde
qwerty
vvvvvv
abcde
Demonstration
Codeforcess solution 1335-B B. Construct the String, ,C++, Java, Js and Python, 1335-B, Codeforcess solution