Advertisement
Ankit_132

A

Mar 15th, 2024
666
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.48 KB | None | 0 0
  1. #include <bits/stdc++.h>
  2.  
  3. using namespace std;
  4.  
  5. #define _test   int _TEST; cin>>_TEST; while(_TEST--)
  6.  
  7. int main()
  8. {
  9.     _test
  10.     {
  11.         int n;
  12.         cin>>n;
  13.  
  14.         if(n%2)
  15.         {
  16.             cout<<"NO\n";
  17.             continue;
  18.         }
  19.  
  20.         char ch = 'A';
  21.         string ans = "";
  22.  
  23.         while(n)
  24.         {
  25.             ans += ch;
  26.             ans += ch;
  27.             ch++;
  28.             n -= 2;
  29.         }
  30.  
  31.         cout<<"YES\n"<<ans<<"\n";
  32.     }
  33. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement