For this Question: Given N and K, find the lexicographically smallest string of length N using only the first K lowercase letters of the alphabet such that each letter is used at least once and no two adjacent characters are equal. 

If such a string doesn't exist, print -1.The first line of input contains a single integer, T (1 <= T <= 100).

Then T lines follow, each containing two space-separated integers, N (1 <= N <= 10<sup>5</sup>) and K (1 <= K <= 26).

It is guaranteed that sum of N over all test cases does not exceed 10<sup>6</sup>For each test case, output its answer in a new line.Sample Input:
2
2 3
3 2

Sample Output:
-1
aba, I have written this Solution Code: #include <bits/stdc++.h>
using namespace std;
#define fast ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
typedef long long int ll;
typedef unsigned long long int ull;
const long double PI = acos(-1);

const ll mod=1e9+7;
const ll mod1=998244353;

const int inf = 1e9;
const ll INF=1e18;

void precompute(){
    
}

void TEST_CASE(){
    int n,k;
    cin >> n >> k;
    if(k==1){
        if(n>1){
            cout << -1 << endl;
        }else{
            cout << 'a' << endl;
        }
    }else if(n<k){
        cout << -1 << endl;
    }else if(n==k){
        string s="";
        for(int i=0 ; i<k ; i++){
            s+=('a'+i);
        }
        cout << s << endl;
    }else{
        string s="";
        for(int i=0 ; i<(n-k+2) ; i++){
            if(i%2){
                s+="b";
            }else{
                s+="a";
            }
        }
        for(int i=2 ; i<k ; i++){
            s+=('a'+i);
        }
        cout << s << endl;
    }
}

signed main(){
    fast;
    //freopen ("INPUT.txt","r",stdin);
    //freopen ("OUTPUT.txt","w",stdout);
    int test=1,TEST=1;
    precompute();
    cin >> test;
    while(test--){
        TEST_CASE();
    } 
    return 0;
}, In this Programming Language: C++, Now tell me if this Code is compilable or not?