#include <iostream>
#include <algorithm>
#include <cstdlib>
#include <ctime>
int main()
{
srand(time(0));
int n,k;
std::cin>>n>>k;
int arr[n];
for (int i=0; i<n; i++)
arr[i] = i+1;
}
int SIZE = sizeof(arr) / sizeof(*arr);
std::random_shuffle(arr, arr + SIZE );
for(int i=0; i<k; i++)
for(int j=0; j<n-1; j++)
if(arr[j]>arr[j+1])
std::swap(arr[j], arr[j+1]);
for (int i = 0; i < SIZE; ++i)
std::cout << arr[i]<<" ";
#include <iostream>
#include <algorithm>
#include <cstdlib>
#include <ctime>
int main()
{
srand(time(0));
int n,k;
std::cin>>n>>k;
int arr[n];
for (int i=0; i<n; i++)
{
arr[i] = i+1;
}
int SIZE = sizeof(arr) / sizeof(*arr);
std::random_shuffle(arr, arr + SIZE );
for(int i=0; i<k; i++)
for(int j=0; j<n-1; j++)
if(arr[j]>arr[j+1])
std::swap(arr[j], arr[j+1]);
for (int i = 0; i < SIZE; ++i)
std::cout << arr[i]<<" ";
}
#include <iostream>
#include <algorithm>
#include <cstdlib>
#include <ctime>
int main()
{
srand(time(0));
int n,k;
std::cin>>n>>k;
int arr[n];
for (int i=0; i<n; i++)
{
arr[i] = i+1;
}
int SIZE = sizeof(arr) / sizeof(*arr);
std::random_shuffle(arr, arr + SIZE );
for(int i=0; i<k; i++)
for(int j=0; j<n-1; j++)
if(arr[j]>arr[j+1])
std::swap(arr[j], arr[j+1]);
for (int i = 0; i < SIZE; ++i)
std::cout << arr[i]<<" ";
}