#include<bits/stdc++.h>
using namespace std;
int main()
{
string s;
int t,x=0,y=0;
cin >> s >> t;
int n = s.length();
for (int i=0;i<t;i++)
{
int j = i%n;
if (s[j]=='E') x++;
else if (s[j]=='S') y--;
else if (s[j]=='W') x--;
else y++;
}
cout << x << " " << y << endl;
return 0;
}
有没有大佬知道我这个为什么TLE吗?啊啊啊