Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <bits/stdc++.h>
- using namespace std;
- void solve() {
- int N, P;
- cin >> N >> P;
- if (P == 1 || P == 2) {
- cout << "impossible\n";
- return;
- }
- string p = "a" + string(P - 2, 'b') + "a";
- for (int i = 0; i < N / P; i++)
- cout << p;
- cout << "\n";
- }
- int main() {
- int num_tests;
- cin >> num_tests;
- for (int test_id = 0; test_id < num_tests; test_id++) {
- solve();
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement