fork(1) download
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. int main() {
  5. ios::sync_with_stdio(0);
  6. long long int i,j,T,N,g,r;
  7. cin>>T;
  8. while(T--){
  9. cin>>N;
  10. r=N%26;
  11. g=(N-r)/26;
  12. char a[27]={'a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y','z','\0'};
  13. for(i=0;i<g;i++){
  14. for(j=0;j<26;j++){
  15. cout<<a[j];
  16. }
  17. }
  18. for(i=0;i<r;i++){
  19. cout<<a[i];
  20. }
  21. cout<<endl;
  22. }
  23. return 0;
  24. }
Success #stdin #stdout 0s 3408KB
stdin
2
15
54
stdout
abcdefghijklmno
abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzab