Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include<bits/stdc++.h>
- using namespace std;
- #define op ios::sync_with_stdio(0);cin.tie(0);cout.tie(0)
- int main()
- {
- op;
- int t;
- cin>>t;
- for(int j=1;j<=t;j++){
- int n,k,d=0;
- cin>>n>>k;
- char c='A';
- string s;
- for(int i=1;i<=n;i++){
- s+=c;
- c++;
- }
- cout<<"Case "<<j<<":"<<"\n";
- do{
- cout<<s<<endl;
- d++;
- if(d==k) break;
- }while(next_permutation(s.begin(),s.end()));
- d=0;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement