using namespace std; #include #define BEGIN ios_base::sync_with_stdio(0);cin.tie(0); #define END return EXIT_SUCCESS; #define FOR(I,A,B) for(int (I)=(A);(I)<(B);++(I)) #define ALL(C) (C).begin(),(C).end() inline void solve() { int N,K; string S; int t; int I[10001]; cin>>N>>K>>S; stack T; FOR(i,0,N) { if(S[i]=='(') { T.push(i); } else { t = T.top(); T.pop(); I[t] = i; I[i] = t; } } cout<<(I[K-1]+1)<