QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#123237 | #5550. JOIRIS | lmeowdn | 100 ✓ | 1ms | 3704kb | C++14 | 2.4kb | 2023-07-11 21:37:07 | 2023-07-11 21:37:11 |
Judging History
answer
#include<bits/stdc++.h>
#define fi first
#define se second
#define eb emplace_back
#define mp make_pair
using namespace std;
typedef long double ld;
typedef long long ll;
typedef unsigned long long ull;
typedef __int128 i128;
template<typename T,typename U>
T ceil(T x, U y) {return (x>0?(x+y-1)/y:x/y);}
template<typename T,typename U>
T floor(T x, U y) {return (x>0?x/y:(x-y+1)/y);}
template<class T,class S>
bool chmax(T &a,const S b) {return (a<b?a=b,1:0);}
template<class T,class S>
bool chmin(T &a,const S b) {return (a>b?a=b,1:0);}
int popcnt(int x) {return __builtin_popcount(x);}
int popcnt(ll x) {return __builtin_popcountll(x);}
int topbit(int x) {return (x==0?-1:31-__builtin_clz(x));}
int topbit(ll x) {return (x==0?-1:63-__builtin_clzll(x));}
int lowbit(int x) {return (x==0?-1:__builtin_ctz(x));}
int lowbit(ll x) {return (x==0?-1:__builtin_ctzll(x));}
#define rep(i,a,b) for(int i=(a);i<=(b);i++)
#define per(i,a,b) for(int i=(a);i>=(b);i--)
typedef pair<int,int> pii;
typedef vector<int> vi;
typedef vector<pii> vp;
typedef tuple<int,int,int> tiii;
int read() {
int x=0,w=1; char c=getchar();
while(!isdigit(c)) {if(c=='-') w=-1; c=getchar();}
while(isdigit(c)) {x=x*10+(c-'0'); c=getchar();}
return x*w;
}
const int N=55;
int n,k,a[N],b[N],mx;
vp ans;
void clear() {
int mn=a[1];
rep(i,1,n) chmin(mn,a[i]);
rep(i,1,n) a[i]-=mn;
}
void oper(int x,int y) {
if(x==1) a[y]+=k;
else rep(j,y,y+k-1) a[j]++;
clear(); ans.eb(x,y);
}
signed main() {
n=read(), k=read();
rep(i,1,n) a[i]=read(), (b[(i-1)%k]+=a[i])%=k;
rep(i,0,n%k-1) if(b[i]!=b[0]) return puts("-1"), 0;
rep(i,n%k,k-1) if(b[i]!=b[n%k]) return puts("-1"), 0;
clear();
rep(i,2,n) while(a[i]<a[i-1]) oper(1,i);
rep(i,k,n-1) while(a[i]!=a[i+1]) {
int x=i;
while(x>=k) oper(2,x-k+1), x-=k;
}
rep(i,1,k-1) {
for(int mx=0;;mx=0) {
rep(j,1,n) chmax(mx,a[j]);
if(a[i]>=mx) break;
oper(1,i);
}
}
int p=(n%k==0?k:n%k);
int mx=0; rep(i,p+1,k-1) chmax(mx,a[i]);
rep(i,1,n) {
int tm=(mx-a[i]+k-1)/k;
rep(j,1,tm) oper(1,i);
}
mx=0; rep(i,1,p) chmax(mx,a[i]);
rep(i,1,p) {
int tm=(mx-a[i]+k-1)/k;
rep(j,1,tm) oper(1,i);
}
for(int i=n%k+1;i<n;i+=k) {
rep(j,1,mx) oper(2,i);
}
rep(i,1,n) assert(a[i]==0);
printf("%d\n",(int)ans.size());
for(auto [x,y]:ans) printf("%d %d\n",x,y);
return 0;
}
Details
Tip: Click on the bar to expand more detailed information
Subtask #1:
score: 15
Accepted
Test #1:
score: 15
Accepted
time: 1ms
memory: 3432kb
input:
34 2 2 5 41 47 8 27 42 17 43 47 47 12 49 33 41 18 4 16 15 28 9 13 25 44 20 40 25 16 2 20 0 41 6 16
output:
-1
result:
ok
Test #2:
score: 0
Accepted
time: 1ms
memory: 3428kb
input:
26 2 32 42 0 0 20 22 4 19 13 37 22 30 50 17 23 1 11 7 22 3 26 25 45 32 38 38
output:
-1
result:
ok
Test #3:
score: 0
Accepted
time: 1ms
memory: 3388kb
input:
32 2 3 42 8 32 34 44 2 4 19 40 49 47 25 6 46 7 40 22 38 6 32 45 4 35 16 29 47 6 1 22 0 14
output:
-1
result:
ok
Test #4:
score: 0
Accepted
time: 1ms
memory: 3640kb
input:
28 2 9 21 26 30 0 46 33 7 36 29 28 0 33 21 29 37 15 44 33 14 14 34 32 4 49 23 48 19
output:
441 1 5 1 5 1 5 1 5 1 5 1 5 1 5 1 5 1 5 1 5 1 5 1 5 1 5 1 5 1 5 1 7 1 7 1 7 1 7 1 7 1 7 1 7 1 8 1 8 1 8 1 8 1 8 1 8 1 8 1 8 1 8 1 8 1 8 1 8 1 8 1 8 1 8 1 8 1 8 1 8 1 8 1 8 1 9 1 9 1 9 1 9 1 9 1 9 1 10 1 10 1 10 1 10 1 10 1 10 1 10 1 10 1 10 1 10 1 11 1 11 1 11 1 11 1 11 1 11 1 11 1 11 1 11 1 11 1 11...
result:
ok
Test #5:
score: 0
Accepted
time: 1ms
memory: 3448kb
input:
48 2 46 2 38 42 24 39 45 26 36 10 43 12 44 44 9 23 5 38 1 25 31 46 21 5 0 19 49 28 0 2 39 4 42 29 5 28 46 20 13 44 6 8 26 43 7 11 15 2
output:
-1
result:
ok
Test #6:
score: 0
Accepted
time: 1ms
memory: 3692kb
input:
12 2 30 34 48 32 0 10 20 21 36 8 12 19
output:
171 1 4 1 4 1 4 1 4 1 4 1 4 1 4 1 4 1 5 1 5 1 5 1 5 1 5 1 5 1 5 1 5 1 5 1 5 1 5 1 5 1 5 1 5 1 5 1 5 1 5 1 5 1 5 1 5 1 5 1 5 1 5 1 5 1 6 1 6 1 6 1 6 1 6 1 6 1 6 1 6 1 6 1 6 1 6 1 6 1 6 1 6 1 6 1 6 1 6 1 6 1 6 1 7 1 7 1 7 1 7 1 7 1 7 1 7 1 7 1 7 1 7 1 7 1 7 1 7 1 7 1 8 1 8 1 8 1 8 1 8 1 8 1 8 1 8 1 8 ...
result:
ok
Test #7:
score: 0
Accepted
time: 1ms
memory: 3392kb
input:
28 2 23 5 49 37 34 46 50 15 14 12 28 13 38 21 2 19 13 21 0 35 42 28 35 7 44 15 13 44
output:
-1
result:
ok
Test #8:
score: 0
Accepted
time: 0ms
memory: 3392kb
input:
38 2 42 43 50 3 2 50 23 16 26 45 17 32 20 8 45 17 3 6 12 4 14 26 43 9 49 46 37 12 9 1 12 31 34 35 10 7 32 0
output:
-1
result:
ok
Test #9:
score: 0
Accepted
time: 1ms
memory: 3660kb
input:
42 2 44 20 50 41 29 16 14 21 34 43 23 19 50 3 16 49 18 22 21 49 29 48 33 44 17 0 26 26 39 24 6 29 5 39 40 25 4 50 48 6 1 39
output:
953 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 4 1 4 1 4 1 4 1 4 1 5 1 5 1 5 1 5 1 5 1 5 1 5 1 5 1 5 1 5 1 5 1 6 1 6 1 6 1 6 1 6 1 6 1 6 1 6 1 6 1 6 1 6 1 6 1 6 1 6 1 6 1 6 1 6 1 6 1 7 1 7 1 7 1 7 1 7 1 7 1 7 1 7 1 7 1 7 1 7 1 7 1 7 1 7 1 7 1 7 1 7 1 7 1 7 1 8 1 8 1 8 1 8 1 8 1 8 1 8 1 8 1 8 ...
result:
ok
Test #10:
score: 0
Accepted
time: 1ms
memory: 3384kb
input:
8 2 19 24 12 6 0 21 42 11
output:
-1
result:
ok
Test #11:
score: 0
Accepted
time: 1ms
memory: 3404kb
input:
2 2 0 1
output:
-1
result:
ok
Test #12:
score: 0
Accepted
time: 1ms
memory: 3580kb
input:
2 2 50 0
output:
25 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2
result:
ok
Test #13:
score: 0
Accepted
time: 1ms
memory: 3432kb
input:
50 2 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1
output:
-1
result:
ok
Test #14:
score: 0
Accepted
time: 1ms
memory: 3400kb
input:
50 2 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0
output:
-1
result:
ok
Test #15:
score: 0
Accepted
time: 0ms
memory: 3588kb
input:
50 2 0 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50
output:
25 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 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
Test #16:
score: 0
Accepted
time: 1ms
memory: 3636kb
input:
50 2 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 0 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50
output:
25 1 27 1 27 1 27 1 27 1 27 1 27 1 27 1 27 1 27 1 27 1 27 1 27 1 27 1 27 1 27 1 27 1 27 1 27 1 27 1 27 1 27 1 27 1 27 1 27 1 27
result:
ok
Subtask #2:
score: 15
Accepted
Test #17:
score: 15
Accepted
time: 1ms
memory: 3596kb
input:
3 2 38 27 0
output:
29 1 2 1 2 1 2 1 2 1 2 1 2 1 3 1 3 1 3 1 3 1 3 1 3 1 3 1 3 1 3 1 3 1 3 1 3 1 3 1 3 1 3 1 3 1 3 1 3 1 3 1 3 2 1 1 1 2 2
result:
ok
Test #18:
score: 0
Accepted
time: 1ms
memory: 3600kb
input:
27 2 31 48 37 30 48 31 7 0 43 22 34 18 7 34 15 29 35 22 28 27 38 15 29 30 35 8 15
output:
533 1 3 1 3 1 3 1 3 1 3 1 3 1 4 1 4 1 4 1 4 1 4 1 4 1 4 1 4 1 4 1 4 1 5 1 6 1 6 1 6 1 6 1 6 1 6 1 6 1 6 1 6 1 6 1 7 1 7 1 7 1 7 1 7 1 7 1 7 1 7 1 7 1 7 1 7 1 7 1 7 1 7 1 7 1 7 1 7 1 7 1 7 1 7 1 7 1 7 1 8 1 8 1 8 1 8 1 8 1 8 1 8 1 8 1 8 1 8 1 8 1 8 1 8 1 8 1 8 1 8 1 8 1 8 1 8 1 8 1 8 1 8 1 8 1 8 1 8 ...
result:
ok
Test #19:
score: 0
Accepted
time: 1ms
memory: 3584kb
input:
19 2 26 12 20 18 44 46 2 28 17 47 3 35 0 42 43 40 4 45 42
output:
237 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 3 1 3 1 3 1 4 1 4 1 4 1 4 1 7 1 7 1 7 1 7 1 7 1 7 1 7 1 7 1 7 1 7 1 7 1 7 1 7 1 7 1 7 1 7 1 7 1 7 1 7 1 7 1 7 1 7 1 8 1 8 1 8 1 8 1 8 1 8 1 8 1 8 1 8 1 9 1 9 1 9 1 9 1 9 1 9 1 9 1 9 1 9 1 9 1 9 1 9 1 9 1 9 1 9 1 11 1 11 1 11 1 11 1 11 1 11 1 11 1 11 1 11 1 11 1 11 1...
result:
ok
Test #20:
score: 0
Accepted
time: 0ms
memory: 3592kb
input:
29 2 40 19 38 29 10 48 4 3 30 42 29 21 28 27 43 2 7 24 27 39 0 13 21 35 48 15 7 33 34
output:
541 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 3 1 3 1 4 1 4 1 4 1 4 1 4 1 4 1 4 1 5 1 5 1 5 1 5 1 5 1 5 1 5 1 5 1 5 1 5 1 5 1 5 1 5 1 5 1 5 1 5 1 5 1 7 1 7 1 7 1 7 1 7 1 7 1 7 1 7 1 7 1 7 1 7 1 7 1 7 1 7 1 7 1 7 1 7 1 7 1 7 1 7 1 7 1 7 1 8 1 8 1 8 1 8 1 8 1 8 1 8 1 8 1 8 1 8 1 8 1 8 1 8 1 8 1 8 ...
result:
ok
Test #21:
score: 0
Accepted
time: 1ms
memory: 3696kb
input:
31 2 2 12 34 40 35 39 47 46 5 9 17 18 24 38 41 48 44 0 30 13 2 20 16 47 12 41 24 31 31 43 6
output:
538 1 5 1 5 1 5 1 6 1 8 1 9 1 9 1 9 1 9 1 9 1 9 1 9 1 9 1 9 1 9 1 9 1 9 1 9 1 9 1 9 1 9 1 9 1 9 1 9 1 9 1 9 1 9 1 10 1 10 1 10 1 10 1 10 1 10 1 10 1 10 1 10 1 10 1 10 1 10 1 10 1 10 1 10 1 10 1 10 1 10 1 10 1 10 1 11 1 11 1 11 1 11 1 11 1 11 1 11 1 11 1 11 1 11 1 11 1 11 1 11 1 11 1 11 1 11 1 12 1 1...
result:
ok
Test #22:
score: 0
Accepted
time: 1ms
memory: 3588kb
input:
5 2 29 14 34 0 14
output:
42 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 4 1 4 1 4 1 4 1 4 1 4 1 4 1 4 1 4 1 4 1 4 1 4 1 4 1 4 1 4 1 4 1 4 1 5 1 5 1 5 1 5 1 5 1 5 1 5 1 5 1 5 1 5 2 1 2 1 2 1 2 1 1 1 2 2 2 4
result:
ok
Test #23:
score: 0
Accepted
time: 1ms
memory: 3620kb
input:
7 2 18 38 0 7 7 45 43
output:
82 1 3 1 3 1 3 1 3 1 3 1 3 1 3 1 3 1 3 1 3 1 3 1 3 1 3 1 3 1 3 1 3 1 3 1 3 1 3 1 4 1 4 1 4 1 4 1 4 1 4 1 4 1 4 1 4 1 4 1 4 1 4 1 4 1 4 1 4 1 4 1 5 1 5 1 5 1 5 1 5 1 5 1 5 1 5 1 5 1 5 1 5 1 5 1 5 1 5 1 5 1 5 1 7 2 2 2 4 2 2 2 4 2 2 2 4 2 2 2 4 2 2 2 4 2 2 2 4 2 2 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1...
result:
ok
Test #24:
score: 0
Accepted
time: 1ms
memory: 3652kb
input:
19 2 21 6 30 23 38 46 10 37 3 39 35 13 0 6 44 41 45 22 14
output:
248 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 4 1 4 1 4 1 4 1 7 1 7 1 7 1 7 1 7 1 7 1 7 1 7 1 7 1 7 1 7 1 7 1 7 1 7 1 7 1 7 1 7 1 7 1 8 1 8 1 8 1 8 1 8 1 9 1 9 1 9 1 9 1 9 1 9 1 9 1 9 1 9 1 9 1 9 1 9 1 9 1 9 1 9 1 9 1 9 1 9 1 9 1 9 1 9 1 9 1 10 1 10 1 10 1 10 1 11 1 11 1 11 1 11 1 11 1 11 1 12 1 12 1 12 1 1...
result:
ok
Test #25:
score: 0
Accepted
time: 1ms
memory: 3600kb
input:
19 2 47 30 36 24 22 25 5 9 20 7 19 8 44 11 45 24 22 0 48
output:
290 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 3 1 3 1 3 1 3 1 3 1 3 1 4 1 4 1 4 1 4 1 4 1 4 1 4 1 4 1 4 1 4 1 4 1 4 1 5 1 5 1 5 1 5 1 5 1 5 1 5 1 5 1 5 1 5 1 5 1 5 1 5 1 6 1 6 1 6 1 6 1 6 1 6 1 6 1 6 1 6 1 6 1 6 1 6 1 7 1 7 1 7 1 7 1 7 1 7 1 7 1 7 1 7 1 7 1 7 1 7 1 7 1 7 1 7 1 7 1 7 1 7 1 7 1 7 1 7 1 7 ...
result:
ok
Test #26:
score: 0
Accepted
time: 1ms
memory: 3604kb
input:
19 2 8 11 10 27 23 26 9 36 3 2 46 0 47 46 26 29 19 5 0
output:
298 1 3 1 5 1 5 1 6 1 7 1 7 1 7 1 7 1 7 1 7 1 7 1 7 1 7 1 7 1 9 1 9 1 9 1 9 1 9 1 9 1 9 1 9 1 9 1 9 1 9 1 9 1 9 1 9 1 9 1 9 1 9 1 10 1 10 1 10 1 10 1 10 1 10 1 10 1 10 1 10 1 10 1 10 1 10 1 10 1 10 1 10 1 10 1 10 1 10 1 12 1 12 1 12 1 12 1 12 1 12 1 12 1 12 1 12 1 12 1 12 1 12 1 12 1 12 1 12 1 12 1 ...
result:
ok
Test #27:
score: 0
Accepted
time: 1ms
memory: 3572kb
input:
3 2 0 1 2
output:
3 2 1 1 1 2 2
result:
ok
Test #28:
score: 0
Accepted
time: 1ms
memory: 3648kb
input:
3 2 0 2 1
output:
3 1 3 2 1 1 1
result:
ok
Test #29:
score: 0
Accepted
time: 1ms
memory: 3620kb
input:
49 2 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0
output:
1164 1 3 1 4 1 5 1 5 1 6 1 6 1 7 1 7 1 7 1 8 1 8 1 8 1 9 1 9 1 9 1 9 1 10 1 10 1 10 1 10 1 11 1 11 1 11 1 11 1 11 1 12 1 12 1 12 1 12 1 12 1 13 1 13 1 13 1 13 1 13 1 13 1 14 1 14 1 14 1 14 1 14 1 14 1 15 1 15 1 15 1 15 1 15 1 15 1 15 1 16 1 16 1 16 1 16 1 16 1 16 1 16 1 17 1 17 1 17 1 17 1 17 1 17 1...
result:
ok
Test #30:
score: 0
Accepted
time: 1ms
memory: 3704kb
input:
49 2 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1
output:
1188 1 2 1 3 1 4 1 4 1 5 1 5 1 6 1 6 1 6 1 7 1 7 1 7 1 8 1 8 1 8 1 8 1 9 1 9 1 9 1 9 1 10 1 10 1 10 1 10 1 10 1 11 1 11 1 11 1 11 1 11 1 12 1 12 1 12 1 12 1 12 1 12 1 13 1 13 1 13 1 13 1 13 1 13 1 14 1 14 1 14 1 14 1 14 1 14 1 14 1 15 1 15 1 15 1 15 1 15 1 15 1 15 1 16 1 16 1 16 1 16 1 16 1 16 1 16 ...
result:
ok
Test #31:
score: 0
Accepted
time: 0ms
memory: 3592kb
input:
49 2 0 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50
output:
25 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 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
Test #32:
score: 0
Accepted
time: 1ms
memory: 3600kb
input:
49 2 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 0 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50
output:
25 1 27 1 27 1 27 1 27 1 27 1 27 1 27 1 27 1 27 1 27 1 27 1 27 1 27 1 27 1 27 1 27 1 27 1 27 1 27 1 27 1 27 1 27 1 27 1 27 1 27
result:
ok
Subtask #3:
score: 15
Accepted
Dependency #1:
100%
Accepted
Test #33:
score: 15
Accepted
time: 0ms
memory: 3460kb
input:
3 3 20 0 26
output:
-1
result:
ok
Test #34:
score: 0
Accepted
time: 0ms
memory: 3648kb
input:
4 2 21 36 0 19
output:
36 1 3 1 3 1 3 1 3 1 3 1 3 1 3 1 3 1 3 1 3 1 3 1 3 1 3 1 3 1 3 1 3 1 3 1 3 1 4 1 4 1 4 1 4 1 4 1 4 1 4 1 4 1 4 2 2 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1
result:
ok
Test #35:
score: 0
Accepted
time: 0ms
memory: 3400kb
input:
10 5 2 27 17 0 4 26 7 50 41 3
output:
-1
result:
ok
Test #36:
score: 0
Accepted
time: 1ms
memory: 3388kb
input:
24 6 27 20 23 19 30 40 49 35 19 27 7 45 37 17 0 11 36 2 32 28 43 39 23 16
output:
-1
result:
ok
Test #37:
score: 0
Accepted
time: 1ms
memory: 3436kb
input:
39 13 34 40 36 9 46 24 34 0 14 44 3 42 7 43 43 12 24 18 31 48 36 2 34 33 48 47 11 16 18 39 3 38 11 41 42 8 15 23 36
output:
-1
result:
ok
Test #38:
score: 0
Accepted
time: 1ms
memory: 3388kb
input:
42 7 9 19 27 32 23 49 20 19 26 28 24 21 27 44 29 40 3 47 29 5 46 24 21 45 9 1 2 23 50 24 37 0 18 6 27 27 18 34 20 30 27 11
output:
-1
result:
ok
Test #39:
score: 0
Accepted
time: 1ms
memory: 3388kb
input:
46 23 36 40 6 34 18 0 16 32 4 18 13 47 4 45 27 30 16 21 26 11 21 34 35 28 36 28 24 8 20 36 1 12 29 49 21 15 30 41 33 32 44 46 6 11 10 15
output:
-1
result:
ok
Test #40:
score: 0
Accepted
time: 0ms
memory: 3424kb
input:
47 47 18 21 16 42 0 7 5 11 14 15 45 41 2 17 32 40 16 33 24 32 10 10 49 34 44 12 33 14 34 47 40 22 39 48 11 23 32 44 44 48 45 22 37 26 49 5 18
output:
-1
result:
ok
Test #41:
score: 0
Accepted
time: 1ms
memory: 3392kb
input:
49 7 50 9 16 17 5 47 18 0 6 45 28 10 30 34 6 0 27 1 11 39 2 6 1 39 33 6 5 2 12 11 41 16 11 38 39 12 6 6 39 34 0 48 15 49 30 14 50 8 27
output:
-1
result:
ok
Test #42:
score: 0
Accepted
time: 1ms
memory: 3464kb
input:
50 5 45 27 44 21 35 4 39 0 47 6 46 11 47 39 47 42 25 18 15 20 18 16 34 0 43 46 1 42 18 20 41 38 45 40 37 44 11 3 39 28 21 47 2 31 30 13 18 16 30 8
output:
-1
result:
ok
Test #43:
score: 0
Accepted
time: 1ms
memory: 3620kb
input:
48 4 1 0 1 2 1 0 1 2 1 0 1 2 1 0 1 2 1 0 1 2 1 0 1 2 1 0 1 2 1 0 1 2 1 0 1 2 1 0 1 2 1 0 1 2 1 0 1 2
output:
1116 1 2 1 3 1 4 1 5 1 5 1 6 1 6 1 6 1 7 1 7 1 7 1 8 1 8 1 8 1 9 1 9 1 9 1 9 1 10 1 10 1 10 1 10 1 10 1 11 1 11 1 11 1 11 1 11 1 12 1 12 1 12 1 12 1 12 1 13 1 13 1 13 1 13 1 13 1 13 1 14 1 14 1 14 1 14 1 14 1 14 1 14 1 15 1 15 1 15 1 15 1 15 1 15 1 15 1 16 1 16 1 16 1 16 1 16 1 16 1 16 1 17 1 17 1 1...
result:
ok
Test #44:
score: 0
Accepted
time: 1ms
memory: 3580kb
input:
4 2 6 0 4 10
output:
10 1 2 1 2 1 2 1 3 2 2 2 2 2 2 2 2 1 1 1 1
result:
ok
Test #45:
score: 0
Accepted
time: 1ms
memory: 3592kb
input:
10 5 27 25 46 22 24 19 21 0 24 22
output:
78 1 2 1 4 1 4 1 4 1 4 1 4 1 5 1 5 1 5 1 5 1 5 1 6 1 6 1 6 1 6 1 6 1 6 1 7 1 7 1 7 1 7 1 7 1 7 1 8 1 8 1 8 1 8 1 8 1 8 1 8 1 8 1 8 1 8 1 8 1 9 1 9 1 9 1 9 1 9 1 9 1 9 1 10 1 10 1 10 1 10 1 10 1 10 1 10 1 10 2 2 2 2 2 3 2 3 2 3 2 3 2 4 2 4 2 4 2 4 2 5 2 5 2 5 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 2 1 2 1 2 1...
result:
ok
Test #46:
score: 0
Accepted
time: 1ms
memory: 3576kb
input:
24 6 3 2 4 4 4 3 4 2 4 4 2 2 3 11 2 2 6 7 5 0 5 5 3 3
output:
189 1 2 1 3 1 4 1 5 1 6 1 6 1 7 1 7 1 8 1 8 1 8 1 9 1 9 1 9 1 10 1 10 1 10 1 11 1 11 1 11 1 11 1 12 1 12 1 12 1 12 1 13 1 13 1 13 1 13 1 14 1 14 1 14 1 15 1 15 1 15 1 15 1 15 1 16 1 16 1 16 1 16 1 16 1 17 1 17 1 17 1 17 1 17 1 18 1 18 1 18 1 18 1 18 1 19 1 19 1 19 1 19 1 19 1 19 1 20 1 20 1 20 1 20 ...
result:
ok
Test #47:
score: 0
Accepted
time: 1ms
memory: 3660kb
input:
39 13 24 26 29 33 25 31 30 25 0 34 29 30 27 33 26 26 23 30 23 25 27 43 23 29 25 27 26 31 28 27 28 29 28 31 40 26 25 28 29
output:
667 1 5 1 6 1 7 1 7 1 8 1 8 1 8 1 9 1 9 1 9 1 9 1 9 1 10 1 10 1 10 1 11 1 11 1 11 1 11 1 12 1 12 1 12 1 12 1 13 1 13 1 13 1 13 1 13 1 14 1 14 1 14 1 14 1 14 1 15 1 15 1 15 1 15 1 15 1 15 1 16 1 16 1 16 1 16 1 16 1 16 1 17 1 17 1 17 1 17 1 17 1 17 1 17 1 18 1 18 1 18 1 18 1 18 1 18 1 18 1 19 1 19 1 1...
result:
ok
Test #48:
score: 0
Accepted
time: 1ms
memory: 3636kb
input:
42 7 8 9 0 5 10 8 8 9 11 6 11 13 8 10 8 12 8 10 5 9 6 5 5 12 8 6 6 11 9 4 12 10 6 8 8 10 8 11 5 9 10 6
output:
701 1 3 1 3 1 4 1 4 1 5 1 5 1 6 1 6 1 6 1 7 1 7 1 7 1 8 1 8 1 8 1 9 1 9 1 9 1 10 1 10 1 10 1 10 1 11 1 11 1 11 1 11 1 12 1 12 1 12 1 12 1 13 1 13 1 13 1 13 1 13 1 14 1 14 1 14 1 14 1 14 1 15 1 15 1 15 1 15 1 15 1 15 1 16 1 16 1 16 1 16 1 16 1 16 1 17 1 17 1 17 1 17 1 17 1 17 1 17 1 18 1 18 1 18 1 18...
result:
ok
Test #49:
score: 0
Accepted
time: 0ms
memory: 3604kb
input:
46 23 13 7 8 8 9 11 9 8 9 10 12 19 10 9 5 9 11 10 6 6 9 8 10 6 12 11 11 10 8 10 11 10 9 7 0 9 10 14 10 8 9 13 13 10 11 9
output:
965 1 2 1 3 1 4 1 5 1 6 1 7 1 7 1 8 1 8 1 8 1 9 1 9 1 9 1 10 1 10 1 10 1 11 1 11 1 11 1 12 1 12 1 12 1 13 1 13 1 13 1 13 1 14 1 14 1 14 1 14 1 14 1 15 1 15 1 15 1 15 1 15 1 15 1 16 1 16 1 16 1 16 1 16 1 16 1 17 1 17 1 17 1 17 1 17 1 17 1 18 1 18 1 18 1 18 1 18 1 18 1 18 1 19 1 19 1 19 1 19 1 19 1 19...
result:
ok
Test #50:
score: 0
Accepted
time: 1ms
memory: 3420kb
input:
48 4 1 2 3 36 0 3 2 50 1 2 3 36 0 3 2 50 1 2 3 36 0 3 2 50 1 2 3 36 0 3 2 50 1 2 3 36 0 3 2 50 1 2 3 36 0 3 2 50
output:
-1
result:
ok
Test #51:
score: 0
Accepted
time: 1ms
memory: 3684kb
input:
49 7 4 7 7 8 7 9 4 9 3 8 7 4 7 8 7 10 5 4 12 3 10 7 6 7 6 5 5 13 11 4 6 10 8 12 0 8 9 5 8 8 8 6 3 10 11 6 5 5 8
output:
938 1 5 1 6 1 7 1 7 1 8 1 8 1 9 1 9 1 9 1 10 1 10 1 10 1 11 1 11 1 11 1 11 1 12 1 12 1 12 1 12 1 12 1 13 1 13 1 13 1 13 1 13 1 14 1 14 1 14 1 14 1 14 1 15 1 15 1 15 1 15 1 15 1 15 1 16 1 16 1 16 1 16 1 16 1 16 1 17 1 17 1 17 1 17 1 17 1 17 1 17 1 18 1 18 1 18 1 18 1 18 1 18 1 18 1 18 1 19 1 19 1 19 ...
result:
ok
Test #52:
score: 0
Accepted
time: 1ms
memory: 3644kb
input:
50 5 6 3 11 2 3 1 8 4 5 11 8 2 5 8 6 3 4 4 4 4 5 8 4 3 3 6 7 5 8 0 9 5 3 5 5 2 1 6 6 7 6 6 4 5 6 2 4 2 2 3
output:
882 1 2 1 4 1 4 1 5 1 5 1 6 1 6 1 6 1 7 1 7 1 8 1 8 1 8 1 9 1 9 1 9 1 10 1 10 1 11 1 11 1 11 1 12 1 12 1 12 1 12 1 12 1 13 1 13 1 13 1 13 1 13 1 14 1 14 1 14 1 14 1 14 1 15 1 15 1 15 1 15 1 15 1 15 1 16 1 16 1 16 1 16 1 16 1 16 1 16 1 17 1 17 1 17 1 17 1 17 1 17 1 17 1 18 1 18 1 18 1 18 1 18 1 18 1 ...
result:
ok
Test #53:
score: 0
Accepted
time: 1ms
memory: 3692kb
input:
2 1 50 0
output:
50 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2
result:
ok
Test #54:
score: 0
Accepted
time: 1ms
memory: 3592kb
input:
5 1 0 1 2 3 4
output:
10 2 1 2 2 2 1 2 3 2 2 2 1 2 4 2 3 2 2 2 1
result:
ok
Subtask #4:
score: 55
Accepted
Dependency #1:
100%
Accepted
Dependency #2:
100%
Accepted
Dependency #3:
100%
Accepted
Test #55:
score: 55
Accepted
time: 1ms
memory: 3384kb
input:
5 3 3 29 39 37 0
output:
-1
result:
ok
Test #56:
score: 0
Accepted
time: 0ms
memory: 3652kb
input:
10 3 37 20 0 33 19 15 48 19 25 47
output:
79 1 2 1 2 1 2 1 2 1 2 1 2 1 3 1 3 1 3 1 3 1 3 1 3 1 3 1 3 1 3 1 3 1 3 1 3 1 3 1 4 1 4 1 5 1 5 1 5 1 5 1 5 1 5 1 5 1 6 1 6 1 6 1 6 1 6 1 6 1 6 1 6 1 6 1 8 1 8 1 8 1 8 1 8 1 8 1 8 1 8 1 8 1 8 1 9 1 9 1 9 1 9 1 9 1 9 1 9 1 9 1 10 2 2 2 3 2 3 2 4 2 1 2 4 2 1 2 4 2 1 2 4 2 1 2 4 2 1 2 4 2 1 2 5 2 2 2 7 ...
result:
ok
Test #57:
score: 0
Accepted
time: 1ms
memory: 3484kb
input:
16 5 30 5 49 15 7 5 20 39 47 50 10 33 0 31 22 11
output:
-1
result:
ok
Test #58:
score: 0
Accepted
time: 1ms
memory: 3392kb
input:
22 10 49 26 1 0 4 20 4 49 45 13 43 28 27 44 47 20 50 10 50 31 21 48
output:
-1
result:
ok
Test #59:
score: 0
Accepted
time: 1ms
memory: 3436kb
input:
30 29 33 31 14 9 29 40 11 25 17 13 38 27 9 48 49 0 19 31 47 9 46 1 21 18 38 19 46 19 20 24
output:
-1
result:
ok
Test #60:
score: 0
Accepted
time: 1ms
memory: 3488kb
input:
41 3 37 16 4 18 47 12 47 17 16 2 0 11 8 36 20 42 45 12 23 50 35 30 28 40 42 38 37 20 10 18 16 35 35 20 43 40 0 35 29 18 30
output:
-1
result:
ok
Test #61:
score: 0
Accepted
time: 1ms
memory: 3488kb
input:
45 13 37 10 34 2 8 39 23 34 14 37 24 35 27 40 21 32 45 30 31 42 5 17 5 28 47 24 34 38 22 47 45 19 1 38 49 40 1 16 44 5 3 8 11 0 14
output:
-1
result:
ok
Test #62:
score: 0
Accepted
time: 1ms
memory: 3464kb
input:
47 18 31 4 25 23 47 16 41 49 22 22 32 30 32 11 1 4 50 26 21 0 37 24 9 34 15 38 15 21 13 25 46 27 35 8 5 23 37 29 40 28 9 0 23 11 40 5 20
output:
-1
result:
ok
Test #63:
score: 0
Accepted
time: 1ms
memory: 3656kb
input:
49 3 5 11 4 8 13 1 37 23 32 34 0 35 37 37 1 2 38 31 39 40 0 36 19 14 20 27 45 4 45 29 2 15 33 48 24 24 35 32 31 19 26 44 2 1 11 48 28 23 29
output:
828 1 3 1 3 1 3 1 4 1 4 1 5 1 6 1 6 1 6 1 6 1 6 1 8 1 8 1 8 1 8 1 8 1 9 1 9 1 10 1 10 1 11 1 11 1 11 1 11 1 11 1 11 1 11 1 11 1 11 1 11 1 11 1 11 1 11 1 11 1 12 1 12 1 12 1 13 1 13 1 13 1 14 1 14 1 14 1 15 1 15 1 15 1 15 1 15 1 15 1 15 1 15 1 15 1 15 1 15 1 15 1 15 1 15 1 15 1 16 1 16 1 16 1 16 1 16...
result:
ok
Test #64:
score: 0
Accepted
time: 1ms
memory: 3380kb
input:
50 49 1 25 23 43 1 23 33 45 13 43 46 36 35 5 26 5 32 24 49 34 40 40 26 45 24 35 38 41 23 0 2 17 4 27 10 46 17 50 1 37 27 5 15 1 43 11 42 11 50 26
output:
-1
result:
ok
Test #65:
score: 0
Accepted
time: 0ms
memory: 3628kb
input:
4 3 17 0 0 16
output:
21 1 2 1 2 1 2 1 2 1 2 1 2 1 3 1 3 1 3 1 3 1 3 1 3 1 4 2 1 1 1 1 2 1 1 1 3 1 4 2 2 2 2
result:
ok
Test #66:
score: 0
Accepted
time: 1ms
memory: 3580kb
input:
5 3 1 1 0 0 0
output:
6 1 3 1 4 1 5 1 1 1 2 2 3
result:
ok
Test #67:
score: 0
Accepted
time: 1ms
memory: 3620kb
input:
7 5 11 30 0 0 0 19 0
output:
37 1 3 1 3 1 3 1 3 1 3 1 3 1 4 1 4 1 4 1 4 1 4 1 4 1 5 1 5 1 5 1 5 1 5 1 5 1 6 1 6 1 6 1 7 1 7 1 7 1 7 1 7 1 7 1 7 2 1 2 1 2 1 2 1 2 2 1 1 1 1 1 1 1 1
result:
ok
Test #68:
score: 0
Accepted
time: 1ms
memory: 3536kb
input:
10 3 21 1 1 17 1 0 14 1 2 0
output:
104 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 3 1 3 1 3 1 3 1 3 1 3 1 3 1 4 1 4 1 5 1 5 1 5 1 5 1 5 1 5 1 5 1 5 1 6 1 6 1 6 1 6 1 6 1 6 1 6 1 6 1 6 1 7 1 7 1 7 1 7 1 7 1 8 1 8 1 8 1 8 1 8 1 8 1 8 1 8 1 8 1 8 1 9 1 9 1 9 1 9 1 9 1 9 1 9 1 9 1 9 1 9 1 10 1 10 1 10 1 10 1 10 1 10 1 10 1 10 1 10 1 10 1 10 2 1 2 2 2...
result:
ok
Test #69:
score: 0
Accepted
time: 1ms
memory: 3536kb
input:
13 3 41 7 7 38 9 10 0 11 7 34 9 12 44
output:
188 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 3 1 3 1 3 1 3 1 3 1 3 1 3 1 3 1 3 1 3 1 3 1 3 1 4 1 4 1 5 1 5 1 5 1 5 1 5 1 5 1 5 1 5 1 5 1 5 1 5 1 5 1 6 1 6 1 6 1 6 1 6 1 6 1 6 1 6 1 6 1 6 1 6 1 6 1 7 1 7 1 7 1 7 1 7 1 7 1 7 1 7 1 7 1 7 1 7 1 7 1 7 1 7 1 7 1 7 1 8 1 8 1 8 1 8 1 8 1 8 1 8 1 8 ...
result:
ok
Test #70:
score: 0
Accepted
time: 1ms
memory: 3584kb
input:
16 5 17 10 12 13 15 12 14 9 12 11 0 12 15 11 10 20
output:
147 1 2 1 2 1 3 1 3 1 4 1 4 1 5 1 5 1 6 1 6 1 6 1 7 1 7 1 7 1 8 1 8 1 8 1 8 1 9 1 9 1 9 1 9 1 10 1 10 1 10 1 10 1 10 1 11 1 11 1 11 1 11 1 11 1 11 1 11 1 11 1 12 1 12 1 12 1 12 1 12 1 12 1 13 1 13 1 13 1 13 1 13 1 13 1 14 1 14 1 14 1 14 1 14 1 14 1 14 1 15 1 15 1 15 1 15 1 15 1 15 1 15 1 15 1 16 1 1...
result:
ok
Test #71:
score: 0
Accepted
time: 0ms
memory: 3596kb
input:
19 10 23 24 22 21 23 27 45 25 23 0 22 21 23 24 22 18 0 20 22
output:
159 1 3 1 4 1 4 1 5 1 5 1 6 1 6 1 7 1 8 1 8 1 8 1 9 1 9 1 9 1 9 1 10 1 10 1 10 1 10 1 10 1 10 1 10 1 11 1 11 1 11 1 11 1 11 1 12 1 12 1 12 1 12 1 12 1 12 1 13 1 13 1 13 1 13 1 13 1 13 1 14 1 14 1 14 1 14 1 14 1 14 1 15 1 15 1 15 1 15 1 15 1 15 1 15 1 16 1 16 1 16 1 16 1 16 1 16 1 16 1 16 1 17 1 17 1...
result:
ok
Test #72:
score: 0
Accepted
time: 1ms
memory: 3600kb
input:
22 10 34 24 13 15 13 13 15 15 12 13 37 25 13 11 13 13 11 11 14 13 0 22
output:
262 1 2 1 3 1 3 1 3 1 4 1 4 1 4 1 5 1 5 1 5 1 5 1 6 1 6 1 6 1 6 1 7 1 7 1 7 1 7 1 8 1 8 1 8 1 8 1 9 1 9 1 9 1 9 1 9 1 10 1 10 1 10 1 10 1 10 1 11 1 11 1 11 1 12 1 12 1 12 1 12 1 12 1 13 1 13 1 13 1 13 1 13 1 13 1 13 1 14 1 14 1 14 1 14 1 14 1 14 1 14 1 14 1 15 1 15 1 15 1 15 1 15 1 15 1 15 1 15 1 16...
result:
ok
Test #73:
score: 0
Accepted
time: 1ms
memory: 3596kb
input:
23 8 19 28 22 9 17 17 19 11 18 25 14 21 18 15 18 9 16 0 17 23 18 21 16
output:
253 1 3 1 4 1 4 1 4 1 5 1 5 1 6 1 6 1 7 1 7 1 8 1 8 1 8 1 9 1 9 1 9 1 10 1 10 1 10 1 11 1 11 1 11 1 11 1 11 1 12 1 12 1 12 1 12 1 12 1 13 1 13 1 13 1 13 1 13 1 13 1 14 1 14 1 14 1 14 1 14 1 14 1 14 1 15 1 15 1 15 1 15 1 15 1 15 1 15 1 16 1 16 1 16 1 16 1 16 1 16 1 16 1 16 1 16 1 17 1 17 1 17 1 17 1 ...
result:
ok
Test #74:
score: 0
Accepted
time: 1ms
memory: 3592kb
input:
30 29 24 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 24
output:
108 1 2 1 3 1 4 1 5 1 6 1 7 1 8 1 9 1 10 1 11 1 12 1 13 1 14 1 15 1 16 1 17 1 18 1 19 1 20 1 21 1 22 1 23 1 24 1 25 1 26 1 27 1 28 1 29 1 30 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 1 1 1 2 1 3 1 4 1 5 1 6 1 7 1 8 1 9 1 10 1 11 1 12 1 13 1 14 1 ...
result:
ok
Test #75:
score: 0
Accepted
time: 1ms
memory: 3576kb
input:
36 34 12 12 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 11 11
output:
95 1 3 1 4 1 5 1 6 1 7 1 8 1 9 1 10 1 11 1 12 1 13 1 14 1 15 1 16 1 17 1 18 1 19 1 20 1 21 1 22 1 23 1 24 1 25 1 26 1 27 1 28 1 29 1 30 1 31 1 32 1 33 1 34 1 35 1 36 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 1 1 1 2 1 3 1 4 1 5 1 6 1 7 1 8 1 9 1 10 1 11 1 12 1 13 1 14 1 15 1 16 1 17 1 18 1 19 1 20...
result:
ok
Test #76:
score: 0
Accepted
time: 1ms
memory: 3680kb
input:
41 3 3 3 5 3 2 5 0 0 1 1 1 3 2 0 3 0 0 2 1 3 2 1 1 6 0 3 3 0 1 1 1 1 7 0 1 5 2 0 3 2 0
output:
466 1 4 1 5 1 5 1 6 1 7 1 7 1 7 1 8 1 8 1 8 1 9 1 9 1 9 1 10 1 10 1 10 1 11 1 11 1 11 1 12 1 12 1 12 1 13 1 13 1 13 1 13 1 14 1 14 1 14 1 14 1 14 1 15 1 15 1 15 1 15 1 16 1 16 1 16 1 16 1 16 1 17 1 17 1 17 1 17 1 17 1 18 1 18 1 18 1 18 1 18 1 19 1 19 1 19 1 19 1 19 1 19 1 20 1 20 1 20 1 20 1 20 1 20...
result:
ok
Test #77:
score: 0
Accepted
time: 1ms
memory: 3600kb
input:
43 6 3 30 31 28 30 32 2 25 24 26 28 29 1 30 25 23 25 24 5 32 22 29 22 28 5 35 28 22 28 30 3 32 24 27 25 25 4 0 30 29 26 16 2
output:
853 1 4 1 5 1 6 1 7 1 7 1 7 1 7 1 7 1 7 1 8 1 8 1 8 1 9 1 9 1 9 1 9 1 10 1 10 1 10 1 10 1 11 1 11 1 11 1 11 1 12 1 12 1 12 1 12 1 13 1 13 1 13 1 13 1 13 1 13 1 13 1 13 1 13 1 14 1 14 1 14 1 14 1 14 1 15 1 15 1 15 1 15 1 15 1 15 1 16 1 16 1 16 1 16 1 16 1 16 1 16 1 17 1 17 1 17 1 17 1 17 1 17 1 17 1 ...
result:
ok
Test #78:
score: 0
Accepted
time: 0ms
memory: 3656kb
input:
45 13 28 0 35 30 27 28 29 19 26 28 26 31 33 35 38 33 28 29 38 24 33 32 25 29 28 28 30 42 26 33 36 30 29 30 24 29 27 23 21 28 41 27 30 29 25
output:
1070 1 2 1 2 1 2 1 3 1 4 1 4 1 5 1 5 1 5 1 6 1 6 1 6 1 7 1 7 1 7 1 8 1 8 1 8 1 8 1 9 1 9 1 9 1 9 1 10 1 10 1 10 1 10 1 11 1 11 1 11 1 11 1 11 1 12 1 12 1 12 1 12 1 12 1 13 1 13 1 13 1 13 1 13 1 14 1 14 1 14 1 14 1 14 1 15 1 15 1 15 1 15 1 15 1 16 1 16 1 16 1 16 1 16 1 16 1 17 1 17 1 17 1 17 1 17 1 1...
result:
ok
Test #79:
score: 0
Accepted
time: 1ms
memory: 3592kb
input:
46 20 31 28 32 33 31 32 13 12 12 13 8 13 0 7 13 7 10 12 14 5 31 32 32 29 36 32 7 8 8 7 12 7 20 13 7 13 10 8 6 15 34 36 32 34 29 32
output:
1006 1 2 1 3 1 4 1 5 1 5 1 6 1 6 1 7 1 7 1 7 1 8 1 8 1 8 1 8 1 9 1 9 1 9 1 9 1 10 1 10 1 10 1 10 1 11 1 11 1 11 1 11 1 11 1 12 1 12 1 12 1 12 1 12 1 13 1 13 1 13 1 13 1 13 1 13 1 14 1 14 1 14 1 14 1 14 1 14 1 15 1 15 1 15 1 15 1 15 1 15 1 16 1 16 1 16 1 16 1 16 1 16 1 16 1 17 1 17 1 17 1 17 1 17 1 1...
result:
ok
Test #80:
score: 0
Accepted
time: 1ms
memory: 3668kb
input:
47 18 33 29 35 27 37 30 31 30 0 29 31 17 19 18 22 17 21 22 30 33 28 36 29 30 29 34 48 33 31 24 22 23 19 24 20 19 32 33 32 32 29 35 35 31 47 33 33
output:
1101 1 2 1 3 1 4 1 4 1 5 1 5 1 6 1 6 1 6 1 7 1 7 1 7 1 8 1 8 1 8 1 8 1 9 1 9 1 9 1 9 1 9 1 9 1 10 1 10 1 10 1 10 1 10 1 11 1 11 1 11 1 11 1 11 1 12 1 12 1 12 1 12 1 12 1 12 1 13 1 13 1 13 1 13 1 13 1 13 1 14 1 14 1 14 1 14 1 14 1 14 1 14 1 15 1 15 1 15 1 15 1 15 1 15 1 15 1 16 1 16 1 16 1 16 1 16 1 ...
result:
ok
Test #81:
score: 0
Accepted
time: 1ms
memory: 3700kb
input:
48 7 31 42 38 43 36 36 14 35 39 37 41 31 33 11 40 33 32 41 40 42 8 40 33 37 44 38 33 10 38 34 37 43 32 36 12 34 33 38 41 37 32 11 35 39 34 0 39 41
output:
1008 1 3 1 4 1 5 1 5 1 6 1 6 1 7 1 7 1 7 1 7 1 7 1 7 1 8 1 8 1 8 1 9 1 9 1 9 1 10 1 10 1 10 1 10 1 11 1 11 1 11 1 11 1 12 1 12 1 12 1 12 1 12 1 12 1 13 1 13 1 13 1 13 1 13 1 13 1 14 1 14 1 14 1 14 1 14 1 14 1 14 1 14 1 14 1 14 1 15 1 15 1 15 1 15 1 15 1 15 1 16 1 16 1 16 1 16 1 16 1 16 1 16 1 17 1 1...
result:
ok
Test #82:
score: 0
Accepted
time: 1ms
memory: 3588kb
input:
49 3 26 43 45 31 41 48 31 47 46 33 45 46 32 40 48 34 44 47 33 46 45 35 45 48 34 45 48 38 47 0 31 46 44 38 40 49 31 44 44 29 41 48 28 42 47 28 45 48 38
output:
852 1 4 1 4 1 4 1 4 1 4 1 5 1 5 1 7 1 7 1 7 1 7 1 7 1 7 1 8 1 9 1 9 1 10 1 10 1 10 1 10 1 10 1 10 1 10 1 11 1 11 1 11 1 12 1 12 1 12 1 13 1 13 1 13 1 13 1 13 1 13 1 13 1 13 1 14 1 14 1 14 1 14 1 14 1 14 1 15 1 15 1 15 1 15 1 16 1 16 1 16 1 16 1 16 1 16 1 16 1 16 1 16 1 17 1 17 1 17 1 17 1 17 1 17 1 ...
result:
ok
Test #83:
score: 0
Accepted
time: 1ms
memory: 3608kb
input:
50 6 3 6 10 12 11 5 6 3 10 11 5 13 2 2 1 9 11 5 4 2 9 8 6 8 4 3 8 0 13 8 2 1 11 9 5 9 2 6 11 11 9 10 3 7 9 9 9 11 4 0
output:
1119 1 5 1 6 1 6 1 7 1 7 1 8 1 8 1 8 1 9 1 9 1 10 1 10 1 11 1 11 1 11 1 12 1 12 1 13 1 13 1 13 1 13 1 14 1 14 1 14 1 14 1 15 1 15 1 15 1 15 1 15 1 16 1 16 1 16 1 16 1 17 1 17 1 17 1 17 1 18 1 18 1 18 1 18 1 18 1 19 1 19 1 19 1 19 1 19 1 19 1 20 1 20 1 20 1 20 1 20 1 20 1 20 1 21 1 21 1 21 1 21 1 21 ...
result:
ok
Test #84:
score: 0
Accepted
time: 1ms
memory: 3580kb
input:
50 49 15 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 11
output:
126 1 2 1 3 1 4 1 5 1 6 1 7 1 8 1 9 1 10 1 11 1 12 1 13 1 14 1 15 1 16 1 17 1 18 1 19 1 20 1 21 1 22 1 23 1 24 1 25 1 26 1 27 1 28 1 29 1 30 1 31 1 32 1 33 1 34 1 35 1 36 1 37 1 38 1 39 1 40 1 41 1 42 1 43 1 44 1 45 1 46 1 47 1 48 1 49 1 50 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 1 1 1 2 1 3 1 4...
result:
ok
Test #85:
score: 0
Accepted
time: 1ms
memory: 3396kb
input:
50 3 0 0 1 0 1 1 0 1 1 0 1 1 0 1 1 0 1 1 0 1 1 0 1 1 0 1 1 0 1 1 0 1 1 0 1 1 0 1 1 0 1 1 0 1 1 0 1 1 0 1
output:
-1
result:
ok
Test #86:
score: 0
Accepted
time: 1ms
memory: 3424kb
input:
49 5 1 1 1 1 0 6 11 46 34 0 6 11 46 34 0 6 11 46 34 0 6 11 46 34 0 6 11 46 34 0 6 11 46 34 0 6 11 46 34 0 6 11 46 34 0 6 11 46 34
output:
-1
result:
ok
Test #87:
score: 0
Accepted
time: 1ms
memory: 3608kb
input:
50 24 1 1 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 0 49 0 49 0 49 0 49 0 49 0 49 0 49 0 49 0 49 0 49 0 49 0 49
output:
1127 1 4 1 5 1 6 1 6 1 7 1 7 1 8 1 8 1 8 1 9 1 9 1 9 1 10 1 10 1 10 1 10 1 11 1 11 1 11 1 11 1 12 1 12 1 12 1 12 1 12 1 13 1 13 1 13 1 13 1 13 1 14 1 14 1 14 1 14 1 14 1 14 1 15 1 15 1 15 1 15 1 15 1 15 1 16 1 16 1 16 1 16 1 16 1 16 1 16 1 17 1 17 1 17 1 17 1 17 1 17 1 17 1 18 1 18 1 18 1 18 1 18 1 ...
result:
ok
Test #88:
score: 0
Accepted
time: 1ms
memory: 3656kb
input:
50 47 1 1 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
output:
101 1 4 1 5 1 6 1 7 1 8 1 9 1 10 1 11 1 12 1 13 1 14 1 15 1 16 1 17 1 18 1 19 1 20 1 21 1 22 1 23 1 24 1 25 1 26 1 27 1 28 1 29 1 30 1 31 1 32 1 33 1 34 1 35 1 36 1 37 1 38 1 39 1 40 1 41 1 42 1 43 1 44 1 45 1 46 1 47 1 48 1 49 1 50 1 1 1 2 1 3 1 4 1 5 1 6 1 7 1 8 1 9 1 10 1 11 1 12 1 13 1 14 1 15 1...
result:
ok
Test #89:
score: 0
Accepted
time: 1ms
memory: 3636kb
input:
6 5 0 1 1 1 1 7
output:
17 2 1 2 1 2 1 2 1 2 1 2 1 1 1 1 2 1 3 1 4 1 1 1 5 1 6 2 2 2 2 2 2 2 2
result:
ok
Test #90:
score: 0
Accepted
time: 0ms
memory: 3584kb
input:
7 3 1 2 3 0 6 5 7
output:
27 1 4 1 6 1 7 2 2 2 2 2 2 2 3 2 3 2 4 2 1 2 4 2 1 1 1 1 1 1 1 1 2 1 2 1 1 1 3 1 4 1 5 1 6 1 7 2 2 2 2 2 5 2 5
result:
ok
Test #91:
score: 0
Accepted
time: 1ms
memory: 3584kb
input:
6 4 2 1 0 4 1 50
output:
68 1 2 1 3 1 3 1 4 1 5 1 5 2 1 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 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 2 1 3 1 1 1 2 1 4 1 5 1 6 2 3
result:
ok
Test #92:
score: 0
Accepted
time: 1ms
memory: 3636kb
input:
10 3 1 2 3 4 5 6 7 8 9 0
output:
15 1 10 1 10 1 10 2 1 2 2 2 3 2 4 2 1 2 5 2 2 2 6 2 3 1 1 1 1 1 2
result:
ok
Extra Test:
score: 0
Extra Test Passed