#include #include #include #include #include #include #include #include #include using namespace std; typedef long long int lli; #define urept(soeji, start, n) for (int soeji = start; soeji < n; soeji++) #define drept(soeji, start, n) for (int soeji = start; soeji > n; soeji--) int main(void) { int N, K; cin >> N >> K; string s; cin >> s; int x = N - K + 1; for (int i = 0; i < x; i++) { //reverse(s.begin() + i, s.begin() + (i + K)); for (int j = i; j < (i + K) / 2; j++) { swap(s[j], s[j + K - 1]); } } cout << s << endl; return 0; }