#include #include #include #include #include #include #include #include #include #include #include #include #include #include using namespace std; typedef long long ll; typedef long double ld; typedef std::vector vi; typedef std::vector vb; typedef std::vector vs; typedef std::vector vd; typedef std::vector vll; typedef std::vector > vvi; typedef vector vvll; typedef std::vector > vpi; typedef vector vvpi; typedef std::pair pi; typedef std::pair pll; typedef std::vector vpll; const long long mod = 1000000007; const unsigned gen_seed = std::chrono::system_clock::now().time_since_epoch().count(); std::mt19937_64 gen(gen_seed); #define all(c) (c).begin(),(c).end() #define forn(i, a, b) for(int i = a; i < b; i++) #define read(x) scanf("%d", &x) #define readv(x, n) vi x(n); forn(i,0,n) scanf("%d", &x[i]) #define pb push_back #define mp make_pair class stree { public: int s; vi t; vi lazy; void build (vi & a, int v, int tl, int tr) { if(v==1) { s = a.size(); t = vi(4*s, 0); lazy = vi(4*s, 0); } if (tl == tr) { t[v] = a[tl]; lazy[v] = 0; } else { int tm = (tl + tr) / 2; build (a, v*2, tl, tm); build (a, v*2+1, tm+1, tr); lazy[v] = 0; t[v] = max(t[v*2], t[v*2 + 1]); } } void push(int v) { if (lazy[v] == 0) return; t[v] += lazy[v]; if(v<2*s) { lazy[v*2] += lazy[v]; lazy[v*2 + 1] += lazy[v]; } lazy[v] = 0; } void update (int v, int tl, int tr, int l, int r, int add) { push(v); if (l > r) return; if (l == tl && tr == r) { lazy[v] += add; push(v); } else { int tm = (tl + tr) / 2; update (v*2, tl, tm, l, min(r,tm), add); update (v*2+1, tm+1, tr, max(l,tm+1), r, add); t[v] = max(t[v*2], t[v*2 + 1]); } } void set (int v, int tl, int tr, int pos, int val) { push(v); if (pos > tr || pos < tl) return; if (pos == tl && tr == pos) { t[v] = max(t[v],val); } else { int tm = (tl + tr) / 2; set (v*2, tl, tm, pos, val); set (v*2+1, tm+1, tr, pos, val); t[v] = max(t[v*2], t[v*2 + 1]); } } int getmax (int v, int tl, int tr, int l, int r) { push(v); if (l > r) return 0; if (l == tl && tr == r) { return t[v]; } else { int tm = (tl + tr) / 2; int ret = max(getmax(v*2, tl, tm, l, min(r,tm)), getmax(v*2+1, tm+1, tr, max(l,tm+1), r)); t[v] = max(t[v*2], t[v*2 + 1]); return ret; } } }; int main() { int tafa; scanf("%d", &tafa); forn(agag,0,tafa) { int n,m; scanf("%d %d\n", &m, &n); stree ec,dm; vi a(m,0); ec.build(a, 1, 0, m-1); dm.build(a, 1, 0, m-1); vvi pec(m); vvi pdm(m); vector t(n); forn(i,0,n) { scanf("%c", &t[i]); if(i= cur) ans[cur++] = i + 1; } forn(i,1,n+1) printf("%d ", ans[i]); printf("\n"); } }