QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#697243 | #5089. 环覆盖 | wsc2008 | 100 ✓ | 515ms | 137284kb | C++17 | 2.2kb | 2024-11-01 12:24:05 | 2024-11-01 12:24:05 |
Judging History
answer
#pragma GCC optimize(2,3,"Ofast","inline","unroll-loops")
#include<bits/stdc++.h>
typedef long long ll;
typedef long double ld;
typedef unsigned long long ull;
#define pii pair<ll,ll>
#define rep(i,a,b) for(ll i=(a);i<=(b);++i)
#define per(i,a,b) for(ll i=(a);i>=(b);--i)
using namespace std;
bool Mbe;
ll read(){
ll x=0,f=1;char ch=getchar();
while(ch<'0'||ch>'9'){if(ch=='-')f=-1;ch=getchar();}
while(ch>='0'&&ch<='9'){x=x*10+ch-'0';ch=getchar();}
return x*f;
}
void write(ll x){
if(x<0)putchar('-'),x=-x;
if(x>9)write(x/10);
putchar(x%10+'0');
}
const ll N=25,Mod=1e9+7,inv2=(Mod+1)>>1;
ll n,m,U[N*N/2+5],V[N*N/2+5],cnt[N*N],f[N*N],ans[N*N];
ll C[N*N][N*N];
int ec[(1<<N)+5];
ll pw(ll x,ll p){
ll res=1;
while(p){
if(p&1)res=res*x%Mod;
x=x*x%Mod,p>>=1;
}
return res;
}
void FWT(ll*a,ll n,ll sgn){
for(ll i=1;i<(1<<n);i<<=1){
for(ll j=0;j<(1<<n);j+=(i<<1)){
rep(k,0,i-1){
ll x=a[j+k],y=a[j+k+i];
a[j+k]=(x+y)*sgn%Mod;
a[j+k+i]=(x-y+Mod)*sgn%Mod;
}
}
}
}
bool Med;
int main(){
cerr<<fabs(&Med-&Mbe)/1048576.0<<"MB\n";
n=read(),m=read();
rep(i,1,m)U[i]=read()-1,V[i]=read()-1;
rep(i,1,m)ec[(1<<U[i])|(1<<V[i])]++;
rep(i,0,n-1){
rep(j,0,(1<<n)-1){
if((j>>i)&1)ec[j]+=ec[j^(1<<i)];
}
}
rep(i,0,(1<<n)-1){
ll tc=m-ec[((1<<n)-1)^i]-ec[i];
cnt[tc]++;
}
//tc[i] 表示只有一端在 i 集合内的边数
//用两端至少一端在的减去两端都在的
//那么 fwt 完之后这个位置上是 (1-y)^tc[i]*(1+y)^(m-tc[i])
rep(i,0,m){
C[i][0]=1;
rep(j,1,i)C[i][j]=(C[i-1][j]+C[i-1][j-1])%Mod;
}
rep(i,0,m){
memset(f,0,sizeof(f));
rep(j,0,m){
rep(p,0,min(i,j)){
ll q=j-p;
if(q>m-i)continue;
ans[j]=(ans[j]+1ll*cnt[i]*C[i][p]%Mod*C[m-i][q]%Mod*((p&1)?Mod-1:1ll))%Mod;
}
}
}
ll ipw=pw(inv2,n);
rep(i,0,m)write(ans[i]*ipw%Mod),putchar(' ');
cerr<<"\n"<<clock()*1.0/CLOCKS_PER_SEC*1000<<"ms\n";
return 0;
}
詳細信息
Subtask #1:
score: 5
Accepted
Test #1:
score: 5
Accepted
time: 0ms
memory: 5816kb
input:
10 9 3 5 3 10 4 7 4 8 5 6 5 9 6 9 7 9 9 10
output:
1 0 0 1 1 1 0 0 0 0
result:
ok 10 numbers
Test #2:
score: 5
Accepted
time: 0ms
memory: 6016kb
input:
8 15 1 4 1 5 1 8 2 4 2 6 3 6 4 5 4 6 4 7 5 6 5 7 5 8 6 7 6 8 7 8
output:
1 0 0 10 18 26 46 54 43 30 18 8 2 0 0 0
result:
ok 16 numbers
Test #3:
score: 5
Accepted
time: 7ms
memory: 8072kb
input:
19 19 1 12 1 16 1 18 2 8 2 17 3 11 3 17 4 9 4 19 5 17 7 13 8 17 9 13 9 15 9 17 10 16 10 18 14 17 15 16
output:
1 0 0 1 1 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0
result:
ok 20 numbers
Test #4:
score: 5
Accepted
time: 0ms
memory: 6008kb
input:
7 14 1 3 1 4 1 7 2 3 2 5 2 6 2 7 3 4 3 5 3 7 4 7 5 6 5 7 6 7
output:
1 0 0 11 16 18 46 64 47 30 18 5 0 0 0
result:
ok 15 numbers
Test #5:
score: 5
Accepted
time: 0ms
memory: 6032kb
input:
10 9 1 9 2 6 3 5 3 8 3 10 4 6 4 8 5 6 7 10
output:
1 0 0 0 0 1 0 0 0 0
result:
ok 10 numbers
Test #6:
score: 5
Accepted
time: 0ms
memory: 6156kb
input:
15 14 2 9 2 10 3 5 3 10 3 12 3 14 4 6 5 10 5 15 6 9 6 15 7 11 7 13 9 15
output:
1 0 0 2 0 1 3 1 0 0 0 0 0 0 0
result:
ok 15 numbers
Test #7:
score: 5
Accepted
time: 0ms
memory: 6068kb
input:
9 8 1 3 2 4 2 7 3 5 3 9 4 6 7 9 8 9
output:
1 0 0 0 0 0 0 0 0
result:
ok 9 numbers
Test #8:
score: 5
Accepted
time: 6ms
memory: 8524kb
input:
19 18 1 5 1 9 1 15 2 4 2 11 2 15 3 6 3 8 3 17 4 19 5 12 6 13 6 15 8 10 8 15 9 19 12 17 13 16
output:
1 0 0 0 1 0 1 2 0 0 1 2 0 0 0 0 0 0 0
result:
ok 19 numbers
Test #9:
score: 5
Accepted
time: 1ms
memory: 5976kb
input:
7 18 1 2 1 3 1 4 1 6 1 7 2 3 2 5 2 6 2 7 3 4 3 5 3 7 4 5 4 6 4 7 5 6 5 7 6 7
output:
1 0 0 20 51 108 278 528 711 760 660 468 293 156 54 8 0 0 0
result:
ok 19 numbers
Test #10:
score: 5
Accepted
time: 1ms
memory: 5836kb
input:
10 15 1 6 2 4 2 6 2 9 2 10 3 5 3 8 3 9 3 10 4 5 4 8 5 8 5 10 7 9 8 9
output:
1 0 0 4 6 12 16 12 9 4 0 0 0 0 0 0
result:
ok 16 numbers
Subtask #2:
score: 15
Accepted
Dependency #1:
100%
Accepted
Test #11:
score: 15
Accepted
time: 1ms
memory: 6012kb
input:
10 22 1 2 1 3 1 4 1 6 1 8 1 9 2 3 2 4 2 5 2 7 2 8 2 10 3 8 3 10 4 7 4 8 5 7 5 10 6 10 7 9 8 10 9 10
output:
1 0 0 13 33 64 162 367 621 906 1216 1343 1215 988 682 353 146 58 20 4 0 0 0
result:
ok 23 numbers
Test #12:
score: 15
Accepted
time: 1ms
memory: 5976kb
input:
11 38 1 2 1 3 1 4 1 6 1 7 1 8 1 10 2 5 2 8 2 9 2 10 2 11 3 5 3 6 3 7 3 9 3 10 3 11 4 5 4 7 4 11 5 6 5 7 5 9 5 10 5 11 6 7 6 8 6 9 6 10 6 11 7 8 7 9 7 10 8 9 8 11 9 11 10 11
output:
1 0 0 50 210 800 3661 14805 51947 164232 466335 1177265 2639525 5274024 9420013 15077609 21687685 28100640 32827271 34579721 32851761 28140784 21708463 15062239 9394113 5261128 2639589 1183171 472151 166600 51607 13987 3278 656 117 17 1 0 0
result:
ok 39 numbers
Test #13:
score: 15
Accepted
time: 1ms
memory: 6028kb
input:
11 24 1 3 1 4 1 7 1 8 2 6 2 7 2 8 3 4 3 5 3 6 3 8 3 10 4 7 4 9 5 7 5 9 5 11 6 8 6 10 6 11 7 10 7 11 8 9 8 10
output:
1 0 0 9 26 65 147 343 709 1179 1783 2437 2715 2489 1993 1341 702 297 109 30 7 2 0 0 0
result:
ok 25 numbers
Test #14:
score: 15
Accepted
time: 1ms
memory: 6028kb
input:
11 37 1 2 1 4 1 5 1 6 1 7 1 10 2 3 2 4 2 6 2 7 2 8 2 9 2 10 3 5 3 6 3 8 3 10 3 11 4 5 4 6 4 9 4 10 4 11 5 7 5 9 6 7 6 8 6 10 6 11 7 9 7 10 7 11 8 9 8 10 8 11 9 10 10 11
output:
1 0 0 46 189 675 2952 11644 39587 121171 335150 825420 1798517 3475223 5977332 9174036 12597741 15530759 17234898 17229504 15512559 12574521 9163776 5982788 3484905 1805833 829874 336708 120415 37965 10436 2476 518 93 14 2 0 0
result:
ok 38 numbers
Test #15:
score: 15
Accepted
time: 6ms
memory: 8068kb
input:
19 24 1 9 1 10 1 17 1 19 2 3 3 6 4 8 4 10 4 13 4 14 5 7 7 11 8 13 8 17 9 12 9 16 10 19 11 15 11 17 12 16 13 15 14 15 14 17 14 19
output:
1 0 0 3 5 8 14 25 31 36 40 33 27 20 10 3 0 0 0 0 0 0 0 0 0
result:
ok 25 numbers
Test #16:
score: 15
Accepted
time: 0ms
memory: 6024kb
input:
9 30 1 3 1 4 1 5 1 6 1 7 2 3 2 4 2 5 2 6 2 7 2 8 2 9 3 4 3 5 3 6 3 7 3 8 4 5 4 6 4 8 4 9 5 6 5 7 5 8 5 9 6 7 6 8 6 9 7 9 8 9
output:
1 0 0 48 175 568 2365 8050 22348 54852 117479 214858 338872 467840 567602 604996 567273 467832 338270 213748 117607 55912 22753 7882 2298 548 107 18 2 0 0
result:
ok 31 numbers
Test #17:
score: 15
Accepted
time: 0ms
memory: 6892kb
input:
18 24 1 2 1 7 1 13 1 15 1 17 2 3 2 17 3 9 4 6 4 7 5 8 5 15 5 16 6 7 6 14 7 14 8 11 8 16 10 16 11 12 11 18 14 16 14 17 15 16
output:
1 0 0 5 3 4 14 15 16 21 21 16 8 3 1 0 0 0 0 0 0 0 0 0 0
result:
ok 25 numbers
Test #18:
score: 15
Accepted
time: 1ms
memory: 5988kb
input:
13 27 1 2 1 5 1 7 1 10 1 11 1 12 2 3 2 4 2 12 3 4 3 11 3 12 4 5 4 7 4 12 4 13 5 9 5 10 5 11 7 8 7 9 7 11 7 12 8 11 9 13 10 12 11 13
output:
1 0 0 12 37 85 229 607 1265 2371 4146 6130 7924 9384 9660 8504 6605 4404 2430 1122 423 139 47 9 1 1 0 0
result:
ok 28 numbers
Test #19:
score: 15
Accepted
time: 1ms
memory: 6040kb
input:
7 21 1 2 1 3 1 4 1 5 1 6 1 7 2 3 2 4 2 5 2 6 2 7 3 4 3 5 3 6 3 7 4 5 4 6 4 7 5 6 5 7 6 7
output:
1 0 0 35 105 252 805 1935 3255 4515 5481 5481 4515 3255 1935 805 252 105 35 0 0 1
result:
ok 22 numbers
Test #20:
score: 15
Accepted
time: 3ms
memory: 8400kb
input:
18 32 1 4 1 7 1 12 1 16 1 17 1 18 2 3 2 4 2 6 2 8 2 9 2 10 2 17 2 18 3 9 3 15 3 18 4 11 4 12 4 15 4 16 5 17 6 10 6 15 6 17 7 8 9 16 9 18 10 11 11 12 11 16 14 17
output:
1 0 0 10 18 41 122 291 623 1198 2148 3576 5244 6798 8004 8546 8223 7176 5608 3798 2226 1153 498 163 49 18 4 0 0 0 0 0 0
result:
ok 33 numbers
Test #21:
score: 15
Accepted
time: 2ms
memory: 6528kb
input:
17 21 1 5 1 9 1 12 2 3 2 9 2 11 2 12 2 13 2 15 3 13 4 5 4 9 4 11 4 13 5 8 5 15 7 8 7 9 8 10 8 15 12 13
output:
1 0 0 3 6 15 21 32 55 75 87 75 56 45 27 10 2 1 1 0 0 0
result:
ok 22 numbers
Test #22:
score: 15
Accepted
time: 3ms
memory: 7052kb
input:
18 25 1 5 1 6 1 7 1 18 3 4 3 9 3 18 4 9 4 15 5 8 5 10 5 13 5 16 5 17 6 14 6 16 7 8 8 9 9 10 9 14 10 12 10 15 11 12 13 18 16 17
output:
1 0 0 2 5 2 17 21 25 49 57 68 59 68 67 37 22 9 3 0 0 0 0 0 0 0
result:
ok 26 numbers
Test #23:
score: 15
Accepted
time: 1ms
memory: 5908kb
input:
11 31 1 2 1 6 1 7 1 8 1 10 1 11 2 3 2 4 2 7 2 8 3 5 3 6 3 10 3 11 4 5 4 6 4 7 4 8 4 10 5 6 5 8 5 9 5 10 6 10 6 11 7 8 7 10 7 11 8 9 8 11 9 10
output:
1 0 0 25 80 252 931 2947 8105 19882 43247 82492 137162 199904 257302 292622 293531 259948 203238 139705 83764 43252 18951 6991 2155 538 107 18 2 0 0 0
result:
ok 32 numbers
Test #24:
score: 15
Accepted
time: 0ms
memory: 6036kb
input:
11 23 1 3 1 6 1 7 1 8 1 10 1 11 2 4 2 7 2 9 2 10 3 4 3 6 3 8 3 9 3 11 4 5 4 6 4 9 5 8 5 10 6 11 8 9 9 11
output:
1 0 0 10 22 49 126 253 455 770 1080 1267 1327 1146 774 475 272 114 36 11 3 1 0 0
result:
ok 24 numbers
Test #25:
score: 15
Accepted
time: 0ms
memory: 6040kb
input:
12 26 1 2 1 4 1 5 1 6 1 8 1 9 1 11 1 12 2 3 2 6 2 8 2 10 2 12 3 10 3 11 3 12 4 6 4 7 4 9 5 9 5 10 6 7 6 8 6 11 7 10 8 9
output:
1 0 0 13 25 58 172 367 751 1471 2425 3509 4595 5207 4957 3973 2676 1501 699 266 80 19 3 0 0 0 0
result:
ok 27 numbers
Test #26:
score: 15
Accepted
time: 1ms
memory: 6168kb
input:
15 36 1 3 1 6 2 5 2 11 2 14 2 15 3 6 3 7 3 9 3 11 3 12 3 13 4 10 4 11 4 14 5 6 5 9 5 10 5 11 5 12 5 15 6 13 6 14 7 8 7 12 7 13 7 15 8 9 8 13 8 14 10 14 11 13 12 13 12 14 12 15 13 14
output:
1 0 0 16 47 142 453 1358 3739 9187 20868 43655 82997 144331 229041 329775 431023 509806 542672 519878 448465 346692 239031 146924 80469 38975 16428 5939 1835 467 83 7 0 0 0 0 0
result:
ok 37 numbers
Test #27:
score: 15
Accepted
time: 2ms
memory: 6540kb
input:
17 40 1 3 1 5 1 6 1 8 2 3 2 7 2 8 2 9 2 17 3 5 3 7 3 8 3 9 3 11 4 5 4 7 4 10 4 12 5 6 5 8 5 15 6 12 6 13 6 15 6 17 7 15 8 11 8 14 8 16 9 12 9 13 9 14 9 16 10 11 10 16 11 12 11 16 11 17 12 14 12 17
output:
1 0 0 15 35 114 403 1162 3281 8752 21580 49554 105445 207380 375007 621544 945721 1318606 1677800 1947770 2063989 1989450 1738049 1375770 984863 634460 367508 191810 89635 37264 13901 4628 1334 326 56 3 0 0 0 0 0
result:
ok 41 numbers
Test #28:
score: 15
Accepted
time: 3ms
memory: 9116kb
input:
19 22 1 8 1 17 2 7 2 13 3 6 3 8 3 9 3 17 4 8 5 10 5 12 5 17 6 9 7 10 8 11 9 11 9 13 10 16 11 12 11 15 12 17 15 19
output:
1 0 0 2 2 4 6 6 7 7 7 7 5 5 3 1 1 0 0 0 0 0 0
result:
ok 23 numbers
Test #29:
score: 15
Accepted
time: 3ms
memory: 6916kb
input:
18 37 1 3 1 12 2 14 3 4 3 8 3 11 3 14 3 16 4 12 5 6 5 7 5 17 6 7 6 8 6 12 6 14 6 18 7 8 7 9 7 12 7 14 8 15 8 18 9 13 9 18 10 12 10 15 11 17 12 13 12 14 13 14 13 16 13 18 14 17 15 16 16 18 17 18
output:
1 0 0 10 33 82 233 654 1551 3511 7445 14215 25024 40511 60096 82061 102886 118406 124842 120512 106865 86464 63433 42184 24919 12915 6033 2495 862 255 62 13 3 0 0 0 0 0
result:
ok 38 numbers
Test #30:
score: 15
Accepted
time: 1ms
memory: 6216kb
input:
16 22 1 4 1 7 1 13 1 14 2 4 2 11 3 6 3 8 3 9 4 7 4 8 4 14 5 14 6 13 8 11 8 15 10 16 12 14 12 15 13 15 14 16 15 16
output:
1 0 0 2 3 6 7 13 18 15 14 14 15 10 3 3 3 1 0 0 0 0 0
result:
ok 23 numbers
Subtask #3:
score: 15
Accepted
Test #31:
score: 15
Accepted
time: 515ms
memory: 135252kb
input:
25 45 1 6 1 12 1 17 2 3 2 4 2 6 3 6 3 8 4 5 4 12 4 16 5 17 6 21 7 14 7 22 7 23 8 15 8 19 8 24 9 11 9 19 9 23 9 25 10 17 10 18 11 16 11 19 11 22 12 19 13 18 14 19 15 19 16 24 17 19 17 22 17 25 18 19 18 21 18 24 19 23 20 22 21 25 22 23 23 25 24 25
output:
1 0 0 6 14 39 85 198 451 995 2173 4284 8230 15397 26870 44452 69519 101666 139154 177420 209814 230374 234537 220150 189837 150703 109969 72996 43834 23885 11788 5232 2064 716 224 62 12 1 0 0 0 0 0 0 0 0
result:
ok 46 numbers
Test #32:
score: 15
Accepted
time: 504ms
memory: 135052kb
input:
25 45 1 6 1 11 1 13 1 14 2 9 2 10 2 20 2 22 3 17 3 21 3 22 4 14 4 20 4 24 5 19 5 20 6 9 6 18 7 23 8 14 8 24 9 10 9 21 10 11 10 14 10 18 11 22 12 20 13 16 14 16 14 20 15 23 16 25 17 19 17 23 18 22 18 23 19 21 19 23 19 25 20 22 21 23 22 24 23 25 24 25
output:
1 0 0 6 14 31 74 181 468 1135 2360 4843 9830 18434 32404 53472 82502 119104 159718 198544 228314 241907 235810 210693 172196 128583 87316 53963 30130 14876 6560 2582 833 218 46 4 0 0 0 0 0 0 0 0 0 0
result:
ok 46 numbers
Test #33:
score: 15
Accepted
time: 490ms
memory: 135212kb
input:
25 45 1 11 1 12 1 17 2 11 2 13 2 15 3 19 4 7 4 12 4 16 4 21 5 16 5 25 6 14 6 15 6 21 6 22 6 25 7 15 7 23 8 11 8 16 8 18 9 11 10 11 10 16 11 23 11 25 12 19 12 21 12 25 13 18 13 20 14 18 15 20 16 17 16 20 17 22 18 22 19 24 20 21 21 24 22 24 23 25 24 25
output:
1 0 0 2 13 21 78 161 382 908 1931 4128 8119 15293 26845 44666 70215 102467 140124 177415 209314 230772 234200 219453 189104 149762 109859 73038 43967 24329 12045 5368 2138 735 230 57 11 1 0 0 0 0 0 0 0 0
result:
ok 46 numbers
Test #34:
score: 15
Accepted
time: 494ms
memory: 135236kb
input:
25 45 1 5 2 15 2 16 2 24 3 14 3 17 3 20 4 14 4 17 4 24 5 12 5 14 5 23 5 25 6 11 6 21 7 8 7 12 7 16 8 17 8 21 8 25 9 23 10 13 11 17 12 14 13 25 14 18 15 21 15 22 15 24 16 23 17 18 17 19 17 20 18 24 19 20 19 21 19 23 19 25 20 21 21 24 22 25 23 24 24 25
output:
1 0 0 6 20 39 101 321 704 1575 3550 7220 14060 25467 43101 68935 102070 140187 179306 212666 233596 236709 221359 191311 151760 109733 71754 42344 22628 10489 4079 1481 473 89 14 4 0 0 0 0 0 0 0 0 0 0
result:
ok 46 numbers
Test #35:
score: 15
Accepted
time: 471ms
memory: 135240kb
input:
25 45 1 4 1 18 2 12 2 21 2 24 3 10 3 13 4 9 4 10 4 18 5 7 5 24 5 25 6 7 7 19 7 20 8 24 9 23 9 25 10 12 11 12 11 19 12 14 12 15 12 16 12 24 13 18 13 20 13 22 14 15 15 22 16 17 16 21 16 23 17 25 18 19 18 21 19 21 19 24 20 23 21 22 21 24 22 23 23 25 24 25
output:
1 0 0 8 11 25 94 223 468 1096 2376 4712 9191 16836 28866 46984 71744 103145 139116 174771 205491 225049 228418 215831 188656 151442 112176 76086 46649 26042 13086 5650 2075 653 156 23 2 0 0 0 0 0 0 0 0 0
result:
ok 46 numbers
Test #36:
score: 15
Accepted
time: 496ms
memory: 135240kb
input:
25 45 1 5 1 7 1 13 1 24 2 4 2 16 2 19 2 20 2 23 3 5 3 19 4 10 4 21 4 24 5 12 5 15 5 24 6 14 7 9 7 12 8 9 8 20 9 11 9 14 9 16 9 19 10 11 10 24 11 24 12 22 13 14 13 15 14 17 14 25 15 24 16 20 17 19 18 23 19 21 19 25 20 24 21 25 22 25 23 25 24 25
output:
1 0 0 6 14 29 79 217 496 1089 2342 4762 9190 16784 28993 47139 71899 103164 138682 174306 205295 224981 228393 215927 189338 152361 112330 75734 46356 25630 12727 5629 2202 762 230 56 9 0 0 0 0 0 0 0 0 0
result:
ok 46 numbers
Test #37:
score: 15
Accepted
time: 489ms
memory: 137120kb
input:
25 45 1 5 1 13 1 18 2 8 3 18 4 7 4 9 4 10 4 17 4 22 5 8 5 11 5 18 5 21 6 8 7 8 7 10 7 12 7 23 8 13 8 24 9 13 9 17 10 11 10 13 10 22 10 23 11 13 11 15 12 13 12 21 13 24 13 25 14 22 15 22 16 20 17 23 18 20 19 20 20 21 21 25 22 23 23 24 23 25 24 25
output:
1 0 0 10 23 65 164 427 1110 2430 5223 10849 20487 36528 61390 95232 137000 182691 224085 251788 257605 238313 198664 148987 100594 61340 33761 16697 7389 2902 998 298 79 19 3 0 0 0 0 0 0 0 0 0 0 0
result:
ok 46 numbers
Test #38:
score: 15
Accepted
time: 498ms
memory: 135252kb
input:
25 45 1 3 1 10 1 17 2 3 2 12 2 17 2 21 2 25 3 17 3 18 4 5 4 12 4 15 4 20 5 16 6 8 6 13 6 19 7 10 7 12 7 17 7 25 8 12 8 21 8 25 9 20 9 24 10 14 11 19 12 23 13 18 14 19 15 16 15 20 16 19 16 22 17 25 18 23 18 24 19 20 20 21 21 24 22 25 23 24 24 25
output:
1 0 0 6 15 26 65 188 373 781 1778 3546 6672 12449 22286 37290 58562 87158 121754 158290 192149 217606 228866 223176 201165 167569 129390 92126 60246 36309 19966 9954 4539 1868 694 224 54 10 1 0 0 0 0 0 0 0
result:
ok 46 numbers
Test #39:
score: 15
Accepted
time: 494ms
memory: 135188kb
input:
25 45 1 4 1 11 1 16 2 15 2 16 2 20 3 13 3 16 3 18 3 20 4 21 5 15 6 7 6 15 6 20 7 10 7 11 7 25 8 20 9 12 9 19 10 18 10 24 11 15 12 19 13 17 13 18 13 23 14 15 14 18 15 17 15 21 16 17 16 25 17 23 17 25 18 20 19 25 20 23 21 23 21 25 22 23 22 24 23 24 24 25
output:
1 0 0 6 14 39 96 272 631 1369 3196 6511 12187 22419 38111 59813 88896 123532 159225 191834 215996 225978 220038 199786 167995 130337 93566 61691 36899 20059 9899 4337 1661 554 157 38 8 1 0 0 0 0 0 0 0 0
result:
ok 46 numbers
Test #40:
score: 15
Accepted
time: 486ms
memory: 137284kb
input:
25 45 1 6 2 9 2 22 3 7 3 21 3 22 4 13 4 24 5 7 5 13 6 8 6 12 6 21 7 11 7 20 7 25 8 10 8 23 9 14 9 23 10 11 10 23 10 25 11 15 11 20 11 24 12 18 12 19 13 15 13 19 14 20 14 22 15 19 16 20 17 19 18 24 19 20 20 21 20 22 20 23 21 25 22 23 22 25 23 24 24 25
output:
1 0 0 5 24 44 96 288 680 1381 2907 5899 11114 20124 34394 55182 83504 118925 157969 194575 223164 237260 232156 209092 172700 130095 89549 56573 32290 16236 7178 2670 811 223 39 4 0 0 0 0 0 0 0 0 0 0
result:
ok 46 numbers
Test #41:
score: 15
Accepted
time: 492ms
memory: 135240kb
input:
25 45 1 3 1 9 2 15 3 5 3 18 4 19 5 7 5 15 5 20 5 24 6 8 6 11 6 18 7 12 7 16 8 11 8 14 9 16 10 12 10 14 10 19 10 21 11 16 11 20 11 21 12 25 13 15 13 22 14 20 15 22 15 24 16 20 17 18 17 22 17 24 18 19 18 21 18 22 19 23 20 22 20 23 21 22 22 25 23 25 24 25
output:
1 0 0 6 11 32 87 181 441 1081 2236 4458 8828 16185 27814 45652 70301 101077 136679 173473 205898 227807 233635 221805 194271 155347 112682 73876 43484 22807 10528 4298 1562 463 115 27 3 1 0 0 0 0 0 0 0 0
result:
ok 46 numbers
Test #42:
score: 15
Accepted
time: 485ms
memory: 135236kb
input:
25 45 1 12 1 25 2 14 2 20 2 22 3 5 3 25 4 6 4 8 4 11 4 22 5 10 5 23 6 18 7 18 7 23 7 24 8 14 8 15 9 18 9 19 9 25 10 16 10 18 11 23 12 23 13 19 14 17 14 23 14 24 15 19 15 20 15 23 16 17 17 18 17 22 17 24 17 25 18 20 19 24 20 23 21 24 22 23 23 25 24 25
output:
1 0 0 3 20 45 100 263 624 1371 2860 5822 10908 19167 32050 50483 75339 105494 138640 171726 199309 216836 220464 208469 183866 151055 114548 79494 50574 29643 15754 7425 3114 1184 384 91 21 5 0 0 0 0 0 0 0 0
result:
ok 46 numbers
Test #43:
score: 15
Accepted
time: 483ms
memory: 135260kb
input:
25 45 1 16 1 17 1 18 2 12 3 15 3 19 3 21 3 25 4 10 4 18 5 10 5 15 6 14 6 15 6 17 6 20 7 13 7 15 7 25 8 10 9 17 9 25 10 18 11 16 11 24 11 25 12 18 12 20 13 14 13 25 14 21 14 24 15 25 16 23 16 24 17 18 17 19 18 23 19 24 20 24 21 23 22 24 23 24 23 25 24 25
output:
1 0 0 9 13 38 116 261 618 1406 3047 6117 11514 20963 35678 56419 84321 118419 155479 190947 218689 233404 231440 211371 176752 134940 93485 58015 31512 14555 5550 1661 356 51 5 0 0 0 0 0 0 0 0 0 0 0
result:
ok 46 numbers
Test #44:
score: 15
Accepted
time: 495ms
memory: 135248kb
input:
25 45 1 22 1 23 1 25 2 21 3 7 3 24 4 9 4 25 5 14 5 18 5 20 5 22 5 23 6 16 6 25 7 18 7 25 8 20 8 24 9 18 9 19 9 21 10 11 10 14 11 19 12 13 12 15 12 17 13 16 13 19 14 15 14 24 15 22 16 20 16 22 16 24 17 24 17 25 18 25 19 22 20 24 21 24 22 23 23 24 24 25
output:
1 0 0 6 13 36 93 236 510 1079 2358 4689 8752 15554 26303 42494 64259 91263 123073 156175 185307 206398 216074 211312 192544 164133 130648 96615 66154 41750 24487 13350 6606 3013 1249 435 142 38 3 0 0 0 0 0 0 0
result:
ok 46 numbers
Test #45:
score: 15
Accepted
time: 485ms
memory: 135048kb
input:
25 45 1 7 1 25 2 8 2 13 2 23 3 6 3 20 4 11 4 22 5 12 6 7 7 17 8 12 8 15 8 16 9 15 9 17 9 25 10 20 10 21 11 14 11 15 12 13 12 23 12 25 13 15 13 16 14 16 14 22 15 17 15 22 16 18 16 19 16 23 17 20 17 22 17 24 18 19 19 22 19 24 20 24 21 24 22 24 23 24 24 25
output:
1 0 0 6 24 27 89 295 615 1374 2798 5514 10289 17482 28847 44740 65229 91408 120732 150836 179605 201814 212731 209916 193517 166110 132686 98874 68259 43202 25241 13688 6622 2836 1160 418 127 35 4 1 0 0 0 0 0 0
result:
ok 46 numbers
Test #46:
score: 15
Accepted
time: 487ms
memory: 135244kb
input:
25 45 1 6 1 8 1 13 1 21 1 24 2 16 2 23 3 10 3 13 3 21 4 15 5 8 5 11 6 12 7 10 7 20 7 25 8 9 8 16 8 18 9 12 9 13 9 14 9 24 10 18 10 19 11 12 11 16 12 25 13 17 14 18 14 24 15 24 16 25 17 18 17 25 18 24 19 21 19 22 20 21 20 23 21 25 22 25 23 25 24 25
output:
1 0 0 2 19 38 72 182 483 1126 2220 4565 8870 15928 27728 45353 69492 100850 137486 174556 206839 228542 233888 221360 192527 153266 112208 74477 44304 23828 11192 4305 1241 198 6 0 0 0 0 0 0 0 0 0 0 0
result:
ok 46 numbers
Test #47:
score: 15
Accepted
time: 490ms
memory: 135256kb
input:
25 45 1 12 1 19 2 5 3 4 4 8 4 21 5 12 5 25 6 11 6 14 7 8 7 15 8 22 9 12 9 22 10 12 10 15 10 19 10 25 11 20 11 25 12 18 12 19 12 23 12 24 13 15 14 20 15 17 15 19 15 21 15 22 16 18 16 23 17 19 17 25 18 22 18 25 19 20 19 22 20 21 20 25 21 25 22 25 23 25 24 25
output:
1 0 0 8 36 76 182 525 1222 2588 5181 9776 17373 28858 45030 66505 93172 122660 152393 180028 200325 209594 206650 191343 166042 133844 100063 69680 44423 25662 13450 6331 2699 1004 315 92 19 2 0 0 0 0 0 0 0 0
result:
ok 46 numbers
Test #48:
score: 15
Accepted
time: 479ms
memory: 135252kb
input:
25 45 1 11 1 15 1 23 2 7 3 5 3 7 3 8 3 15 4 17 4 22 4 23 5 6 5 24 6 13 6 15 7 22 8 10 9 13 9 18 9 19 9 24 9 25 10 16 10 18 10 22 10 24 11 22 12 20 13 21 14 15 14 22 15 24 16 20 16 22 17 24 18 21 19 20 19 21 20 21 20 22 21 25 22 23 22 25 23 24 24 25
output:
1 0 0 5 18 36 74 222 539 1138 2363 4876 9417 16930 29039 47152 72144 103224 137826 173144 204110 224632 229592 216606 189295 152850 112655 75904 46821 25922 12607 5332 1941 580 132 23 2 0 0 0 0 0 0 0 0 0
result:
ok 46 numbers
Test #49:
score: 15
Accepted
time: 481ms
memory: 135196kb
input:
25 45 1 9 1 14 1 19 1 24 2 9 2 14 3 5 3 10 3 22 4 11 4 12 5 15 6 15 6 17 7 9 7 12 7 14 7 19 8 12 8 18 9 15 9 18 10 16 10 17 10 25 11 21 12 15 13 18 13 20 14 17 14 20 14 21 15 18 16 21 17 19 17 25 18 22 19 23 19 24 19 25 20 21 21 22 22 24 23 25 24 25
output:
1 0 0 7 14 20 70 179 386 904 1853 3760 7442 13396 22851 37085 56606 81241 110164 141228 169884 192117 204658 205175 193972 172218 143933 113604 83530 57334 37215 22495 12505 6405 2994 1257 458 141 38 10 2 0 0 0 0 0
result:
ok 46 numbers
Test #50:
score: 15
Accepted
time: 485ms
memory: 135240kb
input:
25 45 1 7 2 3 2 5 2 9 2 10 2 16 2 21 3 20 3 21 4 10 4 17 5 7 5 12 5 20 6 8 6 19 7 12 7 15 7 17 8 15 8 25 9 11 9 20 10 21 11 19 11 23 12 23 13 14 13 19 13 21 13 22 14 16 15 21 16 19 17 23 18 23 19 22 19 24 20 21 21 22 21 24 21 25 22 24 23 24 24 25
output:
1 0 0 9 17 26 84 237 502 1050 2258 4545 8579 15634 27094 44049 67642 97994 133740 171831 206391 230734 239280 229191 201270 159358 112666 71419 39989 19270 8102 3003 921 222 40 4 0 0 0 0 0 0 0 0 0 0
result:
ok 46 numbers
Subtask #4:
score: 30
Accepted
Dependency #2:
100%
Accepted
Test #51:
score: 30
Accepted
time: 0ms
memory: 8204kb
input:
15 104 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 2 3 2 4 2 5 2 6 2 7 2 8 2 9 2 10 2 11 2 12 2 13 2 14 2 15 3 4 3 5 3 6 3 7 3 8 3 9 3 10 3 11 3 12 3 13 3 14 3 15 4 5 4 6 4 7 4 8 4 9 4 10 4 11 4 12 4 13 4 14 4 15 5 6 5 7 5 8 5 9 5 10 5 11 5 12 5 13 5 14 5 15 6 7 6 8 6 9 6 10 6 11 6...
output:
1 0 0 442 3939 34320 372801 3661658 32985238 283075936 294329881 441417693 293007257 733544953 819572609 817295250 950834455 866813935 477236103 827061189 801102395 532780660 971544264 254912703 380778104 572112036 447607103 447536960 848347203 364310032 327003537 595530991 844889153 408801661 53864...
result:
ok 105 numbers
Test #52:
score: 30
Accepted
time: 0ms
memory: 6032kb
input:
11 48 1 2 1 3 1 4 1 5 1 6 1 7 1 8 1 9 1 10 1 11 2 3 2 4 2 5 2 6 2 7 2 8 2 9 2 10 2 11 3 4 3 5 3 6 3 8 3 9 3 10 4 5 4 6 4 7 4 8 4 9 4 10 4 11 5 6 5 10 5 11 6 7 6 8 6 9 6 10 7 8 7 9 7 10 7 11 8 10 8 11 9 10 9 11 10 11
output:
1 0 0 109 570 2747 16659 87743 401245 1683808 6425588 22009859 67734240 187875613 470651385 67923054 203081700 146567060 139877519 271028373 340736780 787638539 741967528 233415764 495334841 235657822 745096210 789747251 340760696 269512157 138207585 145638206 202922879 68222601 471116512 188240033 ...
result:
ok 49 numbers
Test #53:
score: 30
Accepted
time: 1ms
memory: 6032kb
input:
11 53 1 2 1 3 1 4 1 5 1 6 1 7 1 8 1 9 1 10 1 11 2 3 2 4 2 5 2 6 2 7 2 8 2 9 2 11 3 4 3 5 3 6 3 7 3 8 3 10 3 11 4 5 4 6 4 7 4 8 4 9 4 10 4 11 5 6 5 7 5 8 5 9 5 10 5 11 6 7 6 8 6 9 6 10 6 11 7 8 7 9 7 10 7 11 8 9 8 10 8 11 9 10 9 11 10 11
output:
1 0 0 147 848 4564 31031 182864 939323 4444237 19156298 74280489 259536298 819829262 346508993 105489604 501641494 558922700 108877499 237906596 592349717 510284806 680501081 816312648 29051039 775037180 645253810 617231424 715537662 984053436 811352758 709885471 547377455 610458255 232561172 951544...
result:
ok 54 numbers
Test #54:
score: 30
Accepted
time: 0ms
memory: 6468kb
input:
17 95 1 4 1 6 1 7 1 8 1 9 1 11 1 12 1 13 1 14 1 16 1 17 2 3 2 4 2 5 2 6 2 7 2 9 2 10 2 11 2 13 2 14 2 15 2 16 3 4 3 5 3 6 3 7 3 8 3 9 3 11 3 13 3 14 3 15 3 17 4 5 4 7 4 9 4 11 4 12 4 13 4 14 4 16 5 6 5 7 5 8 5 9 5 11 5 13 5 15 5 16 6 7 6 8 6 9 6 10 6 12 6 13 6 14 6 15 6 16 6 17 7 9 7 11 7 12 7 13 7 ...
output:
1 0 0 229 1656 11916 105859 856023 6418302 46089154 314385369 26088089 327242703 733343055 315576599 42759328 562785438 342116123 75345100 558756709 184460795 517193712 118826100 562477709 860025263 311622940 542336786 96183060 667385119 900120541 927278035 67836419 880429170 463928262 19863748 6045...
result:
ok 96 numbers
Test #55:
score: 30
Accepted
time: 0ms
memory: 10396kb
input:
17 110 1 2 1 3 1 5 1 6 1 7 1 8 1 9 1 10 1 12 1 13 1 14 1 15 1 16 1 17 2 3 2 4 2 5 2 6 2 7 2 9 2 11 2 12 2 13 2 14 2 15 2 16 2 17 3 4 3 5 3 6 3 7 3 8 3 9 3 10 3 11 3 12 3 13 3 14 3 15 3 16 4 5 4 7 4 8 4 9 4 10 4 11 4 13 4 16 4 17 5 6 5 8 5 9 5 10 5 11 5 12 5 15 5 16 5 17 6 8 6 9 6 10 6 11 6 13 6 14 6...
output:
1 0 0 355 3015 25184 259833 2456018 21536132 181074947 449451304 984064270 739173298 414416844 49135697 737446715 265328740 100259093 387120508 613495292 462874402 910354730 519680365 288199822 282391720 344725880 233126959 151130612 397369021 945045119 99743521 387587905 124292644 306026554 1136628...
result:
ok 111 numbers
Test #56:
score: 30
Accepted
time: 9ms
memory: 8068kb
input:
19 123 1 2 1 3 1 4 1 5 1 6 1 7 1 8 1 9 1 10 1 11 1 14 1 15 1 16 1 18 1 19 2 4 2 5 2 6 2 8 2 10 2 12 2 14 2 16 3 4 3 5 3 6 3 7 3 8 3 9 3 10 3 11 3 12 3 13 3 14 3 16 3 19 4 5 4 6 4 7 4 8 4 9 4 10 4 11 4 13 4 16 4 17 4 18 4 19 5 6 5 8 5 9 5 10 5 11 5 12 5 13 5 14 5 15 5 16 5 17 5 19 6 8 6 9 6 10 6 11 6...
output:
1 0 0 356 3100 26409 277901 2708150 24637214 216127052 817284587 569558531 292380212 285013272 944652984 668087787 580486336 5370387 138569585 396609139 267024892 105431949 832156589 905652277 821386611 477941788 907739252 505215779 873361169 731273863 126431966 261659699 221501167 87238880 95950270...
result:
ok 124 numbers
Test #57:
score: 30
Accepted
time: 1ms
memory: 6160kb
input:
15 47 1 2 1 6 1 7 1 13 1 14 1 15 2 5 2 6 2 8 2 12 2 14 2 15 3 4 3 6 3 7 3 8 3 12 3 14 3 15 4 7 4 8 4 11 4 13 4 15 5 9 5 12 6 7 6 8 6 9 6 13 6 14 7 8 7 10 7 11 8 11 8 12 8 13 8 15 9 13 9 14 9 15 10 11 10 14 10 15 11 13 12 13 12 14
output:
1 0 0 36 149 554 2440 10193 38386 133688 434643 1309992 3637452 9283960 21767984 46851740 92470846 167312848 277685724 423079072 592206862 762195420 902557136 983552102 986192096 909351712 770433242 599141880 427179244 278830904 166335216 90517020 44824953 20132592 8167148 2975132 964261 274506 6733...
result:
ok 48 numbers
Test #58:
score: 30
Accepted
time: 1ms
memory: 6040kb
input:
12 58 1 3 1 6 1 7 1 8 1 9 1 10 1 11 1 12 2 4 2 5 2 6 2 8 2 9 2 10 2 11 2 12 3 4 3 6 3 7 3 8 3 9 3 10 3 11 3 12 4 5 4 6 4 7 4 8 4 9 4 10 4 11 4 12 5 6 5 7 5 9 5 10 5 11 5 12 6 8 6 9 6 10 6 11 6 12 7 8 7 9 7 10 7 11 7 12 8 9 8 10 8 11 8 12 9 10 9 11 9 12 10 11 10 12 11 12
output:
1 0 0 151 885 4921 34571 211997 1149312 5800110 26936566 113880804 438695848 541828605 946212188 507600742 8624296 425572282 711064165 614259593 108826763 307179557 60705428 391181237 434504345 47842733 417259011 597505666 283331656 736128449 167534520 426973466 291722282 39024149 525663637 50245626...
result:
ok 59 numbers
Test #59:
score: 30
Accepted
time: 6ms
memory: 8644kb
input:
19 46 1 6 1 8 1 12 1 17 2 4 2 8 2 9 2 11 2 19 3 5 3 9 3 11 3 13 4 5 4 6 4 8 4 9 4 18 4 19 5 8 5 14 5 19 6 11 6 13 6 18 6 19 7 12 8 9 8 12 8 14 9 11 9 15 10 18 10 19 11 13 11 16 11 18 11 19 12 16 12 17 12 19 13 16 14 18 16 18 17 18 18 19
output:
1 0 0 25 66 217 897 2920 9054 26969 73787 188291 448438 988311 2015427 3801309 6612052 10589033 15601879 21133405 26302858 30062489 31527753 30326293 26746814 21606419 15962097 10771945 6630018 3711285 1883569 863887 356363 131627 43325 12574 3196 706 130 23 4 0 0 0 0 0 0
result:
ok 47 numbers
Test #60:
score: 30
Accepted
time: 11ms
memory: 9596kb
input:
19 165 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 2 3 2 4 2 5 2 6 2 7 2 8 2 9 2 10 2 11 2 12 2 13 2 14 2 15 2 16 2 17 2 18 2 19 3 4 3 5 3 6 3 7 3 8 3 9 3 10 3 11 3 12 3 13 3 15 3 16 3 17 3 18 3 19 4 5 4 6 4 7 4 8 4 9 4 10 4 11 4 12 4 13 4 14 4 15 4 16 4 17 4 18...
output:
1 0 0 869 10054 116300 1665548 22002410 272568948 266276759 590975839 505433121 931718607 637641747 630197306 503102357 886192153 214442410 462021917 885135130 858519812 765904823 482181368 833822320 931146031 813024359 500687451 371872217 385217126 337681735 890581817 79345549 863682684 802694660 8...
result:
ok 166 numbers
Test #61:
score: 30
Accepted
time: 0ms
memory: 8288kb
input:
16 118 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 2 3 2 4 2 5 2 6 2 7 2 8 2 9 2 10 2 11 2 12 2 13 2 14 2 15 2 16 3 4 3 5 3 6 3 8 3 9 3 10 3 11 3 12 3 13 3 14 3 15 3 16 4 5 4 6 4 7 4 8 4 9 4 10 4 11 4 12 4 13 4 14 4 15 4 16 5 6 5 7 5 8 5 9 5 10 5 11 5 12 5 13 5 14 5 15 5 16 6 ...
output:
1 0 0 532 5098 48096 564456 6027164 59441272 561142208 29160717 526869910 89823977 271672123 744838240 258573945 914414943 733960178 111036700 152120847 315329135 888999602 288050693 400611365 795188604 503728919 540041171 203079278 670318060 529062595 883090974 155424280 976986672 403186947 8949760...
result:
ok 119 numbers
Test #62:
score: 30
Accepted
time: 1ms
memory: 8088kb
input:
12 50 1 2 1 3 1 4 1 5 1 9 1 10 1 11 1 12 2 4 2 5 2 8 2 9 2 10 2 12 3 4 3 5 3 6 3 7 3 8 3 9 3 10 3 11 4 5 4 6 4 7 4 8 4 10 4 11 4 12 5 6 5 7 5 8 5 9 5 10 5 11 5 12 6 7 6 10 6 11 6 12 7 8 7 9 8 9 8 11 9 10 9 11 9 12 10 11 10 12 11 12
output:
1 0 0 96 476 2254 13481 69784 318757 1352740 5262122 18562920 59439842 172867942 456588561 96768345 401835332 807690260 817901856 852711934 19432959 878767580 332371493 746801508 339516645 717450541 350592895 762071748 342848751 879839932 13138697 844426110 812129845 806088980 403324938 99173625 458...
result:
ok 51 numbers
Test #63:
score: 30
Accepted
time: 0ms
memory: 6088kb
input:
16 64 1 2 1 4 1 5 1 7 1 8 1 10 1 11 2 4 2 5 2 8 2 9 2 10 2 11 2 13 2 14 3 4 3 6 3 7 3 11 3 13 3 14 3 15 3 16 4 7 4 8 4 11 4 15 4 16 5 6 5 7 5 11 5 12 5 13 5 14 5 16 6 7 6 8 6 9 6 10 6 12 6 13 6 14 6 15 6 16 7 8 7 9 7 11 7 12 7 14 7 15 8 10 8 11 8 14 9 10 9 11 9 12 9 13 10 12 10 13 10 15 12 13 12 15 ...
output:
1 0 0 84 390 1938 12290 67439 341509 1655311 7536225 32064649 127500700 472812664 632267153 241238767 646621452 425063089 92639242 318373511 900000596 965068668 239861185 149714042 232248387 185697272 595357461 554914837 674296784 819915816 965094125 394744367 30798848 776864470 845388044 874631865 ...
result:
ok 65 numbers
Test #64:
score: 30
Accepted
time: 1ms
memory: 6068kb
input:
13 78 1 2 1 3 1 4 1 5 1 6 1 7 1 8 1 9 1 10 1 11 1 12 1 13 2 3 2 4 2 5 2 6 2 7 2 8 2 9 2 10 2 11 2 12 2 13 3 4 3 5 3 6 3 7 3 8 3 9 3 10 3 11 3 12 3 13 4 5 4 6 4 7 4 8 4 9 4 10 4 11 4 12 4 13 5 6 5 7 5 8 5 9 5 10 5 11 5 12 5 13 6 7 6 8 6 9 6 10 6 11 6 12 6 13 7 8 7 9 7 10 7 11 7 12 7 13 8 9 8 10 8 11 ...
output:
1 0 0 286 2145 15444 139425 1119690 8091369 55000660 348240321 35495552 982387346 703789158 508852268 245623548 861681658 789672282 919985699 481818958 78345812 126679866 730240962 990550317 729739768 321231977 568449449 626094595 354581946 910929169 813369076 238868013 442353493 841961345 49618718 ...
result:
ok 79 numbers
Test #65:
score: 30
Accepted
time: 1ms
memory: 5984kb
input:
10 41 1 2 1 3 1 4 1 5 1 6 1 7 1 8 1 9 1 10 2 3 2 4 2 5 2 7 2 8 2 10 3 4 3 5 3 6 3 7 3 8 3 9 3 10 4 5 4 6 4 7 4 8 4 10 5 6 5 7 5 8 5 9 5 10 6 7 6 8 6 10 7 8 7 9 7 10 8 9 8 10 9 10
output:
1 0 0 92 441 1902 10420 48580 191384 681732 2179316 6152116 15392616 34392252 68871684 123966484 201349538 296077492 394806020 477837596 525472738 525490648 477878300 394868428 296155504 201376076 123905116 68789628 34357536 15401892 6177324 2201180 689749 188668 44716 8792 1245 90 0 0 0 0
result:
ok 42 numbers
Test #66:
score: 30
Accepted
time: 3ms
memory: 10436kb
input:
19 68 1 2 1 6 1 7 1 9 1 13 1 18 1 19 2 3 2 5 2 7 2 13 2 16 2 17 2 18 3 6 3 12 3 13 3 15 3 16 3 19 4 8 4 9 4 10 4 12 4 15 5 7 5 9 5 10 5 12 5 14 5 15 6 8 6 12 6 15 7 8 7 9 7 11 7 14 7 16 8 11 8 12 8 13 8 15 8 17 9 11 9 15 9 16 9 17 10 11 10 13 10 14 10 15 10 16 11 14 11 16 12 14 12 18 12 19 13 18 14 ...
output:
1 0 0 45 233 1085 5526 28640 139192 635650 2783193 11609014 45844744 171217430 603597469 4492794 261236999 371652378 587221088 640570357 321342931 83542425 656812192 897692440 960335080 633315390 244886039 160159774 811004280 260079571 503436768 182717096 455548472 469255874 676228776 933441841 9067...
result:
ok 69 numbers
Test #67:
score: 30
Accepted
time: 2ms
memory: 6212kb
input:
16 106 1 3 1 4 1 5 1 6 1 7 1 8 1 9 1 10 1 11 1 12 1 14 1 15 1 16 2 3 2 4 2 5 2 6 2 7 2 8 2 10 2 11 2 12 2 13 2 14 2 15 2 16 3 4 3 5 3 6 3 7 3 8 3 9 3 10 3 11 3 12 3 13 3 14 3 15 3 16 4 5 4 6 4 7 4 8 4 9 4 11 4 12 4 13 4 15 4 16 5 6 5 7 5 8 5 9 5 10 5 11 5 12 5 13 5 14 5 15 5 16 6 7 6 8 6 9 6 11 6 12...
output:
1 0 0 387 3326 28085 294791 2811467 24726620 207891233 657255378 448539547 58719624 125270211 68339456 931118040 997960011 519377340 227196840 268384861 307562586 689877475 301251412 832830017 966081263 834678169 179034420 724572158 530405354 452455545 544800322 912157900 441456470 384863172 6632482...
result:
ok 107 numbers
Test #68:
score: 30
Accepted
time: 4ms
memory: 10140kb
input:
18 64 1 2 1 4 1 5 1 11 1 14 1 16 1 18 2 6 2 9 2 14 2 16 2 18 3 4 3 8 3 11 3 17 3 18 4 5 4 6 4 7 4 8 4 11 4 12 4 13 4 18 5 7 5 8 5 11 5 13 5 15 5 18 6 7 6 9 6 12 6 14 6 15 6 17 7 11 7 13 7 14 7 18 8 11 8 12 8 14 8 15 9 10 9 11 9 14 9 18 10 11 10 12 10 13 10 15 10 17 11 12 11 16 12 14 12 15 12 18 13 1...
output:
1 0 0 55 255 1142 6276 31875 148819 662681 2799478 11135239 41677536 146587320 483610746 494881279 325395779 706956629 627655603 102871149 102768114 8332047 827489903 159054005 367702947 627556786 88243324 866252685 448814953 173173497 423140862 350611366 495684474 209696434 893454347 798906620 5949...
result:
ok 65 numbers
Test #69:
score: 30
Accepted
time: 2ms
memory: 6540kb
input:
17 59 1 2 1 3 1 5 1 6 1 7 1 8 1 10 1 12 1 14 1 16 1 17 2 4 2 7 2 8 2 9 2 12 2 14 3 4 3 6 3 8 3 10 3 11 3 14 3 15 3 17 4 10 4 11 4 13 4 14 4 17 5 8 5 11 5 13 5 15 5 16 6 7 6 11 6 12 6 13 6 14 7 9 7 13 7 14 7 17 8 17 9 11 9 14 9 15 9 17 10 14 11 12 11 17 12 13 12 15 13 15 14 15 14 17 15 16 16 17
output:
1 0 0 51 229 1035 5272 24986 111591 468158 1848449 6872670 23942637 77983218 237252591 673260194 780187495 383670898 50476389 453779862 645941598 968751579 278875637 294913943 234947167 435401505 59276406 955076102 57233471 625202635 593934837 960193952 794270799 865164751 269719211 156686342 321068...
result:
ok 60 numbers
Test #70:
score: 30
Accepted
time: 1ms
memory: 6044kb
input:
14 79 1 2 1 3 1 4 1 5 1 7 1 8 1 9 1 10 1 11 1 12 1 13 2 3 2 4 2 5 2 6 2 8 2 9 2 10 2 11 2 12 2 13 2 14 3 4 3 5 3 6 3 7 3 8 3 9 3 10 3 11 3 12 3 13 3 14 4 5 4 6 4 7 4 9 4 10 4 11 4 12 4 13 4 14 5 6 5 7 5 8 5 9 5 10 5 11 5 12 5 13 6 7 6 8 6 9 6 12 6 13 6 14 7 8 7 9 7 10 7 12 7 13 7 14 8 9 8 11 8 12 8 ...
output:
1 0 0 235 1668 11505 98967 762400 5337286 35341480 219228572 264132287 772232630 684733185 429258043 330803761 153812272 731996648 600855005 511947008 317873201 986392280 916942216 32823818 307430883 243654527 348517247 568373196 798915517 486892676 897955714 697793915 530976524 56572294 261315045 9...
result:
ok 80 numbers
Subtask #5:
score: 35
Accepted
Dependency #4:
100%
Accepted
Test #71:
score: 35
Accepted
time: 47ms
memory: 22404kb
input:
22 140 1 2 1 3 1 7 1 9 1 11 1 14 1 16 1 17 1 19 1 20 1 21 1 22 2 3 2 4 2 5 2 6 2 9 2 10 2 12 2 13 2 14 2 16 2 17 2 19 2 20 2 21 3 4 3 5 3 7 3 10 3 11 3 12 3 13 3 14 3 15 3 17 3 19 3 20 4 6 4 8 4 11 4 14 4 15 4 16 4 17 4 18 4 19 4 21 4 22 5 8 5 9 5 10 5 11 5 12 5 13 5 17 5 18 5 20 5 21 5 22 6 8 6 10 ...
output:
1 0 0 335 2863 24609 259936 2555382 23739356 214218237 866654424 644248127 14323561 687297272 747591530 210535395 55791321 407881455 916253643 746579852 372053120 735371553 74022656 793010510 231755889 346527767 620887138 420247609 197970936 763107535 207212385 242393553 847932309 558259565 29848345...
result:
ok 141 numbers
Test #72:
score: 35
Accepted
time: 227ms
memory: 73600kb
input:
24 205 1 2 1 3 1 4 1 6 1 9 1 10 1 11 1 12 1 13 1 14 1 19 1 21 1 22 1 23 2 3 2 4 2 5 2 6 2 7 2 10 2 12 2 13 2 14 2 15 2 17 2 19 2 20 2 22 2 23 2 24 3 4 3 5 3 6 3 7 3 9 3 10 3 11 3 12 3 13 3 15 3 16 3 17 3 18 3 20 3 21 3 22 3 23 4 6 4 8 4 9 4 10 4 13 4 14 4 16 4 18 4 19 4 20 4 22 4 23 4 24 5 6 5 8 5 9...
output:
1 0 0 810 9436 111415 1614647 21909912 282938060 568188695 686848205 420941904 734318373 29937959 467750645 134246289 555505884 408145122 162822060 14086303 859143504 662235981 893640560 553728798 413077574 764055719 813843255 968683764 139283059 118496774 31446805 642857915 174025017 146652666 4261...
result:
ok 206 numbers
Test #73:
score: 35
Accepted
time: 55ms
memory: 24452kb
input:
22 192 1 2 1 4 1 5 1 6 1 7 1 8 1 9 1 10 1 11 1 13 1 14 1 15 1 16 1 17 1 18 1 19 1 20 1 22 2 3 2 4 2 5 2 6 2 7 2 8 2 9 2 10 2 11 2 12 2 13 2 14 2 15 2 17 2 18 2 19 2 20 2 21 2 22 3 4 3 5 3 6 3 7 3 9 3 10 3 11 3 12 3 13 3 14 3 15 3 16 3 17 3 18 3 19 3 20 3 21 3 22 4 6 4 7 4 8 4 9 4 10 4 11 4 12 4 14 4...
output:
1 0 0 902 10659 127403 1883086 25823835 334829863 225101297 534094320 125751971 595179621 253916254 704699710 161283393 362655492 892098835 631824187 483091502 258781522 310036194 497693532 95374870 145290828 321706816 445053043 152756108 712329946 699230999 448895446 820771369 653294827 20699235 67...
result:
ok 193 numbers
Test #74:
score: 35
Accepted
time: 99ms
memory: 40840kb
input:
23 89 1 4 1 8 1 9 1 18 1 20 1 21 1 22 2 9 2 11 2 17 2 22 2 23 3 5 3 6 3 7 3 8 3 11 3 16 3 18 4 6 4 8 4 9 4 13 4 15 4 16 4 18 4 21 5 7 5 10 5 13 5 16 5 17 5 18 5 19 5 21 6 7 6 11 6 16 6 20 6 22 7 8 7 10 7 16 7 18 7 20 7 21 7 22 7 23 8 10 8 11 8 12 8 13 8 16 8 19 8 20 8 21 8 23 9 17 9 20 10 12 10 13 1...
output:
1 0 0 83 428 2264 14456 84726 468340 2498737 12788962 62613524 293126448 311565603 605064327 865673497 8596704 509166639 350070434 215965803 12732204 497931932 599459218 432922848 221673278 110037523 249904887 639954509 508708205 774110766 588298113 331230571 217618292 356053820 343294334 996885949 ...
result:
ok 90 numbers
Test #75:
score: 35
Accepted
time: 113ms
memory: 38792kb
input:
23 250 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 2 3 2 4 2 5 2 6 2 7 2 8 2 9 2 10 2 11 2 12 2 13 2 14 2 15 2 16 2 17 2 18 2 19 2 20 2 21 2 22 2 23 3 4 3 5 3 6 3 7 3 8 3 9 3 10 3 11 3 12 3 13 3 14 3 15 3 16 3 17 3 18 3 19 3 20 3 21 3 22 3 23...
output:
1 0 0 1708 25311 380076 7039834 121706968 998351266 27323184 876025873 651986714 356216434 473910370 496177761 254395496 749916681 352501433 183658713 637856159 753002429 898339938 573765844 904712257 127108278 679162205 458225286 582370987 204489388 569369305 62929151 599929920 477742111 403886248 ...
result:
ok 251 numbers
Test #76:
score: 35
Accepted
time: 20ms
memory: 14240kb
input:
21 43 1 4 1 7 1 21 2 9 2 11 2 16 2 18 3 8 3 11 3 14 3 15 3 17 3 20 4 5 4 6 4 12 5 7 5 11 5 12 5 21 6 10 6 11 6 15 6 21 7 19 8 11 8 12 8 14 8 15 8 17 9 14 9 20 10 17 11 12 11 13 11 16 13 14 13 16 15 20 15 21 16 21 19 20 20 21
output:
1 0 0 12 28 61 204 628 1518 3570 8381 18024 36520 69773 123974 207326 324572 471058 635243 795238 920988 984023 964080 862528 703642 519902 344739 204228 107744 50271 20446 7118 2139 542 85 2 0 0 0 0 0 0 0 0
result:
ok 44 numbers
Test #77:
score: 35
Accepted
time: 43ms
memory: 22412kb
input:
22 3 1 21 10 12 16 21
output:
1 0 0 0
result:
ok 4 number(s): "1 0 0 0"
Test #78:
score: 35
Accepted
time: 46ms
memory: 22444kb
input:
22 35 1 13 1 14 2 7 2 21 3 13 3 19 4 10 4 13 4 15 5 17 5 18 5 20 6 10 6 12 6 17 6 22 7 11 7 13 8 13 8 15 8 16 9 13 10 11 10 15 10 19 12 13 15 22 16 17 16 18 17 18 17 21 19 20 19 22 20 22 21 22
output:
1 0 0 4 6 10 31 56 107 213 353 584 881 1222 1549 1788 2044 2104 1849 1468 1013 600 312 132 44 11 2 0 0 0 0 0 0 0 0 0
result:
ok 36 numbers
Test #79:
score: 35
Accepted
time: 104ms
memory: 40856kb
input:
23 187 1 2 1 4 1 6 1 7 1 8 1 9 1 11 1 13 1 15 1 16 1 18 1 19 1 20 1 21 1 22 1 23 2 3 2 4 2 5 2 7 2 8 2 9 2 10 2 13 2 15 2 17 2 18 2 19 2 20 2 21 2 22 2 23 3 4 3 5 3 6 3 7 3 8 3 9 3 13 3 14 3 15 3 16 3 17 3 19 3 20 3 21 4 5 4 6 4 7 4 9 4 10 4 11 4 13 4 14 4 15 4 16 4 17 4 20 4 21 4 22 4 23 5 6 5 7 5 ...
output:
1 0 0 715 7964 89191 1226396 15759935 191980683 277406880 159309743 842104472 930825904 306107723 447369643 61572669 956564226 822955774 75254062 314741296 283550808 352153618 765438366 56730084 812162855 879295133 937445756 708050219 108422649 981982777 647708312 163263067 546512948 556425775 60434...
result:
ok 188 numbers
Test #80:
score: 35
Accepted
time: 51ms
memory: 22412kb
input:
22 184 1 2 1 3 1 6 1 7 1 9 1 10 1 13 1 14 1 16 1 17 1 18 1 19 1 20 1 21 1 22 2 3 2 5 2 6 2 7 2 9 2 10 2 11 2 12 2 14 2 15 2 16 2 18 2 19 2 20 2 21 3 5 3 6 3 7 3 8 3 9 3 10 3 11 3 12 3 13 3 14 3 15 3 17 3 18 3 19 3 21 3 22 4 5 4 7 4 8 4 11 4 14 4 15 4 16 4 17 4 18 4 19 4 20 4 21 4 22 5 6 5 7 5 8 5 9 ...
output:
1 0 0 778 8798 100554 1417579 18576367 230333512 779359707 422887737 197677981 995856148 964401661 932105173 824522455 857369899 817174205 998818977 195795133 56266026 992085859 860381356 794129662 100624964 644275954 322886852 978919307 223734212 175174730 356824566 125596102 568563262 634259085 63...
result:
ok 185 numbers
Test #81:
score: 35
Accepted
time: 221ms
memory: 71432kb
input:
24 71 1 3 1 9 1 10 1 23 2 5 2 7 2 12 3 9 3 10 3 12 3 15 3 17 3 20 3 21 4 5 4 9 4 11 4 16 4 17 4 18 5 14 5 17 6 8 6 20 6 22 6 24 7 12 8 14 8 15 8 17 8 20 9 11 9 13 9 17 9 18 10 16 10 17 10 19 10 23 10 24 11 17 11 19 11 22 12 14 12 16 12 20 12 23 12 24 13 18 13 21 13 23 13 24 14 16 14 21 14 22 14 23 1...
output:
1 0 0 37 135 521 2625 11708 48656 197613 770584 2863879 10156061 34323427 110358182 337219016 978573965 695131002 41609195 448863130 2961924 366413052 55406432 837212754 121285169 971949367 167694277 320869412 465223811 401372775 976354360 358620752 80230947 18755041 680406917 255426874 313838244 21...
result:
ok 72 numbers
Test #82:
score: 35
Accepted
time: 233ms
memory: 71564kb
input:
24 59 1 4 1 10 1 16 1 17 1 19 2 11 2 14 2 16 2 23 3 6 3 11 3 12 3 16 3 20 3 23 4 11 4 13 4 14 4 16 4 23 5 7 5 16 5 21 6 8 6 12 6 20 7 11 7 16 7 18 7 22 7 23 8 10 8 12 8 20 8 22 9 14 9 18 10 11 10 14 10 24 11 12 11 15 11 16 11 24 12 15 12 24 13 18 13 22 14 18 15 16 15 17 15 19 15 22 16 18 16 23 19 21...
output:
1 0 0 22 77 194 754 2950 9299 28838 89194 258883 713941 1888312 4759717 11403952 25975457 56186820 115211375 223685605 410806221 712785596 167168681 802107069 621282468 589078575 623143836 599964419 375812884 820542174 853415812 465988174 724452356 751919524 695167285 688284186 826872716 157575051 6...
result:
ok 60 numbers
Test #83:
score: 35
Accepted
time: 26ms
memory: 14160kb
input:
21 172 1 2 1 3 1 4 1 8 1 9 1 10 1 11 1 12 1 14 1 15 1 16 1 18 1 19 1 20 1 21 2 4 2 5 2 6 2 7 2 8 2 9 2 10 2 11 2 12 2 13 2 15 2 17 2 18 2 19 3 4 3 5 3 7 3 8 3 9 3 11 3 12 3 13 3 14 3 15 3 17 3 18 3 19 3 20 3 21 4 5 4 6 4 8 4 9 4 10 4 11 4 12 4 13 4 14 4 15 4 16 4 17 4 18 4 19 4 20 5 7 5 8 5 9 5 11 5...
output:
1 0 0 724 7952 88056 1204550 15277274 182876480 126966757 871261761 430739380 48200128 979199839 654448249 692736241 368143100 413275616 968135454 927565472 825481367 708625047 925947230 744829159 29191520 660221310 950699293 411572748 711262282 990791959 894972908 28927246 821591446 456053913 56513...
result:
ok 173 numbers
Test #84:
score: 35
Accepted
time: 47ms
memory: 22412kb
input:
22 9 2 14 2 19 6 15 8 16 9 11 10 18 11 12 11 18 11 19
output:
1 0 0 0 0 0 0 0 0 0
result:
ok 10 numbers
Test #85:
score: 35
Accepted
time: 44ms
memory: 22456kb
input:
22 8 1 4 2 5 4 17 4 19 6 21 9 12 9 14 13 15
output:
1 0 0 0 0 0 0 0 0
result:
ok 9 numbers
Test #86:
score: 35
Accepted
time: 236ms
memory: 73476kb
input:
24 183 1 4 1 5 1 6 1 8 1 9 1 10 1 11 1 12 1 13 1 14 1 15 1 17 1 18 1 20 1 21 1 22 1 23 2 3 2 4 2 6 2 7 2 8 2 11 2 12 2 15 2 17 2 18 2 19 2 20 2 22 3 5 3 6 3 8 3 11 3 12 3 13 3 15 3 16 3 17 3 20 3 21 3 22 3 24 4 6 4 8 4 9 4 10 4 11 4 12 4 14 4 16 4 18 4 19 4 20 4 21 4 22 4 24 5 6 5 9 5 10 5 11 5 13 5...
output:
1 0 0 595 6197 65409 850494 10320551 118902097 336446995 564994957 328646730 357382321 944542385 543896512 18588252 152364058 727808632 815839431 287084437 710690803 208651858 584328053 278159775 831855757 753139037 445967362 764170469 394669569 290122405 66273500 499335634 409567286 1978195 6476486...
result:
ok 184 numbers
Test #87:
score: 35
Accepted
time: 105ms
memory: 38788kb
input:
23 35 1 2 1 10 1 23 2 7 2 13 2 16 3 16 3 21 4 15 4 21 4 22 5 7 5 8 5 13 7 9 8 22 9 17 9 21 10 23 11 20 11 22 12 13 12 17 13 16 13 19 14 15 14 17 14 19 15 18 15 19 15 20 15 21 16 18 16 23 19 22
output:
1 0 0 4 3 12 20 30 86 135 215 387 559 785 1070 1333 1613 1773 1760 1691 1501 1197 886 609 380 192 81 42 17 2 0 0 0 0 0 0
result:
ok 36 numbers
Test #88:
score: 35
Accepted
time: 501ms
memory: 135720kb
input:
25 145 1 2 1 7 1 8 1 10 1 11 1 14 1 19 1 22 2 3 2 4 2 6 2 14 2 16 2 18 2 20 2 21 2 23 3 5 3 6 3 11 3 13 3 15 3 17 3 18 3 19 3 21 4 5 4 6 4 11 4 12 4 14 4 18 4 19 4 20 4 21 4 23 4 24 5 6 5 7 5 9 5 10 5 11 5 13 5 15 5 16 5 17 5 18 5 25 6 7 6 8 6 11 6 14 6 15 6 16 6 18 6 23 6 24 6 25 7 10 7 20 7 24 8 9...
output:
1 0 0 254 1995 16102 157616 1441419 12574917 106963725 881896271 27866160 95984882 824639175 671340357 664038218 974196318 232351488 279203446 282627533 509182967 30384561 503391447 475867989 463395236 627346295 643539273 366451486 442842178 764971741 309242397 806532977 300690619 707508537 18936468...
result:
ok 146 numbers
Test #89:
score: 35
Accepted
time: 227ms
memory: 71436kb
input:
24 22 1 6 1 10 1 12 1 16 1 21 2 7 2 16 3 20 4 22 5 11 5 19 10 15 10 20 10 23 11 22 12 13 12 15 13 22 14 15 15 24 16 22 21 24
output:
1 0 0 0 1 3 0 1 1 0 1 0 0 0 0 0 0 0 0 0 0 0 0
result:
ok 23 numbers
Test #90:
score: 35
Accepted
time: 24ms
memory: 14220kb
input:
21 159 1 4 1 7 1 8 1 11 1 12 1 14 1 15 1 16 1 18 1 19 1 20 1 21 2 3 2 4 2 6 2 7 2 9 2 10 2 11 2 12 2 13 2 14 2 16 2 17 2 18 2 19 2 20 2 21 3 4 3 5 3 6 3 7 3 8 3 9 3 10 3 12 3 14 3 16 3 17 3 19 3 20 3 21 4 5 4 6 4 7 4 8 4 9 4 10 4 11 4 12 4 13 4 14 4 16 4 17 4 18 4 21 5 7 5 8 5 10 5 11 5 12 5 13 5 14...
output:
1 0 0 581 5940 60855 768740 9006876 99432221 64961067 994841741 956029552 837517084 551839919 599658165 387740682 739259640 658677843 188797236 272724309 809111922 816520475 568588434 405540625 681970279 796791242 980836470 261943300 290850874 264053535 346702534 702258237 49469161 756425093 3919533...
result:
ok 160 numbers
Test #91:
score: 35
Accepted
time: 94ms
memory: 38740kb
input:
23 45 1 3 1 10 1 13 1 14 1 22 2 4 2 11 3 9 3 13 3 16 3 17 4 7 4 8 4 18 4 20 5 10 5 18 5 21 5 22 6 15 7 8 7 9 7 18 7 19 8 12 8 13 9 14 9 17 9 20 9 22 10 13 10 23 11 19 11 20 11 23 13 15 13 19 16 18 16 21 16 22 17 23 18 21 18 23 19 21 21 23
output:
1 0 0 8 20 40 152 444 1062 2741 6663 14955 31784 63553 118602 204624 327584 485135 658237 819887 939664 987007 949652 838260 678266 501563 337297 206169 114856 57911 26218 10688 3903 1249 331 69 12 1 0 0 0 0 0 0 0 0
result:
ok 46 numbers
Test #92:
score: 35
Accepted
time: 234ms
memory: 71560kb
input:
24 117 1 6 1 9 1 12 1 13 1 15 1 17 1 18 1 20 2 4 2 5 2 7 2 8 2 9 2 10 2 11 2 12 2 14 2 16 2 17 2 19 2 23 3 4 3 7 3 11 3 17 3 18 4 10 4 12 4 13 4 14 4 15 4 18 4 19 4 21 4 24 5 6 5 8 5 9 5 10 5 11 5 15 5 17 5 18 6 12 6 14 6 16 6 17 6 19 6 21 6 24 7 10 7 11 7 15 7 16 7 17 7 18 7 19 7 20 7 21 7 22 8 11 ...
output:
1 0 0 146 956 6479 52438 397004 2870207 20159037 136838382 895349360 640141805 163216552 747436422 371437958 54849395 121339968 16427752 579904340 757790606 263378547 777142820 364928840 247042816 232877096 104919506 128397494 822291786 272820085 636387019 391244433 104749161 957206964 970020336 527...
result:
ok 118 numbers
Test #93:
score: 35
Accepted
time: 503ms
memory: 135000kb
input:
25 15 1 21 2 10 2 19 3 12 4 8 5 6 5 24 6 25 8 10 10 17 11 19 11 22 12 15 13 17 14 21
output:
1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
result:
ok 16 numbers
Test #94:
score: 35
Accepted
time: 97ms
memory: 38724kb
input:
23 28 1 5 2 7 2 10 2 14 3 6 3 7 3 9 3 23 4 8 4 11 4 12 4 18 5 9 6 10 6 17 7 8 7 20 8 14 8 18 8 22 10 12 10 13 11 18 12 16 14 20 15 19 17 20 17 23
output:
1 0 0 2 5 3 4 18 24 22 32 46 41 31 20 6 1 0 0 0 0 0 0 0 0 0 0 0 0
result:
ok 29 numbers
Test #95:
score: 35
Accepted
time: 25ms
memory: 16072kb
input:
21 105 1 2 1 4 1 6 1 7 1 9 1 10 1 11 1 12 1 14 1 15 1 16 1 18 1 20 2 4 2 5 2 6 2 7 2 11 2 15 2 19 2 21 3 9 3 10 3 12 3 13 3 14 3 15 3 20 3 21 4 6 4 9 4 10 4 12 4 13 4 16 4 17 4 19 5 8 5 10 5 12 5 14 5 17 5 19 5 20 6 7 6 8 6 10 6 12 6 16 6 17 6 18 6 19 7 9 7 10 7 11 7 12 7 16 7 17 7 18 7 19 8 12 8 15...
output:
1 0 0 186 1271 8479 70280 536127 3802466 26007755 170598549 67694873 376721423 338759655 459695637 618789614 833244042 727009431 972209171 487660555 396541771 135034318 415985157 719257038 47903600 401585126 736137844 828339698 422676134 240668899 893645289 190545539 883317280 52093944 54142563 1241...
result:
ok 106 numbers
Test #96:
score: 35
Accepted
time: 493ms
memory: 135648kb
input:
25 129 1 3 1 4 1 5 1 7 1 8 1 10 1 11 1 12 1 15 1 20 1 23 1 25 2 3 2 9 2 10 2 11 2 13 2 14 2 15 2 21 3 5 3 7 3 8 3 11 3 15 3 17 3 18 3 22 3 23 3 25 4 5 4 9 4 11 4 13 4 17 4 18 4 19 4 21 4 22 4 23 4 25 5 8 5 13 5 14 5 15 5 16 5 18 5 21 5 24 5 25 6 7 6 8 6 10 6 17 6 18 6 19 6 23 6 24 7 8 7 9 7 10 7 12 ...
output:
1 0 0 162 1212 8385 70849 574756 4410893 32919997 238568331 671540527 310472789 852966304 902617012 885594374 374749021 566397058 788336980 134074096 297087711 399270472 443947611 213707904 781403082 650136901 448818929 956152494 613289362 178597858 809056431 113750974 132464991 217267998 813015094 ...
result:
ok 130 numbers
Test #97:
score: 35
Accepted
time: 234ms
memory: 71580kb
input:
24 162 1 2 1 3 1 5 1 6 1 7 1 8 1 11 1 12 1 13 1 15 1 16 1 17 1 20 1 21 1 22 1 24 2 3 2 4 2 5 2 6 2 7 2 9 2 10 2 14 2 16 2 17 2 18 2 19 2 24 3 4 3 8 3 10 3 11 3 12 3 13 3 14 3 15 3 18 3 20 3 22 3 24 4 5 4 6 4 7 4 9 4 10 4 11 4 13 4 14 4 15 4 16 4 17 4 18 4 23 4 24 5 7 5 10 5 11 5 14 5 16 5 18 5 19 5 ...
output:
1 0 0 427 3880 36246 420098 4501844 45745638 453445928 351246943 271443496 361026448 316439101 99086813 154297146 361752527 164755711 429441993 466877266 312126864 242383040 288236137 424187782 537371270 769651471 860071101 889539316 159880468 986776252 226119450 114175947 89361412 461804285 1847967...
result:
ok 163 numbers
Test #98:
score: 35
Accepted
time: 235ms
memory: 71568kb
input:
24 107 1 5 1 6 1 7 1 9 1 11 1 12 1 13 1 14 1 15 1 16 1 17 2 7 2 8 2 12 2 13 2 19 2 20 2 24 3 6 3 12 3 15 3 17 3 24 4 5 4 6 4 8 4 9 4 10 4 16 4 21 4 23 5 6 5 12 5 17 5 22 6 7 6 8 6 9 6 14 6 21 6 22 7 10 7 12 7 22 7 24 8 12 8 13 8 14 8 21 8 22 8 23 9 10 9 12 9 13 9 16 9 20 9 21 9 22 10 11 10 13 10 16 ...
output:
1 0 0 122 724 4372 33124 228399 1488809 9469126 58052722 341980386 936513409 528714438 901426143 354004871 976754692 916366635 306103745 393282201 420348677 509809240 840384391 48195009 993555120 550547007 372926331 850430675 817648689 733709850 393737390 79921297 442698789 929714906 560468483 19314...
result:
ok 108 numbers
Test #99:
score: 35
Accepted
time: 43ms
memory: 22412kb
input:
22 111 1 3 1 4 1 6 1 12 1 18 1 20 1 21 2 3 2 6 2 10 2 11 2 13 2 16 2 18 2 20 2 22 3 6 3 8 3 10 3 11 3 15 3 17 3 18 3 19 3 22 4 5 4 8 4 9 4 10 4 12 4 14 4 15 4 16 4 17 4 19 4 20 4 21 4 22 5 6 5 10 5 15 5 16 5 18 5 21 5 22 6 7 6 11 6 16 6 17 6 20 7 10 7 12 7 14 7 15 7 18 7 20 8 9 8 10 8 13 8 14 8 15 8...
output:
1 0 0 173 1208 8295 69234 539334 3952063 27970947 190328681 240279115 734339544 121804284 794714849 782076428 241207821 336438444 212065571 747901886 911690384 512311646 552674901 333397550 379689353 49560860 939118151 759291392 785675914 825846442 943519994 653988477 439561183 864921756 786885518 5...
result:
ok 112 numbers
Test #100:
score: 35
Accepted
time: 42ms
memory: 22424kb
input:
22 38 1 17 2 7 2 16 2 19 2 20 3 11 3 13 3 18 3 19 3 22 4 11 4 17 4 18 4 19 5 18 5 21 6 12 6 13 6 19 7 11 7 13 7 16 7 21 7 22 8 22 9 13 9 15 10 11 10 14 10 15 10 19 11 15 12 15 12 19 13 15 13 22 15 16 17 18
output:
1 0 0 7 15 36 100 234 488 986 1825 3095 4958 7356 10037 12620 14649 15748 15474 13765 11035 7852 4998 2938 1598 786 333 109 24 4 1 0 0 0 0 0 0 0 0
result:
ok 39 numbers
Test #101:
score: 35
Accepted
time: 247ms
memory: 73656kb
input:
24 265 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 2 3 2 4 2 5 2 6 2 7 2 8 2 9 2 10 2 11 2 12 2 13 2 14 2 15 2 16 2 17 2 18 2 19 2 20 2 21 2 22 2 23 2 24 3 4 3 5 3 6 3 8 3 9 3 10 3 11 3 12 3 13 3 14 3 15 3 16 3 17 3 18 3 19 3 20 3 22 3 2...
output:
1 0 0 1793 27105 416208 7877405 139434513 349063609 687744375 54131031 222365580 391201913 348381156 927992654 266428691 400996302 861944213 465958955 442875141 294370433 405585819 45690304 250446197 515810241 875907960 120090431 836791697 169925713 12931355 404667449 320892850 946983689 14409254 15...
result:
ok 266 numbers
Test #102:
score: 35
Accepted
time: 501ms
memory: 136108kb
input:
25 263 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 2 5 2 6 2 8 2 9 2 10 2 11 2 12 2 13 2 15 2 18 2 20 2 21 2 23 2 25 3 4 3 5 3 6 3 7 3 8 3 9 3 10 3 11 3 12 3 13 3 14 3 15 3 16 3 17 3 18 3 20 3 21 3 23 3 24 3 25 4 5 4 6 4 7 4 8 4 9 4...
output:
1 0 0 1571 22745 335191 6087135 103456317 675604441 554512024 259749071 697819487 991733791 913603092 481324648 675863498 374922011 938052846 636610866 603834151 205910994 514198626 746009584 566866449 797937841 399533661 921972091 962682442 724610487 687125686 357460988 572112755 536273983 42912321...
result:
ok 264 numbers
Test #103:
score: 35
Accepted
time: 236ms
memory: 73600kb
input:
24 245 1 2 1 3 1 4 1 5 1 6 1 7 1 8 1 9 1 10 1 11 1 12 1 14 1 15 1 16 1 17 1 18 1 19 1 20 1 21 1 23 2 3 2 4 2 5 2 6 2 7 2 9 2 10 2 11 2 12 2 13 2 14 2 15 2 16 2 17 2 19 2 20 2 21 2 22 2 23 2 24 3 4 3 5 3 6 3 8 3 9 3 10 3 11 3 12 3 13 3 14 3 15 3 16 3 17 3 18 3 19 3 20 3 21 3 22 3 23 3 24 4 5 4 6 4 7 ...
output:
1 0 0 1405 19566 277090 4834925 78873791 224797667 591903505 159764410 210284493 901918414 141105487 944978948 103343344 328983327 624103978 35307865 538318552 373537834 734841991 466213664 846061874 513922586 469836075 91168868 301303168 800195740 628307464 178653266 715468211 237135481 658926589 4...
result:
ok 246 numbers
Test #104:
score: 35
Accepted
time: 46ms
memory: 24468kb
input:
22 208 1 2 1 3 1 4 1 5 1 6 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 2 3 2 4 2 5 2 6 2 7 2 8 2 9 2 10 2 11 2 12 2 13 2 14 2 15 2 17 2 18 2 19 2 20 2 21 2 22 3 4 3 6 3 7 3 9 3 10 3 11 3 12 3 13 3 14 3 15 3 16 3 17 3 19 3 20 3 21 3 22 4 5 4 6 4 7 4 8 4 9 4 10 4 11 4 12 4...
output:
1 0 0 1123 14385 186177 2973080 44180837 621658239 518405798 934454222 860666292 932474460 985277598 699191855 662116076 201536669 218946745 554810196 647241992 973561100 985159893 750689112 408387271 188850799 951890127 912542323 796846581 957931163 988939752 537580303 532031226 137014814 977771155...
result:
ok 209 numbers
Test #105:
score: 35
Accepted
time: 29ms
memory: 16272kb
input:
21 201 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 21 2 3 2 4 2 5 2 6 2 7 2 8 2 9 2 10 2 11 2 12 2 13 2 14 2 15 2 16 2 17 2 18 2 19 2 21 3 4 3 5 3 6 3 7 3 8 3 9 3 10 3 12 3 13 3 14 3 15 3 16 3 17 3 18 3 19 3 20 3 21 4 5 4 6 4 7 4 8 4 9 4 10 4 11 4 12 4 13 4 14...
output:
1 0 0 1166 15059 195858 3147105 46947810 661348027 56319089 750498125 548727022 390242220 68224896 546258238 65379716 560284283 616873337 136879568 865593301 942932680 471949896 215416446 898139264 869846158 149758050 908691247 528955579 450319122 594482512 838172475 508633243 950948023 455737332 28...
result:
ok 202 numbers
Extra Test:
score: 0
Extra Test Passed