QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#241325 | #7686. The Phantom Menace | ucup-team1134# | AC ✓ | 2426ms | 376168kb | C++17 | 7.7kb | 2023-11-06 02:21:08 | 2023-11-06 02:21:08 |
Judging History
你现在查看的是测评时间为 2023-11-06 02:21:08 的历史记录
- [2024-10-08 14:11:03]
- hack成功,自动添加数据
- (/hack/941)
- [2024-10-08 10:05:28]
- hack成功,自动添加数据
- (/hack/940)
- [2024-10-07 19:51:15]
- hack成功,自动添加数据
- (/hack/938)
- [2024-10-07 19:28:01]
- hack成功,自动添加数据
- (/hack/937)
- [2024-10-07 17:16:32]
- hack成功,自动添加数据
- (/hack/936)
- [2024-10-07 16:53:09]
- hack成功,自动添加数据
- (/hack/935)
- [2024-10-07 16:22:17]
- hack成功,自动添加数据
- (/hack/934)
- [2023-11-09 15:33:42]
- hack成功,自动添加数据
- (//qoj.ac/hack/445)
- [2023-11-06 02:21:08]
- 提交
answer
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
template<class T>bool chmax(T &a, const T &b) { if (a<b) { a=b; return true; } return false; }
template<class T>bool chmin(T &a, const T &b) { if (b<a) { a=b; return true; } return false; }
#define all(x) (x).begin(),(x).end()
#define fi first
#define se second
#define mp make_pair
#define si(x) int(x.size())
const int mod1=1000000009,mod2=1000099999,MAX=2000005,INF=1<<30;
struct Rollinghash{
string S;
int n;
int base1;
int base2;
vector<ll> h1,h2,ru1,ru2;
void make(string &T,int ba1,int ba2){
S=T;
n=S.size();
h1.assign(n+1,0);
h2.assign(n+1,0);
ru1.assign(n+1,0);
ru2.assign(n+1,0);
base1=ba1;
base2=ba2;
ru1[0]=1;
ru2[0]=1;
for(int i=1;i<=n;i++){
h1[i]=h1[i-1]*base1+ll(S[i-1]-'a'+1);
h1[i]%=mod1;
h2[i]=h2[i-1]*base2+ll(S[i-1]-'a'+1);
h2[i]%=mod2;
ru1[i]=ru1[i-1]*base1%mod1;
ru2[i]=ru2[i-1]*base2%mod2;
}
}
pair<ll,ll> ha(int l,int r){
pair<ll,ll> res;
res.fi=(h1[r]-h1[l]*ru1[r-l]%mod1+mod1)%mod1;
res.se=(h2[r]-h2[l]*ru2[r-l]%mod2+mod2)%mod2;
return res;
}//開区間
};
struct UF{
int n;
vector<int> par,size,edge;
void init(int n_){
n=n_;
par.assign(n,-1);
size.assign(n,1);
edge.assign(n,0);
for(int i=0;i<n;i++){
par[i]=i;
}
}
int root(int a){
if(par[a]==a) return a;
else return par[a]=root(par[a]);
}
void unite(int a,int b){
edge[root(a)]++;
if(root(a)!=root(b)){
size[root(a)]+=size[root(b)];
edge[root(a)]+=edge[root(b)];
par[root(b)]=root(a);
}
}
bool check(int a,int b){
return root(a)==root(b);
}
};
// https://kopricky.github.io/code/Graph/euler_trail.html
class EulerPath
{
public:
int V;
vector<vector<int> > G;
vector<int> degree, ans;
EulerPath(int node_size) : V(node_size), G(V), degree(V, 0){}
map<pair<int,int>,vector<int>> MA;
void add_edge(int u, int v,int t){
G[u].push_back(v), degree[u]++, degree[v]--;
MA[mp(u,v)].push_back(t);
}
int judge(){
int s = -1; bool out = false, in = false;
for(int i = 0; i < V; i++){
if(degree[i] == 0) continue;
if(degree[i] == 1){
if(out) return -1;
out = true, s = i;
}else if(degree[i] == -1){
if(in) return -1;
in = true;
}else return -1;
}
return max(s, 0);
}
vector<int> solve(){
int cur = judge();
if(V == 0 || cur < 0) return {};
stack<int> cur_path;
cur_path.push(cur);
while(!cur_path.empty()){
if(!G[cur].empty()){
cur_path.push(cur);
int nx = G[cur].back();
G[cur].pop_back();
cur = nx;
}else{
ans.push_back(cur);
cur = cur_path.top(), cur_path.pop();
}
}
reverse(ans.begin(), ans.end());
if(ans[0]!=ans.back()) return {};
vector<int> E;
for(int i=0;i+1<si(ans);i++){
if(!MA.count(mp(ans[i],ans[i+1]))) return {};
E.push_back(MA[mp(ans[i],ans[i+1])].back());
MA[mp(ans[i],ans[i+1])].pop_back();
}
return E;
}
};
int main(){
std::ifstream in("text.txt");
std::cin.rdbuf(in.rdbuf());
cin.tie(0);
ios::sync_with_stdio(false);
mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());
ll ha1=rng()%mod1;
ll ha2=rng()%mod2;
int Q;cin>>Q;
while(Q--){
int N,M;cin>>N>>M;
vector<string> S(N),T(N);
for(int i=0;i<N;i++) cin>>S[i];
for(int i=0;i<N;i++) cin>>T[i];
{
vector<pair<string,int>> A(N),B(N);
for(int i=0;i<N;i++) A[i]=mp(S[i],i);
for(int i=0;i<N;i++) B[i]=mp(T[i],i);
sort(all(A));
sort(all(B));
bool ch=true;
for(int i=0;i<N;i++) ch&=(A[i].fi==B[i].fi);
if(ch){
for(int i=0;i<N;i++) cout<<A[i].se+1<<" ";
cout<<endl;
for(int i=0;i<N;i++) cout<<B[i].se+1<<" ";
cout<<endl;
continue;
}
}
vector<Rollinghash> rol(2*N);
for(int i=0;i<N;i++){
rol[i].make(S[i],ha1,ha2);
}
for(int i=0;i<N;i++){
rol[N+i].make(T[i],ha1,ha2);
}
vector<int> ans1,ans2;
for(int al=1;al<M;al++){
vector<pair<pair<ll,ll>,int>> use;
for(int i=0;i<N;i++){
use.push_back(mp(rol[i].ha(0,al),0));
use.push_back(mp(rol[i].ha(al,M),1));
}
for(int i=0;i<N;i++){
use.push_back(mp(rol[N+i].ha(0,M-al),1));
use.push_back(mp(rol[N+i].ha(M-al,M),0));
}
sort(all(use));
use.erase(unique(all(use)),use.end());
int K=si(use);
auto f=[&](pair<pair<ll,ll>,int> x){
return (int)(lower_bound(all(use),x)-use.begin());
};
UF uf;uf.init(K);
EulerPath EP(K);
for(int i=0;i<N;i++){
int s=f(mp(rol[i].ha(0,al),0)),t=f(mp(rol[i].ha(al,M),1));
//G[s].push_back(mp(t,i));
EP.add_edge(s,t,i);
//cout<<s<<" "<<t<<endl;
uf.unite(s,t);
}
for(int i=0;i<N;i++){
int s=f(mp(rol[N+i].ha(0,M-al),1)),t=f(mp(rol[N+i].ha(M-al,M),0));
//G[s].push_back(mp(t,N+i));
EP.add_edge(s,t,N+i);
//cout<<s<<" "<<t<<endl;
uf.unite(s,t);
}
if(uf.size[uf.root(0)]!=K) continue;
auto tr=EP.solve();
if(si(tr)){
for(int i=0;i<2*N;i++){
if(i%2==0) ans1.push_back(tr[i]);
else ans2.push_back(tr[i]);
}
break;
}
/*
if(si(EP.solve()){
for(int i=0;i<K;i++) cout<<use[i].se<<" ";
cout<<endl;
for(int a:EP.ans) cout<<a<<" ";
cout<<endl;
}
*/
/*
vector<int> tr;
DFS(0,tr);
for(int i=0;i<K;i++){
G[i].clear();
visited[2*i]=visited[2*i+1]=false;
}
if(si(tr)==N+N){
for(int i=0;i<2*N;i++){
if(i%2==0) ans1.push_back(tr[i]);
else ans2.push_back(tr[i]);
}
break;
}
*/
}
if(si(ans1)==0) cout<<-1<<"\n";
else{
if(ans1[0]>=N) swap(ans1,ans2);
for(int a:ans1) cout<<a+1<<" ";
cout<<endl;
for(int a:ans2) cout<<a+1-N<<" ";
cout<<endl;
}
}
}
这程序好像有点Bug,我给组数据试试?
詳細信息
Test #1:
score: 100
Accepted
time: 1ms
memory: 3600kb
input:
2 3 3 abc ghi def bcd efg hia 1 3 abc def
output:
1 3 2 1 2 3 -1
result:
ok 2 cases (2 test cases)
Test #2:
score: 0
Accepted
time: 611ms
memory: 3712kb
input:
1000000 1 1 b b 1 1 a b 1 1 b a 1 1 a a 1 1 b b 1 1 a b 1 1 b a 1 1 a a 1 1 b b 1 1 a b 1 1 b a 1 1 a a 1 1 b b 1 1 a b 1 1 b a 1 1 a a 1 1 b b 1 1 a b 1 1 b a 1 1 a a 1 1 b b 1 1 a b 1 1 b a 1 1 a a 1 1 b b 1 1 a b 1 1 b a 1 1 a a 1 1 b b 1 1 a b 1 1 b a 1 1 a a 1 1 b b 1 1 a b 1 1 b a 1 1 a a 1 1 ...
output:
1 1 -1 -1 1 1 1 1 -1 -1 1 1 1 1 -1 -1 1 1 1 1 -1 -1 1 1 1 1 -1 -1 1 1 1 1 -1 -1 1 1 1 1 -1 -1 1 1 1 1 -1 -1 1 1 1 1 -1 -1 1 1 1 1 -1 -1 1 1 1 1 -1 -1 1 1 1 1 -1 -1 1 1 1 1 -1 -1 1 1 1 1 -1 -1 1 1 1 1 -1 -1 1 1 1 1 -1 -1 1 1 1 1 -1 -1 ...
result:
ok 1000000 cases (1000000 test cases)
Test #3:
score: 0
Accepted
time: 545ms
memory: 3576kb
input:
500000 1 2 dd ba 1 2 cd ba 1 2 bd ba 1 2 ad ba 1 2 dc ba 1 2 cc ba 1 2 bc ba 1 2 ac ba 1 2 db ba 1 2 cb ba 1 2 bb ba 1 2 ab ba 1 2 da ba 1 2 ca ba 1 2 ba ba 1 2 aa ba 1 2 dd aa 1 2 cd aa 1 2 bd aa 1 2 ad aa 1 2 dc aa 1 2 cc aa 1 2 bc aa 1 2 ac aa 1 2 db aa 1 2 cb aa 1 2 bb aa 1 2 ab aa 1 2 da aa 1 2...
output:
-1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 1 1 -1 -1 1 1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 1 1 1 1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 1 1 -1 -1 1 1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 1 1 -1 -1 -1 -1 -1 1 1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 1 1 -1 -1 -1 -1 -1 -1 -1 ...
result:
ok 500000 cases (500000 test cases)
Test #4:
score: 0
Accepted
time: 391ms
memory: 3828kb
input:
500000 2 1 d d b a 2 1 c d b a 2 1 b d b a 2 1 a d b a 2 1 d c b a 2 1 c c b a 2 1 b c b a 2 1 a c b a 2 1 d b b a 2 1 c b b a 2 1 b b b a 2 1 a b b a 2 1 d a b a 2 1 c a b a 2 1 b a b a 2 1 a a b a 2 1 d d a a 2 1 c d a a 2 1 b d a a 2 1 a d a a 2 1 d c a a 2 1 c c a a 2 1 b c a a 2 1 a c a a 2 1 d...
output:
-1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 1 2 2 1 -1 -1 2 1 2 1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 1 2 1 2 1 2 1 2 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 1 2 1 2 -1 -1 2 1 1 2 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 1 2 1 2 -1 -1 -1 -1 -1 2 1 1 2 -1 -1 -1 -1 -1 -1 -1 -1 -...
result:
ok 500000 cases (500000 test cases)
Test #5:
score: 0
Accepted
time: 460ms
memory: 3568kb
input:
333333 1 3 cbb bfa 1 3 bbb bfa 1 3 abb bfa 1 3 fab bfa 1 3 eab bfa 1 3 dab bfa 1 3 cab bfa 1 3 bab bfa 1 3 aab bfa 1 3 ffa bfa 1 3 efa bfa 1 3 dfa bfa 1 3 cfa bfa 1 3 bfa bfa 1 3 afa bfa 1 3 fea bfa 1 3 eea bfa 1 3 dea bfa 1 3 cea bfa 1 3 bea bfa 1 3 aea bfa 1 3 fda bfa 1 3 eda bfa 1 3 dda bfa 1 3 c...
output:
-1 -1 -1 1 1 -1 -1 -1 -1 -1 -1 -1 -1 -1 1 1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 1 1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 ...
result:
ok 333333 cases (333333 test cases)
Test #6:
score: 0
Accepted
time: 372ms
memory: 3596kb
input:
333333 3 1 c b b b f a 3 1 b b b b f a 3 1 a b b b f a 3 1 f a b b f a 3 1 e a b b f a 3 1 d a b b f a 3 1 c a b b f a 3 1 b a b b f a 3 1 a a b b f a 3 1 f f a b f a 3 1 e f a b f a 3 1 d f a b f a 3 1 c f a b f a 3 1 b f a b f a 3 1 a f a b f a 3 1 f e a b f a 3 1 e e a b f a 3 1 d e a b f a 3 1 c...
output:
-1 -1 -1 2 3 1 3 1 2 -1 -1 -1 -1 -1 -1 -1 -1 -1 3 1 2 3 1 2 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 3 2 1 3 1 2 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 1 2 3 1 3 2 -1 -1 -1 -1 -...
result:
ok 333333 cases (333333 test cases)
Test #7:
score: 0
Accepted
time: 443ms
memory: 3880kb
input:
250000 1 4 hbca fhaa 1 4 gbca fhaa 1 4 fbca fhaa 1 4 ebca fhaa 1 4 dbca fhaa 1 4 cbca fhaa 1 4 bbca fhaa 1 4 abca fhaa 1 4 haca fhaa 1 4 gaca fhaa 1 4 faca fhaa 1 4 eaca fhaa 1 4 daca fhaa 1 4 caca fhaa 1 4 baca fhaa 1 4 aaca fhaa 1 4 hhba fhaa 1 4 ghba fhaa 1 4 fhba fhaa 1 4 ehba fhaa 1 4 dhba fhaa...
output:
-1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 1 1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 ...
result:
ok 250000 cases (250000 test cases)
Test #8:
score: 0
Accepted
time: 425ms
memory: 3868kb
input:
250000 4 1 h b c a f h a a 4 1 g b c a f h a a 4 1 f b c a f h a a 4 1 e b c a f h a a 4 1 d b c a f h a a 4 1 c b c a f h a a 4 1 b b c a f h a a 4 1 a b c a f h a a 4 1 h a c a f h a a 4 1 g a c a f h a a 4 1 f a c a f h a a 4 1 e a c a f h a a 4 1 d a c a f h a a 4 1 c a c a f h a a 4 1 b a c a f...
output:
-1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 3 4 1 2 3 4 1 2 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 ...
result:
ok 250000 cases (250000 test cases)
Test #9:
score: 0
Accepted
time: 432ms
memory: 3580kb
input:
200000 1 5 jjjjj baaaa 1 5 ijjjj baaaa 1 5 hjjjj baaaa 1 5 gjjjj baaaa 1 5 fjjjj baaaa 1 5 ejjjj baaaa 1 5 djjjj baaaa 1 5 cjjjj baaaa 1 5 bjjjj baaaa 1 5 ajjjj baaaa 1 5 jijjj baaaa 1 5 iijjj baaaa 1 5 hijjj baaaa 1 5 gijjj baaaa 1 5 fijjj baaaa 1 5 eijjj baaaa 1 5 dijjj baaaa 1 5 cijjj baaaa 1 5 b...
output:
-1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 ...
result:
ok 200000 cases (200000 test cases)
Test #10:
score: 0
Accepted
time: 420ms
memory: 3580kb
input:
200000 5 1 j j j j j b a a a a 5 1 i j j j j b a a a a 5 1 h j j j j b a a a a 5 1 g j j j j b a a a a 5 1 f j j j j b a a a a 5 1 e j j j j b a a a a 5 1 d j j j j b a a a a 5 1 c j j j j b a a a a 5 1 b j j j j b a a a a 5 1 a j j j j b a a a a 5 1 j i j j j b a a a a 5 1 i i j j j b a a a a 5 1 h...
output:
-1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 ...
result:
ok 200000 cases (200000 test cases)
Test #11:
score: 0
Accepted
time: 422ms
memory: 3636kb
input:
250000 2 2 hb ca fh aa 2 2 gb ca fh aa 2 2 fb ca fh aa 2 2 eb ca fh aa 2 2 db ca fh aa 2 2 cb ca fh aa 2 2 bb ca fh aa 2 2 ab ca fh aa 2 2 ha ca fh aa 2 2 ga ca fh aa 2 2 fa ca fh aa 2 2 ea ca fh aa 2 2 da ca fh aa 2 2 ca ca fh aa 2 2 ba ca fh aa 2 2 aa ca fh aa 2 2 hh ba fh aa 2 2 gh ba fh aa 2 2 f...
output:
-1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 2 1 2 1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1...
result:
ok 250000 cases (250000 test cases)
Test #12:
score: 0
Accepted
time: 380ms
memory: 3676kb
input:
166666 2 3 jef aia aaa aaa 2 3 ief aia aaa aaa 2 3 hef aia aaa aaa 2 3 gef aia aaa aaa 2 3 fef aia aaa aaa 2 3 eef aia aaa aaa 2 3 def aia aaa aaa 2 3 cef aia aaa aaa 2 3 bef aia aaa aaa 2 3 aef aia aaa aaa 2 3 ldf aia aaa aaa 2 3 kdf aia aaa aaa 2 3 jdf aia aaa aaa 2 3 idf aia aaa aaa 2 3 hdf aia a...
output:
-1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 ...
result:
ok 166666 cases (166666 test cases)
Test #13:
score: 0
Accepted
time: 377ms
memory: 3732kb
input:
166666 3 2 je fa ia aa aa aa 3 2 ie fa ia aa aa aa 3 2 he fa ia aa aa aa 3 2 ge fa ia aa aa aa 3 2 fe fa ia aa aa aa 3 2 ee fa ia aa aa aa 3 2 de fa ia aa aa aa 3 2 ce fa ia aa aa aa 3 2 be fa ia aa aa aa 3 2 ae fa ia aa aa aa 3 2 ld fa ia aa aa aa 3 2 kd fa ia aa aa aa 3 2 jd fa ia aa aa aa 3 2 id ...
output:
-1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 ...
result:
ok 166666 cases (166666 test cases)
Test #14:
score: 0
Accepted
time: 355ms
memory: 3716kb
input:
125000 2 4 heio baaa aaaa aaaa 2 4 geio baaa aaaa aaaa 2 4 feio baaa aaaa aaaa 2 4 eeio baaa aaaa aaaa 2 4 deio baaa aaaa aaaa 2 4 ceio baaa aaaa aaaa 2 4 beio baaa aaaa aaaa 2 4 aeio baaa aaaa aaaa 2 4 pdio baaa aaaa aaaa 2 4 odio baaa aaaa aaaa 2 4 ndio baaa aaaa aaaa 2 4 mdio baaa aaaa aaaa 2 4 l...
output:
-1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 ...
result:
ok 125000 cases (125000 test cases)
Test #15:
score: 0
Accepted
time: 432ms
memory: 3732kb
input:
125000 4 2 he io ba aa aa aa aa aa 4 2 ge io ba aa aa aa aa aa 4 2 fe io ba aa aa aa aa aa 4 2 ee io ba aa aa aa aa aa 4 2 de io ba aa aa aa aa aa 4 2 ce io ba aa aa aa aa aa 4 2 be io ba aa aa aa aa aa 4 2 ae io ba aa aa aa aa aa 4 2 pd io ba aa aa aa aa aa 4 2 od io ba aa aa aa aa aa 4 2 nd io ba ...
output:
-1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 ...
result:
ok 125000 cases (125000 test cases)
Test #16:
score: 0
Accepted
time: 363ms
memory: 3648kb
input:
100000 2 5 ttjma aaaaa aaaaa aaaaa 2 5 stjma aaaaa aaaaa aaaaa 2 5 rtjma aaaaa aaaaa aaaaa 2 5 qtjma aaaaa aaaaa aaaaa 2 5 ptjma aaaaa aaaaa aaaaa 2 5 otjma aaaaa aaaaa aaaaa 2 5 ntjma aaaaa aaaaa aaaaa 2 5 mtjma aaaaa aaaaa aaaaa 2 5 ltjma aaaaa aaaaa aaaaa 2 5 ktjma aaaaa aaaaa aaaaa 2 5 jtjma aaa...
output:
-1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 ...
result:
ok 100000 cases (100000 test cases)
Test #17:
score: 0
Accepted
time: 413ms
memory: 3652kb
input:
100000 5 2 tt jm aa aa aa aa aa aa aa aa 5 2 st jm aa aa aa aa aa aa aa aa 5 2 rt jm aa aa aa aa aa aa aa aa 5 2 qt jm aa aa aa aa aa aa aa aa 5 2 pt jm aa aa aa aa aa aa aa aa 5 2 ot jm aa aa aa aa aa aa aa aa 5 2 nt jm aa aa aa aa aa aa aa aa 5 2 mt jm aa aa aa aa aa aa aa aa 5 2 lt jm aa aa aa aa...
output:
-1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 ...
result:
ok 100000 cases (100000 test cases)
Test #18:
score: 0
Accepted
time: 341ms
memory: 3672kb
input:
111111 3 3 oqa bba aaa aaa aaa aaa 3 3 nqa bba aaa aaa aaa aaa 3 3 mqa bba aaa aaa aaa aaa 3 3 lqa bba aaa aaa aaa aaa 3 3 kqa bba aaa aaa aaa aaa 3 3 jqa bba aaa aaa aaa aaa 3 3 iqa bba aaa aaa aaa aaa 3 3 hqa bba aaa aaa aaa aaa 3 3 gqa bba aaa aaa aaa aaa 3 3 fqa bba aaa aaa aaa aaa 3 3 eqa bba a...
output:
-1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 ...
result:
ok 111111 cases (111111 test cases)
Test #19:
score: 0
Accepted
time: 321ms
memory: 3676kb
input:
83333 3 4 eqag aaaa aaaa aaaa aaaa aaaa 3 4 dqag aaaa aaaa aaaa aaaa aaaa 3 4 cqag aaaa aaaa aaaa aaaa aaaa 3 4 bqag aaaa aaaa aaaa aaaa aaaa 3 4 aqag aaaa aaaa aaaa aaaa aaaa 3 4 xpag aaaa aaaa aaaa aaaa aaaa 3 4 wpag aaaa aaaa aaaa aaaa aaaa 3 4 vpag aaaa aaaa aaaa aaaa aaaa 3 4 upag aaaa aaaa aaa...
output:
-1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 ...
result:
ok 83333 cases (83333 test cases)
Test #20:
score: 0
Accepted
time: 385ms
memory: 3716kb
input:
83333 4 3 eqa gaa aaa aaa aaa aaa aaa aaa 4 3 dqa gaa aaa aaa aaa aaa aaa aaa 4 3 cqa gaa aaa aaa aaa aaa aaa aaa 4 3 bqa gaa aaa aaa aaa aaa aaa aaa 4 3 aqa gaa aaa aaa aaa aaa aaa aaa 4 3 xpa gaa aaa aaa aaa aaa aaa aaa 4 3 wpa gaa aaa aaa aaa aaa aaa aaa 4 3 vpa gaa aaa aaa aaa aaa aaa aaa 4 3 up...
output:
-1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 ...
result:
ok 83333 cases (83333 test cases)
Test #21:
score: 0
Accepted
time: 325ms
memory: 3880kb
input:
66666 3 5 bquda aaaaa aaaaa aaaaa aaaaa aaaaa 3 5 aquda aaaaa aaaaa aaaaa aaaaa aaaaa 3 5 zpuda aaaaa aaaaa aaaaa aaaaa aaaaa 3 5 ypuda aaaaa aaaaa aaaaa aaaaa aaaaa 3 5 xpuda aaaaa aaaaa aaaaa aaaaa aaaaa 3 5 wpuda aaaaa aaaaa aaaaa aaaaa aaaaa 3 5 vpuda aaaaa aaaaa aaaaa aaaaa aaaaa 3 5 upuda aaaa...
output:
-1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 ...
result:
ok 66666 cases (66666 test cases)
Test #22:
score: 0
Accepted
time: 372ms
memory: 3656kb
input:
66666 5 3 bqu daa aaa aaa aaa aaa aaa aaa aaa aaa 5 3 aqu daa aaa aaa aaa aaa aaa aaa aaa aaa 5 3 zpu daa aaa aaa aaa aaa aaa aaa aaa aaa 5 3 ypu daa aaa aaa aaa aaa aaa aaa aaa aaa 5 3 xpu daa aaa aaa aaa aaa aaa aaa aaa aaa 5 3 wpu daa aaa aaa aaa aaa aaa aaa aaa aaa 5 3 vpu daa aaa aaa aaa aaa aa...
output:
-1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 ...
result:
ok 66666 cases (66666 test cases)
Test #23:
score: 0
Accepted
time: 284ms
memory: 3872kb
input:
20833 6 8 gvebaaaa aaaaaaaa aaaaaaaa aaaaaaaa aaaaaaaa aaaaaaaa aaaaaaaa aaaaaaaa aaaaaaaa aaaaaaaa aaaaaaaa aaaaaaaa 6 8 fvebaaaa aaaaaaaa aaaaaaaa aaaaaaaa aaaaaaaa aaaaaaaa aaaaaaaa aaaaaaaa aaaaaaaa aaaaaaaa aaaaaaaa aaaaaaaa 6 8 evebaaaa aaaaaaaa aaaaaaaa aaaaaaaa aaaaaaaa aaaaaaaa aaaaaaaa aaa...
output:
-1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 ...
result:
ok 20833 cases (20833 test cases)
Test #24:
score: 0
Accepted
time: 260ms
memory: 3668kb
input:
15873 9 7 mmxaaaa aaaaaaa aaaaaaa aaaaaaa aaaaaaa aaaaaaa aaaaaaa aaaaaaa aaaaaaa aaaaaaa aaaaaaa aaaaaaa aaaaaaa aaaaaaa aaaaaaa aaaaaaa aaaaaaa aaaaaaa 9 7 lmxaaaa aaaaaaa aaaaaaa aaaaaaa aaaaaaa aaaaaaa aaaaaaa aaaaaaa aaaaaaa aaaaaaa aaaaaaa aaaaaaa aaaaaaa aaaaaaa aaaaaaa aaaaaaa aaaaaaa aaaaaa...
output:
-1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 ...
result:
ok 15873 cases (15873 test cases)
Test #25:
score: 0
Accepted
time: 256ms
memory: 3672kb
input:
10000 10 10 puoaaaaaaa aaaaaaaaaa aaaaaaaaaa aaaaaaaaaa aaaaaaaaaa aaaaaaaaaa aaaaaaaaaa aaaaaaaaaa aaaaaaaaaa aaaaaaaaaa aaaaaaaaaa aaaaaaaaaa aaaaaaaaaa aaaaaaaaaa aaaaaaaaaa aaaaaaaaaa aaaaaaaaaa aaaaaaaaaa aaaaaaaaaa aaaaaaaaaa 10 10 ouoaaaaaaa aaaaaaaaaa aaaaaaaaaa aaaaaaaaaa aaaaaaaaaa aaaaaaa...
output:
-1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 ...
result:
ok 10000 cases (10000 test cases)
Test #26:
score: 0
Accepted
time: 387ms
memory: 3804kb
input:
250000 2 2 od ah ha do 2 2 il ng il ng 2 2 cf pf pf cf 2 2 wx ll wx ll 2 2 fg ge ge fg 2 2 dg mj dg mj 2 2 rj vw wr jv 2 2 er pv pv er 2 2 kc lb cl bk 2 2 dh zc hz cd 2 2 qv ce eq vc 2 2 lz um zu ml 2 2 hw xx hw xx 2 2 uk un ku nu 2 2 sg kx gs xk 2 2 ib xw ib xw 2 2 ar pd pd ar 2 2 ij si ii js 2 2 p...
output:
-1 1 2 1 2 1 2 2 1 2 1 2 1 1 2 2 1 1 2 1 2 2 1 2 1 1 2 2 1 1 2 2 1 1 2 2 1 2 1 1 2 1 2 1 2 1 2 1 2 2 1 1 2 -1 1 2 1 2 1 2 2 1 1 2 2 1 2 1 1 2 2 1 2 1 -1 2 1 1 2 2 1 1 2 1 2 2 1 2 1 2 1 1 2 1 2 2 1 1 2 -1 2 1 1 2 2 1 1 2 1 2 2 1 2 1 2 1 1 2 2 1...
result:
ok 250000 cases (250000 test cases)
Test #27:
score: 0
Accepted
time: 396ms
memory: 3600kb
input:
166666 2 3 aib avi aib avi 2 3 btw xjw xjw btw 2 3 dng ouv uvd ngo 2 3 ctq sve sve ctq 2 3 ott obm ott obm 2 3 aly tmx aly tmx 2 3 nhm zar arn hmz 2 3 knr qpa nrq pak 2 3 gsw fyn sng ywf 2 3 qcy rov qcy rov 2 3 nmj tyx tyx nmj 2 3 dbu pim pim dbu 2 3 afj zwf ffa wjz 2 3 vgo sky gyv kos 2 3 zru bog u...
output:
1 2 1 2 1 2 2 1 1 2 2 1 1 2 2 1 2 1 2 1 1 2 1 2 1 2 2 1 1 2 1 2 -1 1 2 1 2 1 2 2 1 1 2 2 1 -1 -1 -1 -1 1 2 1 2 -1 2 1 1 2 1 2 2 1 -1 2 1 1 2 1 2 1 2 2 1 1 2 2 1 2 1 1 2 2 1 1 2 1 2 1 2 1 2 1 2 1 2 -1 1 2 1 2 1 2 1 2 1 2 2 1 2 1 2 1 2 1 2 1 -1 1 2...
result:
ok 166666 cases (166666 test cases)
Test #28:
score: 0
Accepted
time: 391ms
memory: 3648kb
input:
166666 3 2 yx pd tl dt xy lp 3 2 xb pc cr xb pc cr 3 2 bw bl so bw bl so 3 2 oq eu tx eu oq tx 3 2 tk ul ep le kt pu 3 2 ze en iq qe ei nz 3 2 zn vd nz nv zn dz 3 2 sn aa sl aa sn sl 3 2 cn lx jn cn lx jn 3 2 il td rf rf td il 3 2 up mr ex ru xe pm 3 2 pk vn pk pk vn pk 3 2 ke vj cp ke cp vj 3 2 aq ...
output:
-1 3 2 1 3 2 1 2 1 3 2 1 3 2 1 3 1 2 3 -1 2 1 3 3 2 1 -1 2 3 1 1 3 2 1 3 2 1 3 2 1 3 2 3 1 2 -1 1 3 2 1 3 2 3 1 2 2 1 3 1 2 3 1 3 2 3 2 1 1 3 2 1 2 3 1 2 3 3 1 2 1 3 2 1 2 3 3 1 2 1 3 2 2 1 3 1 2 3 3 2 1 2 1 3 3 1 2 2 1 3 2 1 3 3 2 1 3 1 2 1 3 2 3 1 2 3 1 2 3...
result:
ok 166666 cases (166666 test cases)
Test #29:
score: 0
Accepted
time: 255ms
memory: 3728kb
input:
125000 8 1 b j r k f e h g f g h e r j b k 8 1 v d t w h h k o w v d h k h o t 8 1 s u k a a v i d a d v u s a k i 8 1 j l p m z o s f z o f l m p s j 8 1 h v s i j d a w d i j s w a h v 8 1 a h a e b w m l e l a m a h w b 8 1 q f y l s m d c c f d q y l s m 8 1 q c o k n a v w k q v n c a o w 8 1 f...
output:
1 6 5 8 7 2 4 3 7 4 1 2 3 6 8 5 2 5 6 7 8 3 1 4 3 4 6 5 7 8 2 1 4 5 8 7 3 1 2 6 1 6 2 8 7 5 4 3 8 1 2 4 6 3 7 5 3 8 4 5 2 6 7 1 7 6 1 4 5 3 2 8 6 1 7 2 3 4 8 5 1 3 5 4 2 8 7 6 3 5 8 1 6 2 4 7 8 7 2 4 6 1 5 3 1 3 2 6 8 4 7 5 6 2 4 5 3 1 7 8 6 5 1 4 7 2 3 8 1 4 6 2 5 7 3 8 2 4 5 8 1 3...
result:
ok 125000 cases (125000 test cases)
Test #30:
score: 0
Accepted
time: 365ms
memory: 3576kb
input:
100000 1 10 klhmhvkswy wykjhmhvks 1 10 uqieigoabd qieigoabdu 1 10 bunljqpvov vbunljqivo 1 10 ytkmhxtntc xtntcytkmh 1 10 lufmlhxbvz ufmlcxbvzl 1 10 cuemsefukn sefukncueq 1 10 oomyzzliuk zzliukoomy 1 10 piekrxtsag rxtsagpiek 1 10 pwhbveolnf nfpwhbveol 1 10 wsyjzqnbtj jzqnbojwsy 1 10 iqayiqecea aiqaytq...
output:
-1 1 1 -1 1 1 -1 -1 1 1 1 1 1 1 -1 -1 1 1 -1 -1 1 1 1 1 -1 1 1 -1 -1 -1 -1 -1 1 1 1 1 -1 1 1 1 1 -1 1 1 -1 -1 1 1 -1 1 1 1 1 -1 -1 1 1 1 1 1 1 1 1 1 1 -1 1 1 1 1 1 1 1 1 -1 1 1 -1 -1 -1 1 1 -1 1 1 -1 -1 1 1 -1 -1 -1 1 1 1 1 -1 -1 1 1 ...
result:
ok 100000 cases (100000 test cases)
Test #31:
score: 0
Accepted
time: 462ms
memory: 3692kb
input:
28571 7 5 rpdbr kijbw qotha wvxmn frbey tdjed vqpoy havot bwfrb edrpd mnkij eyqqp oytdj brwvx 7 5 pecul iozuk kxkfg ivcha erold abatw otvoe otvoe kxkfg abatw ivcha pecul erold iozuk 7 5 qmwhz odnhu dkzle roeec xftep axzal kgusp ecdgu huxft epqmw lekkz alroe hzaxz spodn 7 5 aefno popfk shavv cvhdy na...
output:
-1 6 5 2 4 3 7 1 3 6 7 4 2 1 5 -1 1 7 4 6 3 5 2 5 4 6 1 7 2 3 -1 3 2 6 4 5 7 1 4 6 1 3 5 7 2 6 3 2 4 5 7 1 3 7 6 5 2 1 4 -1 3 7 5 6 2 1 4 4 5 3 1 2 7 6 -1 -1 3 6 7 2 4 5 1 2 7 1 5 4 6 3 7 3 5 6 4 2 1 1 5 3 6 2 4 7 -1 1 3 7 5 2 4 6 2 5 7 3 4 6 1 6 7 4 1 5 3 2 4 7 6 1 2 5 3 3 7 4 1 2...
result:
ok 28571 cases (28571 test cases)
Test #32:
score: 0
Accepted
time: 1340ms
memory: 71400kb
input:
1 1000 1000 plxpgukngtaywjrcxufvdwswaozxzeeduaeqslxuzcevplzosuqsedbplkmzbpyogbndbzmyfeyqamtetcjmaosbaxcrmjanjeglavxlwksvvenehzgrovffaebdtpynzajedywisavqgjjtjnqktzltyfzbvrtsfmdkzsyougzyqcckjcjjtkewysagddaizqnnptunmfyqagnxrzjqpsoqzqptzvjnfilpbgmjbetcgnewclwqxmftpepudwufcmbqtpyxajfmabqyvlgqxzhgumauzxms...
output:
-1
result:
ok 1 cases (1 test case)
Test #33:
score: 0
Accepted
time: 931ms
memory: 376168kb
input:
1 500000 2 bh nk zd bw cc la zr if ts tq nz td rv th nw az pa qy cq uu rk sl du ll jn fw qm rw va ii as hw wo vt zi yt wx xd en ws we rw gk lp hh qp fj cu uu bp uq ge lb sa hg yx gm cu tr wj ws ei cv ct wn at ju mo bm ht ep ul jt yw wu ml sh vt kp ha ws qy pn nz aq wa my mf bq ff xo br uc pt ne ya i...
output:
499985 499960 499961 499988 499991 499936 499976 499975 499922 499990 499980 499918 499959 499998 499993 499999 499863 499984 499983 499965 499986 499909 499964 499839 499932 499966 499866 499949 499989 499859 499940 499968 499951 499852 499994 499972 499948 499917 499938 499970 499848 499979 499894...
result:
ok 1 cases (1 test case)
Test #34:
score: 0
Accepted
time: 637ms
memory: 144036kb
input:
1 1000000 1 f l m t y i g k v k g z f h n e v m b g a n i u v a k b e j x n m u a x a g t g a g v p q f g q i f t l t t w z l z n m v r v v t x w q h x h k n t m i y k e j b m u q x n u t v f n h z w g v r m x c a g x p p n w y x j t b d z n h f u u i y p c w b m d k p p m q j k o g g b r w c y d h ...
output:
21 26 35 37 41 101 159 169 171 223 234 265 281 285 347 359 364 384 388 402 472 473 481 529 551 557 579 604 613 685 710 717 760 768 775 779 852 861 863 870 883 903 909 935 940 961 1004 1020 1069 1071 1085 1101 1104 1154 1161 1187 1212 1234 1252 1256 1259 1273 1274 1293 1315 1337 1344 1381 1432 1471 1...
result:
ok 1 cases (1 test case)
Test #35:
score: 0
Accepted
time: 181ms
memory: 69680kb
input:
1 2 500000 yoskytdthibiosryionvxhjbnvwyrumjrmogzlngtxwkyxpketeperfdqboobxcccofgoxsjjffgdymvbhrnmcfiresutjbeadpbwuyxbirokynuisiezakhyivnbelkoexbfertmmmpjyerxyrnxvseyyipjqexidomwdzwqgqopwvnguawlvdyqgpsoxuliobzndxyfondeygqyxujboqcmqmwlptkpxflccjwfbzvwjkmddqxuenqirajuqplwjfyumjycekqzgavjrpanuxixmwlmnnvv...
output:
2 1 1 2
result:
ok 1 cases (1 test case)
Test #36:
score: 0
Accepted
time: 169ms
memory: 69636kb
input:
1 1 1000000 vvzoohphaekmooymvzpvxqaxbgyabgrgrdetsieivthqtvackeaapshmaybrwivlzjtjymeqmjqjoioeknzlajdqeptnywzscjthxqahapfnktonvxbyridjhokyielyfuzzgciiulnuetgfmdppmpywhoouwbbwyhlufupqwkhjubvkplfbzxiegngnewwfpupzypskuhtopvqzczthyaxpepvbkhvitkxgopxprykcrbjnuiideigftkhgzpykkoijuiquebxaaiwaabuxssgqgsofmiid...
output:
1 1
result:
ok 1 cases (1 test case)
Test #37:
score: 0
Accepted
time: 656ms
memory: 71432kb
input:
1 1000 1000 nnnaamfktzgakyenqodpbujtlowzoloijjqorpyvgfbujjivqhgrvcsuajhkfnxfrtrrhfanoutnxetnhowuknugksqgbtpyixedmyepfgyluqjvgadnsosbevsprmupvmymsmohjpimcbgkrybnnlrgqewddkotengibpfdpfqbehofyslubivwusaxzjnbbuczjponsogapfzqnshokuerpwuewcedjmtykebmibjanhyfhvuieexfxijacmpkqatvctadngmkuefrfqthukhywwqllwwy...
output:
936 399 626 640 15 138 140 756 333 991 759 765 933 95 417 827 823 900 768 614 985 203 989 157 671 737 152 779 442 620 726 167 78 861 111 493 577 310 147 156 35 533 354 189 930 963 738 291 343 329 131 160 39 797 467 387 879 843 144 908 166 17 205 37 548 284 431 925 67 237 292 236 591 713 363 825 831 ...
result:
ok 1 cases (1 test case)
Test #38:
score: 0
Accepted
time: 329ms
memory: 73388kb
input:
1 500000 2 lm hm wf rl ze qc ku dz is dg lc kw ys ho re gu pb on oe wc ya kx zh fg lb fn ys ci da ta mg nc qj tx tn zw gu na ee oa qm zz hx rs fl bz ik fm sq xr tf id lh bk sw qx lw aa bx cg ns vl bg im qp pc rh pa ns kf la pl am sz xs xq uc wf lz iq ok mh wi kj ui xl na fs vg wf qg rn th ju rp fs w...
output:
58 1665 1846 3751 4314 4582 4814 5579 5891 7033 8295 8722 8818 8893 9438 10024 10661 10828 11130 12247 13152 13212 13413 13685 13807 14992 15762 16249 16380 16681 18403 18705 18972 19183 19612 20313 23145 24496 24611 24688 25329 25395 26188 26416 28256 28450 29716 30530 31109 31264 31798 33207 35278...
result:
ok 1 cases (1 test case)
Test #39:
score: 0
Accepted
time: 636ms
memory: 143984kb
input:
1 1000000 1 h v a h z d c r l b t l d s z h c n p d v t x a z k i q g d p s i a z l e f q t v r b a f v v c z c w u s e d p w c n y f d f j i x b a h m w g b z h d m y q y u d s g l m t p u x w m h c t y p u e l h s x m f t p d f z z k w h s y i h v j w w s v h y a r f y d j w e a h k p x l x a k f ...
output:
3 24 34 44 68 127 135 142 162 286 305 313 324 329 388 395 402 467 519 525 528 541 543 586 592 605 614 627 667 694 697 708 791 868 870 872 894 992 1006 1027 1041 1092 1206 1218 1225 1232 1235 1244 1259 1275 1287 1319 1331 1341 1344 1392 1416 1421 1440 1448 1459 1465 1484 1490 1507 1544 1547 1569 1630...
result:
ok 1 cases (1 test case)
Test #40:
score: 0
Accepted
time: 443ms
memory: 69684kb
input:
1 2 500000 csbazestpjffzjvrjztjidouhfewitwyhczwalacmlfmfpjozlnojeeltcyjkgbwpnzhzdeeublvjcgepkupvlqxhzkjfudcojhtxsrndyipgsuexhdjxodymiofmaxdkhsyallmorhqdrosgvzwvsgobotbwlwnqvohekjougktqmjaknocgtumjjvmtphfnoqrsrfgztpufvtnafmhmmcpxkrjyokgrlvaswhkkxfxguuakezavqkbkvnhjpycgvrsefranfttvrfnoaeempqhlsdzwtrvf...
output:
-1
result:
ok 1 cases (1 test case)
Test #41:
score: 0
Accepted
time: 157ms
memory: 69608kb
input:
1 1 1000000 zcgzehvspliuqlawrvemmxvlapmqsnpdieaqubpadgbsduckarfgikvmcphtdjtgczbfuivcjhpmwgaxoqvbmwldxvqwtcqizfyvxoahqcuyyvdgxzsohnkjblrwuyietchhqusxamzculyvhaqzoftboauhkdxnpxuxbljmftjtyrczfxxsbwkvzhehmwkhvbkjmnuypbjgibszsdtocihfzwuvdpvszccyroufgktzfytdkcrneuvelrcoufxvmxajvhlnikzfemppharjuwicizqodvrj...
output:
1 1
result:
ok 1 cases (1 test case)
Test #42:
score: 0
Accepted
time: 1323ms
memory: 71308kb
input:
1 1000 1000 vkrkwbibcsuczrgypnuclsmvexjomqttgzmpebzbtmtltqyekywmlpmluwwmjjybbnztlxthcphhfayjjegghgyuippcrweyyzgjfnzemamafgtexvhxofarelxdoptwfohqrnjepcpxzkoepuluocahihxhqipydaiermnrbxjpkeundrirpdcalvbjyhhdazarjuwepzaiafcmbaxqlfqcnbzvlamfwgpqoutqvwhilaqswbqzvohiayenlifowexxzvuxrldswlfpjugwozxwzpxeqtkb...
output:
-1
result:
ok 1 cases (1 test case)
Test #43:
score: 0
Accepted
time: 894ms
memory: 375924kb
input:
1 500000 2 pa fn bi ka az wj sf db xb ad di ur he dq bv zf cw yw ha to hl al wi pq pq ao eh ua xo oi dw nz do dn oq sd bn nj fa mx vx ss pp dz jk us mv ko gk wa ju em bc tp qx cr rh ro qx vk bm ju ir kd ny gw sg js qt zi uf pg md du he qy ur ge dp ho hb ig zi dr wq ix my gz tf kb ab ye zf rx cy mq o...
output:
499991 499959 499997 499995 499989 499984 499996 499949 499998 499988 500000 499967 499976 499977 499983 499973 499961 499987 499908 499975 499868 499994 499945 499902 499969 499892 499972 499990 499971 499960 499946 499965 499986 499982 499979 499939 499950 499992 499968 499980 499944 499900 499928...
result:
ok 1 cases (1 test case)
Test #44:
score: 0
Accepted
time: 654ms
memory: 143908kb
input:
1 1000000 1 i b s i b r y g d n a s e b k h d f m c t a e u q d e s f p g t f u l v k z y s d d v m u e l c l v e q i o w f c k f f o y h b o r n h n j w d l z n p u n z t r w d e l g r u a v h t s k i y m q g a x z i p b w e m n i z g u g q c f c e h j e i t d r m g d h z w v y i l o u r m j l d p ...
output:
11 22 89 100 151 175 183 244 245 248 306 310 315 337 392 434 452 470 494 495 497 506 541 543 576 580 594 603 641 653 669 694 721 725 727 746 773 815 837 881 898 937 950 960 967 987 1009 1014 1020 1024 1026 1040 1058 1100 1115 1118 1143 1144 1174 1188 1189 1259 1278 1286 1334 1356 1365 1407 1419 1442...
result:
ok 1 cases (1 test case)
Test #45:
score: 0
Accepted
time: 2010ms
memory: 175484kb
input:
1 100000 10 ehlimdmwkt jlrfzdjvam jwtsqoiebv mlksfsakmd zamugzmeha nxepoofxsh idoigdreky ugarhoilzd oalhajmyfd vfnxfsoasz fymboaopqw rgyhcdtcxm nvgtvzxgqs uhwapwajcq udicenzrkr jgeaupojpv efrdqjgayp yvqwqkaipk jlsbzxdzeh btdjgvxcqd uqcoyaaohl szcxibrkvc yzyntbtiuo lbwkorixzq lfffvwuktb euhjmdnptr tb...
output:
84594 58335 78940 15229 43785 90988 79809 56085 60257 4093 19795 79411 83478 54400 57330 18678 70262 54550 54548 59292 64745 77978 91844 1313 75008 86861 36721 60415 84361 62118 81251 22089 12175 66977 95521 11976 65167 32994 13710 60961 85080 97002 52698 65336 9318 78691 18710 94644 28133 91252 678...
result:
ok 1 cases (1 test case)
Test #46:
score: 0
Accepted
time: 390ms
memory: 155380kb
input:
1 100000 10 mqpzaypqsg rybikrqyzx gxcfzgdglt sszegicsli oxzpnucwde ezkskhdmiu lqsgzsxckw jlglibuvpi ctqjnskviw yqhiaisjxf mpmgtaupwp swrhvwtxpg wcgchdtjyk hynexzwpxj veaomhaxnn bluwuxnmyj zeefjdwksv lgegdqxuyt ezkpautemn ykbpibnfsp ddbtafikzb cetuawmhwo epwldttkrv lytomstlzm wugxtmlmzf atathrowwp sv...
output:
99974 99970 99969 99944 99991 99999 99976 99917 99956 99967 100000 99973 99968 99946 99952 99938 99972 99996 99980 99982 99932 99911 99984 99942 99990 99992 99941 99929 99987 99940 99981 99960 99998 99913 99994 99963 99948 99959 99993 99997 99957 99985 99884 99989 99988 99986 99983 99921 99919 99979...
result:
ok 1 cases (1 test case)
Test #47:
score: 0
Accepted
time: 1866ms
memory: 256856kb
input:
1 200000 5 untrg qewwk zdlct ltaki tegsd pllgg jvwkk pkcru donwe elvdq crquy yqlbl yalff rwhfy xlsqg vzjww vjdni vevwr njecm onvvj ldfjq ypgae vuuvu jxgce weone hnklb hkkyw tuwyp kgcad octvg gfkei ovmql kxzta npvrv pxenv hklvf sfzso blanl jigxz uqcrk lbehm cxwbq ymdzw hmvpk wjdqq kpfls rktrp ogdhs f...
output:
-1
result:
ok 1 cases (1 test case)
Test #48:
score: 0
Accepted
time: 61ms
memory: 17256kb
input:
1 100000 10 fxhzgdmpvu rbapkxuwdz rcbtjgzlqz vuwjdihqwk brwenfhpot cazbgafcaa ylyhnyrgwt sixsqzjakz qdxsdrthuu zdrwkcqqdk xluoyqriep wpcqewlpfo ebcmamyzmt fanzqaxbew ikmsqafyun xczrzagmdn bbsvmsrtph sjtudpeyqj kdvxgfnozj pnbefumkkh xjahjflidu begdvasklf xcragpudlh pkugzyrpgn dtlznmvred supuawndia xa...
output:
95476 13713 27723 49989 86742 36665 38089 32084 98966 87221 70778 79915 96796 22962 55610 92946 20843 28257 68359 21314 67802 2435 54044 30659 50335 41496 13509 59596 42302 50697 26990 17595 94704 82029 8003 40541 36792 66790 28502 58918 91078 37209 85520 31870 44548 29600 30071 41853 16390 19108 90...
result:
ok 1 cases (1 test case)
Test #49:
score: 0
Accepted
time: 1869ms
memory: 253680kb
input:
1 200000 5 rdaxv rqwti srbck qdtal ltoxk ughkh sywke cigmu fioqb gnycn cexck tcekr byyqn cgokp ausjo ubsgq sxouf xxvnu drjqw nvaul ashzf scexc ueyta ryyny xotaf prjgo hjfrk alqrp zggry xrivg wislr lzygn lleum utbzq dzbpn kmkvp bacqh kdfik xaqru aeeem otmht exrjh poyfh rgggk mhbof kqyzm czill oygax c...
output:
-1
result:
ok 1 cases (1 test case)
Test #50:
score: 0
Accepted
time: 440ms
memory: 69884kb
input:
1 2 500000 tossrwlzkdzzrphwvvnkmdevslssgacszrojwkxgorcupejhwfybmoyegfhulclkqadmdjpfccnbxhsumeffzhfowyhxqqpdrjguansbqlyuglodfwxjphusmwlevcmpjfcbrjbmdbsqovuljaxqfeorcmgjsbwxappqwsuacmjtyhjubdjyevglxpkektgumdrvtwkuzdiyznzactijqouerxfqatzcwjqserfliiqihufyinagdbqglcnqttlhkebmezdjcfvdcmcjgqhygbxmvzndqnywm...
output:
-1
result:
ok 1 cases (1 test case)
Test #51:
score: 0
Accepted
time: 396ms
memory: 69732kb
input:
1 1 1000000 aqfomtfebdjjikpwsgohpqhvbrasmasgmocifvxczotxorlguxtriaftafotynozikgxytfzuztzapeayssibygltogshsbfwlfcqzbfkleizodgzztxzaysqtsvokwictzyehplvlkpucyizyrcimlczpucivarsihznzqmkjyuhajkgasakdeechddnrezbboozngkyxrjkzfgdlzjewmzhfwmfzguwukeeaambyszysderzrbbbdraxbdpqrurmztoepgptyjtbnrwpyntoagemsfeari...
output:
-1
result:
ok 1 cases (1 test case)
Test #52:
score: 0
Accepted
time: 1476ms
memory: 165620kb
input:
1 100000 10 kxlhbmfknl mldtlbegjo roglqswqdz fkcfeioyrf varxnuxhyk yputtwlqnj qjfqxkpbug thnarwcjpt oqfpxygtat hagzhuqeem bwnnbeweqg semgcubiaz zoomamfsyb lhocxkgyvp nzqeqkhpes hhhqaraqjq mdcgqoqgbp gvsxjqnvjv sfkoamvaor sngtozdbrc yrhpdcfhhf eptkmcorhi hwszrfyvqr xemzcudvkz rjklevonsv vnpmsgqdcb sy...
output:
23659 71725 39593 89966 1843 53579 25315 78370 9738 46692 6288 90950 54456 42835 59754 52079 27659 19632 89507 95003 57965 20640 9255 994 65269 56481 29620 41320 25660 46423 15406 68683 49632 16629 49184 39334 2067 51082 1720 79655 12568 32842 53959 29639 24020 59732 12577 16027 94852 26364 83620 18...
result:
ok 1 cases (1 test case)
Test #53:
score: 0
Accepted
time: 2295ms
memory: 168768kb
input:
1 100000 10 dplijbwkgs yigahsojnn ftafmnroiu gklxajdgis lkkiioljfz mkckxjukta rwxjqmbddd opvmalbpzl ngobvwffjt ziszyyrvkb hxjvrmnlnm pcytdvmvcb jyzqhxxzpd ykfcpnynxt tqfqojtyoc cyphatoadm nsibkreiqr sjujphkbwv wdccnduvvj gefgntmint qodiytabxc vpeltdzowm fppmxjflkq vhohdpiocs vuudozaxuh uoonxsqeko iq...
output:
-1
result:
ok 1 cases (1 test case)
Test #54:
score: 0
Accepted
time: 1778ms
memory: 169200kb
input:
1 100000 10 qyjclrjhcv hrexdepsrh drbmgtcoed twbslhlapq tocwgicnrn ndudcbqcoz eunlkqeugj ictesjwnlv ukatawfiji dktfpbehwi yggzqhuccl oznogatwir efcduoftki ojyrolvatq fkpbtdwpmj lliymvqkws taqnrqowtg uzfiimgmkz lmavtcmajn hagghgkdro eprquadsxn ztmzpejqea vzitenazyw nhcbbtdnuu frafncvjoy javzrcwaus ap...
output:
38709 19685 88657 81121 38832 28205 94327 54135 97692 89879 32616 96857 72159 53477 51510 90425 40853 76070 56674 11151 32808 86890 5978 37154 31181 81415 70147 95555 76341 55173 11048 50705 94236 26408 98377 87702 72836 34070 31399 8279 97586 14818 8305 99463 95918 69406 52393 40146 91498 4616 8894...
result:
ok 1 cases (1 test case)
Test #55:
score: 0
Accepted
time: 2339ms
memory: 167952kb
input:
1 100000 10 sypalllczm fyvwvgicyp jqomdiqcfp aeaaztogli imxeiuthuk ydkrfpfmft udmkztmwfe ohyczkizug fzjyyniywg itrowixklc tussdfceqf evpuvluxpg iluimcnpco olstppvixo dvdpowweue hxiodpcvjl xhflfalebb vpfsjldkqf dfjslcblpv dzfptmeyqv rvgrnefzaj illzbltjxb xbbdvyufbw frovlztkno gsylowileo zasbhsaiku rw...
output:
-1
result:
ok 1 cases (1 test case)
Test #56:
score: 0
Accepted
time: 1462ms
memory: 167788kb
input:
1 100000 10 jghpqhzbwn khmnmmjces evcbszdsee cpedxvljuc bijisgizio lwybtheziw azeowrjbes bvcakdyowl hqrgrmdxkv latrynwkve zbwrfmlfzl bwsrqcxufw mlxgssthvv tbnlrnnagy fumhlmrrsc klisexvqbh fuhiznqnbs gydnvmatzs kddgnpybzt lqtposlfrf teyereqlki phffqzyxsk zivoiupzye fhyewkrofw vmhqdpsznj kkfzikuoop fd...
output:
93505 60023 92344 69177 95119 88027 73401 75969 74469 37599 59478 58322 649 14920 32616 76914 53807 24273 10697 37064 86200 49752 38611 18918 83433 84289 84472 9753 52111 28655 44492 61790 98799 70407 58443 19333 21783 49197 70289 13850 39129 80099 43783 81630 45311 39360 89144 20651 85967 93479 176...
result:
ok 1 cases (1 test case)
Test #57:
score: 0
Accepted
time: 1760ms
memory: 171460kb
input:
1 100000 10 ajdomreiyg awhziinfwu gtqxnxstjq acgalthnvc rlnbmtemxi ouqfgtxjel zrpqnultuj ajpfxgstzw ugccienqit cgyjlqfkma fvvzhsruhh xzvtqxdzfx bzklilivkt vracwjjijn pijsxthpiv sloandhcmh uezrrpwwrp qizguxpvwx fgfwudmpmw zmddapzqly fvxavrqcax pstjlrahls zaewasovpv wxbnphincw bcauhtuzyg svvtswoswv sy...
output:
84837 67933 9174 23677 66758 78913 8383 3523 19109 96196 4101 70691 72295 21711 84870 95649 95876 15550 96563 1637 75082 39688 11748 7560 86197 43430 98616 93839 31322 58257 8710 56006 38685 96236 96605 91594 15626 16974 91746 67935 68103 70850 82356 93720 87707 44772 85179 47409 34295 72580 59098 2...
result:
ok 1 cases (1 test case)
Test #58:
score: 0
Accepted
time: 2400ms
memory: 170696kb
input:
1 100000 10 otqeflvutp ktjpzyjlbe utqhsjbhxi jmmcfrwiml vfxvqrdzdk aenkvqbzpo bfdzgohawd vdsqzihcsw jicioserdw eberxkmhko vsmxkcsymw aunqxqooio fuserissyp powkmizyqg pklrsxredz kvwierqibi wrzusyeiou odjaxqedqv xxntmrkafl wkgkolzgdv jxwmcpjiya pxyhhfzjsh ewcjkdaymm taklqmzazs mwvlhirbzn lfzultiztz sn...
output:
93443 3262 4945 70022 93564 76676 52299 68415 4939 36043 96246 18612 53679 64493 47556 85456 54233 88666 37387 38982 6995 17165 94510 55731 38421 72870 29537 62596 65764 73466 23515 7347 57205 33875 6171 67583 71967 3304 69423 65886 69459 83072 24482 25985 21370 1019 40083 33010 22915 82702 62620 56...
result:
ok 1 cases (1 test case)
Test #59:
score: 0
Accepted
time: 2238ms
memory: 168492kb
input:
1 100000 10 uxfboqjiml urguovogte hlfrgfwgkz lnaljmgocb cbkdynsxzg jfggokuktr fgeeeayprq glgeqdexax ccwqbwaake pexvcckyid rjvzlorehp jwrolcaeqq pwftjauyxv dtblxopysv pmvikikgse pldtousdqo tgenvzvdnr payixpmmjr urkthfeotj pqomqonmqf wsnfwcbqce ynjhtrkmcg nqjuozngbr ombhjkloow fxbwspocpf ovcbrjolwn yn...
output:
-1
result:
ok 1 cases (1 test case)
Test #60:
score: 0
Accepted
time: 2294ms
memory: 170108kb
input:
1 100000 10 ipzgqbnfvd sgfrlagntk gwwweijzea fxpgdtxgti waobttsufl nrdslhdkxf ssrwruilxq pdglmfvowa azjbrlhzff pchtakzdkl ajsqpedcoy pjsukcypln fiognbhmxj agpmnzvnms ikdnsabypt zaotlspbvj nummgjsshd mtteglneuy eopvrvdxtb nuwnziuqyv pmqxpafghb krwuxxunvh dnumirddbi oyiyooimqd zmlwgndkny ybxqktsjpq kv...
output:
-1
result:
ok 1 cases (1 test case)
Test #61:
score: 0
Accepted
time: 2426ms
memory: 169132kb
input:
1 100000 10 vhntzmzfjq lpkanhwnma hnshcjeytm rroumhwnmt jeweevjgqp bsegdybxio rwtjvtvlko fmpcrdsdes edijyqpurg zghldxztvl xbcsrduzmx tguxmkqcfz bajotxtuii zsfgpkokbg xrgnvbpctc clxyepehzt veudydfurf mavbkeurwo nfmwtnwspx uahthuvvxc vdaadmfinf kyhxwovgtv jnqppwnuvt hiepfckmpa oxrklvvyof iintishepc eq...
output:
19857 37861 69620 14839 50591 8592 70423 9913 36310 30283 61361 7333 81257 560 49637 40661 21528 86535 86088 13823 46795 63832 80795 79398 94146 3391 64028 70082 25113 90810 6070 20396 96730 99735 1482 9437 96923 75528 20735 98206 70756 4544 99066 95984 76725 1496 16196 83728 60179 51719 80722 996 7...
result:
ok 1 cases (1 test case)
Test #62:
score: 0
Accepted
time: 1734ms
memory: 167520kb
input:
1 100000 10 uudwzdlejj ivabpznlij uqnmtxmmgg ntzanognix qdgoodcnun pekrqklkez eejprmjekr pwblriymwp rievkuhrez npbdnosxjq eoeicddyic hotgqnlmge iygqxwlogm pnsgildmtr rqkpassked qpsqosjzsm phxkunmotd oohtwpcpli ejeiosheqn rzrjlvpkfa ynajbomlnb awxowbwzxx hfajxtyefh ulxeladiwo mroseowqdn fszffsdlmi lm...
output:
81487 86593 14979 17052 80109 29190 42896 17971 14369 71309 3933 47695 38786 15249 47079 95545 6984 94039 33115 71179 15747 6504 90919 52318 73169 60770 26720 27127 4620 68625 4068 80361 80081 7123 70246 4875 8030 50177 86745 3990 39804 88307 36219 62194 99547 9987 52898 11179 83247 97994 48157 6635...
result:
ok 1 cases (1 test case)
Test #63:
score: 0
Accepted
time: 2288ms
memory: 168392kb
input:
1 100000 10 akvvptzhlm ukqiqwgjxr raftyctsec tljopwxqgm odkoyjszvv vuuxpzuwty vugkbhgrbq mghdhtbdmh cmlrrcpkrj fropiipnog fippflholr hxvyifxfhi dstwpsdbxl zekzumxmnr qywqzyxvln jacdvjvczu dpmjugphun hhrhfdjzkx jfwnfjfokw ygziaihrgd ybrhjiwfaj nketysvhiu sydarvrsdv zlhwpjkvmc ynaolmsimg tgjfocrgba kh...
output:
-1
result:
ok 1 cases (1 test case)
Extra Test:
score: 0
Extra Test Passed