#include #include #include #include #include #include #include #include #include #include #include #include #define vll vector #define vvvl vector #define vvl vector> #define VV(a, b, c, d) vector>(a, vector(b, c)) #define VVV(a, b, c, d) vector(a, vvl(b, vll (c, d))); #define re(c, b) for(ll c=0;c> n >> m; vll a(n);get(a); ll num = 0; ll MIN = 0, MAX = 0; string s;std::cin >> s; for(auto c:s){ if(c=='L') num--; else num++; MIN = min(MIN, num); MAX = max(MAX, num); } MIN = max(-(n-1), MIN); MAX = min(n-1, MAX); num = min(n-1, max(-(n-1), num)); ll l = abs(MIN); for(int i=0;i