QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#960377 | #8500. Траектория обучения | modwwe | 100 ✓ | 1563ms | 183108kb | C++20 | 10.5kb | 2025-04-01 15:31:21 | 2025-04-01 15:31:21 |
Judging History
answer
//#include "park.h"
//#pragma GCC optimize("Ofast,unroll-loops")
#include<bits/stdc++.h>
#define int long long
#define ll long long
#define down cout<<'\n';
#define debug cout<<" cucuucucuuu",down
#define modwwe int t;cin>>t; while(t--)
#define bit(i,j) (i>>j&1)
#define sobit(a) __builtin_popcountll(a)
#define task2 "top1tst"
#define task "test"
#define fin(x) freopen(x".inp","r",stdin)
#define fou(x) freopen(x".out","w",stdout)
#define pb push_back
#define mask(k) (1ll<<k)
#define checktime cerr << (double)clock() / CLOCKS_PER_SEC * 1000 << " ms";
using namespace std;
#define getchar_unlocked getchar
mt19937 rd(chrono::steady_clock::now().time_since_epoch().count());
int rand(int l,int r)
{
return uniform_int_distribution<int>(l,r)(rd);
}
void phongbeo();
const int inf=1e18;
const int mod2 = 1e9+7;
//const int base=67;
ll n, m, s1, s2, s4, s3, sf, k, s5, s6, mx, s7, s8, s9, mx2, res, dem2 = 0, dem = 0, s33, dem3, dem4, mid, l2, r2, center;
ll i, s10, s12,k1,k2,k3,s11,lim,w,l,r,dem5,dem6,dem7,dem9,now,root,q,start,en;
ll kk;
ll el = 19;
main()
{
///top1tst
if(fopen(task2".inp","r"))
{
fin(task2);
fou(task2);
}
///top1tst
if(fopen(task".inp","r"))
{
fin(task);
fou(task);
}
///top1tst
ios_base::sync_with_stdio(0);
cout.tie(0);
cin.tie(0);
// cin>>s1;
// int t;cin>>t;while(t--)
phongbeo();
checktime
///top1tst
}
vector<int> a,b,costa,costb;
int cd[500003],prea[500003],preb[500003],d[1000001],demc[500003],phai[500003],trai[500003];
int ans[5];
void del(int x,int y);
struct segtree
{
int t[2000001];
int lazy[2000001][2];
int total[2000001];
int g[2000001][2];
void apply(int node,int x,int y)
{
t[node]+=x;
lazy[node][y]+=x;
g[node][y]+=x;
total[node]=max({total[node],t[node],g[node][y]});
}
void ff(int x)
{
for(int i=x*2; i<=x*2+1; i++)
for(int j=0; j<2; j++)
apply(i,lazy[x][j],j);
lazy[x][0]=lazy[x][1]=0;
}
void build(int node,int l,int r)
{
g[node][0]=g[node][1]=-inf;
lazy[node][0]=lazy[node][1]=0;
if(l==r)
{
demc[l]=0;
t[node]=cd[l]-preb[d[a[l]]];
total[node]=t[node];
return;
}
int mid=l+r>>1;
build(node<<1,l,mid);
build(node<<1|1,mid+1,r);
t[node]=max(t[node<<1],t[node<<1|1]);
total[node]=max(total[node<<1],total[node<<1|1]);
}
void upd(int node,int l,int r,int l1,int r1,int x,int y)
{
if(l>r1||r<l1) return;
if(l>=l1&&r<=r1)
{
apply(node,x,y);
return;
}
int mid=l+r>>1;
if(lazy[node][0]!=0||lazy[node][1])ff(node);
upd(node<<1,l,mid,l1,r1,x,y);
upd(node<<1|1,mid+1,r,l1,r1,x,y);
t[node]=max(t[node<<1],t[node<<1|1]);
total[node]=max(total[node<<1],total[node<<1|1]);
for(int j=0; j<2; j++)
g[node][j]=max(g[node<<1][j],g[node<<1|1][j]);
}
void cc(int node,int l,int r,int l1,int x,int cost)
{
if(l==r)
{
demc[l]++;
if(demc[l]==1)
{
g[node][1-x]=-inf;
g[node][x]=t[node]+cost;
total[node]=t[node]+cost;
}
t[node]=-inf;
if(demc[l]==2)
total[node]=prea[phai[l]-1]-prea[trai[l]]-preb[d[a[l]]],
g[node][0]=g[node][1]=-inf;
return;
}
int mid=l+r>>1;
if(lazy[node][0]!=0||lazy[node][1])ff(node);
if(l1<=mid)cc(node<<1,l,mid,l1,x,cost);
else cc(node<<1|1,mid+1,r,l1,x,cost);
t[node]=max(t[node<<1],t[node<<1|1]);
total[node]=max(total[node<<1],total[node<<1|1]);
for(int j=0; j<2; j++)
g[node][j]=max(g[node<<1][j],g[node<<1|1][j]);
}
int get(int node,int l,int r)
{
if(l==r)return l;
int mid=l+r>>1;
if(lazy[node][0]!=0||lazy[node][1])ff(node);
if(total[node<<1]==total[node])return get(node<<1,l,(l+r)>>1);
return get(node<<1|1,((l+r)>>1)+1,r);
}
} st;
int f[1000001],haha[1000001];
vector<int> rgt[500001];
vector<int> lft[500001];
set<int> s;
namespace dsuconcu
{
struct ie
{
int a,b,l,r,cost;
};
struct ic
{
int a,b,c;
};
ie dsu[500001];
ic maxx;
void reset()
{
maxx= {0,0,0};
for(int i=1; i<=n; i++)
dsu[i]= {1,i,i,i,costa[i]};
}
int get(int x)
{
if(dsu[x].b!=x)dsu[x].b=get(dsu[x].b);
return dsu[x].b;
}
void noi(int x,int y)
{
x=get(x);
y=get(y);
if(x==y)assert(0);
if(dsu[x].a<dsu[y].a)swap(x,y);
dsu[x].a+=dsu[y].a;
dsu[y].b=x;
dsu[x].cost+=dsu[y].cost;
dsu[x].l=min(dsu[x].l,dsu[y].l);
dsu[x].r=max(dsu[x].r,dsu[y].r);
if(dsu[x].cost>maxx.a)
maxx= {dsu[x].cost,dsu[x].l,dsu[x].r};
}
}
void solve(int xxx)
{
dsuconcu::reset();
for(int i=1; i<=n; i++)
prea[i]=prea[i-1]+costa[i];
for(int i=1; i<=m; i++)
preb[i]=preb[i-1]+costb[i],rgt[i].clear(),lft[i].clear();
int pos;
for(int i=1; i<=m; i++)
if(preb[i]>=preb[m]/2)
{
pos=i;
break;
}
///use pos
memset(d,0,sizeof d);
memset(f,0,sizeof f);
memset(haha,0,sizeof haha);
for(int i=1; i<=pos; i++)
d[b[i]]=i;
for(int i=1; i<=m; i++)haha[b[i]]=i;
for(int i=1; i<=n+m; i++)
f[i]=m;
for(int i=pos+1; i<=m; i++)
f[b[i]]=i-1;
stack<int> ss;
for(int i=1; i<=n; i++)
phai[i]=n+1,trai[i]=0;
for(int i=n; i>=1; --i)
{
if(f[a[i]]==m)
{
while(!ss.empty()&&d[a[i]]>d[a[ss.top()]])
{
s2=ss.top();
ss.pop();
if(!ss.empty())
f[a[ss.top()]]=min(f[a[s2]],f[a[ss.top()]]);
}
if(!ss.empty())rgt[f[a[ss.top()]]].pb(i),phai[i]=ss.top();
}
if(f[a[i]]==m)ss.push(i);
else if(!ss.empty())f[a[ss.top()]]=min(f[a[ss.top()]],f[a[i]]);
}
while(!ss.empty())
ss.pop();
for(int i=1; i<=n+m; i++)
f[i]=m;
for(int i=pos+1; i<=m; i++)
f[b[i]]=i-1;
for(int i=1; i<=n; i++)
{
if(f[a[i]]==m)
{
while(!ss.empty()&&d[a[i]]>=d[a[ss.top()]])
{
s2=ss.top();
ss.pop();
if(!ss.empty())
f[a[ss.top()]]=min(f[a[s2]],f[a[ss.top()]]);
}
if(!ss.empty())lft[f[a[ss.top()]]].pb(i),trai[i]=ss.top();
}
if(f[a[i]]==m)ss.push(i);
else if(!ss.empty())f[a[ss.top()]]=min(f[a[ss.top()]],f[a[i]]);
}
s.clear();
s.insert(0);
s.insert(n+1);
for(int i=1; i<=n+m; i++)
f[i]=0;
for(int i=1; i<=n; i++)
{
if(haha[a[i]]>pos)s.insert(i);
f[a[i]]=i;
}
for(int i=1; i<=n; i++)
{
cd[i]=-inf;
if(haha[a[i]]<=pos)
{
auto it=s.lower_bound(i);
s2=*it;
if(s2>phai[i])s2=phai[i];
it=prev(it);
s3=*it;
if(s3<trai[i])s3=trai[i];
cd[i]=prea[s2-1]-prea[s3];
}
}
st.build(1,1,n);
for(int i=m; i>=pos; --i)
{
if(i!=m)
{
for(auto x:rgt[i])
{
s2=*s.lower_bound(x);
st.cc(1,1,n,x,0,prea[phai[x]-1]-prea[s2-1]);
}
for(auto x:lft[i])
{
auto it=s.lower_bound(x);
it=prev(it);
s2=*it;
st.cc(1,1,n,x,1,prea[s2]-prea[trai[x]]);
}
del(b[i+1],i+1);
}
else
{
for(auto x:rgt[i])
st.cc(1,1,n,x,0,0);
for(auto x:lft[i])
st.cc(1,1,n,x,1,0);
}
s4=max({s4,preb[i]+st.total[1],preb[i]+dsuconcu::maxx.a});
if(s4==preb[i]+st.total[1])
{
int xx=st.get(1,1,n);
auto it=s.lower_bound(xx);
s2=*it;
if(s2>phai[xx])s2=phai[xx];
it=prev(it);
s3=*it;
if(s3<trai[xx])s3=trai[xx];
ans[0]=s3+1;
ans[1]=s2-1;
ans[2]=d[a[xx]]+1;
ans[3]=i;
if(ans[2]>ans[3])ans[2]=0,ans[3]=0;
if(xxx==1)
{
swap(ans[0],ans[2]);
swap(ans[1],ans[3]);
}
}
else if(s4==preb[i]+dsuconcu::maxx.a)
{
ans[2]=1;
ans[3]=i;
ans[0]=dsuconcu::maxx.b;
ans[1]=dsuconcu::maxx.c;
if(xxx==1)
{
swap(ans[0],ans[2]);
swap(ans[1],ans[3]);
}
}
}
}
void del(int x,int y)
{
if(f[x]==0) return;
s.erase(f[x]);
now=f[x];
if(dsuconcu::maxx.a<costa[now])
dsuconcu::maxx= {costa[now],now,now};
if(haha[a[now-1]]>=y)dsuconcu::noi(now,now-1);
if(now!=a.size()-1)
if(haha[a[now+1]]>=y)dsuconcu::noi(now,now+1);
int lc,rc;
auto it=s.lower_bound(f[x]);
rc=*it;
it=prev(it);
lc=*it;
st.upd(1,1,n,lc+1,f[x]-1,prea[rc-1]-prea[f[x]-1],1);
st.upd(1,1,n,f[x]+1,rc-1,prea[f[x]]-prea[lc],0);
}
void phongbeo()
{
cin>>n>>m;
if(n==0&&m==0)
{
cout<<0<<"\n";
cout<<0<<" "<<0<<'\n';
cout<<0<<" "<<0;
exit(0);
}
a.resize(n+1);
b.resize(m+1);
costa.resize(n+1);
costb.resize(m+1);
for(int i=1; i<=n; i++)
cin>>a[i];
for(int i=1; i<=n; i++)
cin>>costa[i];
for(int i=1; i<=m; i++)
cin>>b[i];
for(int i=1; i<=m; i++)
cin>>costb[i];
if(n==0)
{
for(int i=1; i<=m; i++)
s4+=costb[i];
cout<<s4<<'\n';
cout<<0<<" "<<0<<"\n";
cout<<1<<" "<<m<<"\n";
return;
}
else if(m==0)
{
for(int i=1; i<=n; i++)
s4+=costa[i];
cout<<s4<<'\n';
cout<<1<<" "<<n<<"\n";
cout<<0<<" "<<0<<"\n";
return;
}
solve(0);
swap(a,b);
swap(costa,costb);
swap(n,m);
solve(1);
cout<<s4,down
cout<<ans[0]<<" "<<ans[1]<<"\n";
cout<<ans[2]<<" "<<ans[3]<<"\n";
}
这程序好像有点Bug,我给组数据试试?
Details
Tip: Click on the bar to expand more detailed information
Subtask #1:
score: 10
Accepted
Test #1:
score: 10
Accepted
time: 3ms
memory: 48552kb
input:
7 5 3 1 4 8 6 9 2 2 7 4 10 1 5 3 9 2 11 3 8 3 5 3 4 12
output:
39 2 6 2 4
result:
ok 5 number(s): "39 2 6 2 4"
Test #2:
score: 10
Accepted
time: 3ms
memory: 45504kb
input:
2 3 1 2 1 4 2 3 1 17 2 15
output:
34 0 0 1 3
result:
ok 5 number(s): "34 0 0 1 3"
Test #3:
score: 10
Accepted
time: 2ms
memory: 47872kb
input:
3 3 4 2 1 10 1 2 5 4 2 1 2 9
output:
19 1 1 3 3
result:
ok 5 number(s): "19 1 1 3 3"
Test #4:
score: 10
Accepted
time: 3ms
memory: 48544kb
input:
2 1 2 1 1 2 1 3
output:
4 1 1 1 1
result:
ok 5 number(s): "4 1 1 1 1"
Test #5:
score: 10
Accepted
time: 2ms
memory: 47640kb
input:
2 1 3 2 1 3 2 5
output:
6 1 1 1 1
result:
ok 5 number(s): "6 1 1 1 1"
Test #6:
score: 10
Accepted
time: 2ms
memory: 48436kb
input:
7 7 1 2 3 11 5 6 7 1 1 1 1 1 1 1 11 12 13 1 9 8 10 1 1 1 1 1 1 1
output:
12 2 7 2 7
result:
ok 5 number(s): "12 2 7 2 7"
Test #7:
score: 10
Accepted
time: 3ms
memory: 45400kb
input:
1 1 1 10 1 5
output:
10 1 1 0 0
result:
ok 5 number(s): "10 1 1 0 0"
Test #8:
score: 10
Accepted
time: 4ms
memory: 48416kb
input:
1 1 1 10 1 20
output:
20 0 0 1 1
result:
ok 5 number(s): "20 0 0 1 1"
Test #9:
score: 10
Accepted
time: 4ms
memory: 45520kb
input:
3 1 2 3 4 501 873 845 4 136
output:
2219 1 3 0 0
result:
ok 5 number(s): "2219 1 3 0 0"
Test #10:
score: 10
Accepted
time: 5ms
memory: 46780kb
input:
3 2 5 4 1 383 816 263 2 1 645 799
output:
2643 1 2 1 2
result:
ok 5 number(s): "2643 1 2 1 2"
Test #11:
score: 10
Accepted
time: 1ms
memory: 45112kb
input:
5 7 5 4 9 2 3 395 964 318 763 523 7 12 3 2 5 6 11 479 31 145 778 384 566 349
output:
4014 2 3 1 7
result:
ok 5 number(s): "4014 2 3 1 7"
Test #12:
score: 10
Accepted
time: 2ms
memory: 47708kb
input:
5 4 9 7 3 2 4 4 9 12 3 7 1 7 4 5 10 4 1 2
output:
45 1 5 1 1
result:
ok 5 number(s): "45 1 5 1 1"
Test #13:
score: 10
Accepted
time: 5ms
memory: 48508kb
input:
8 12 5 4 2 8 6 20 18 17 1 2 2 7 2 10 1 1 17 5 4 2 13 18 8 7 20 10 6 14 2 10 8 7 3 2 2 6 3 6 4 3
output:
56 0 0 1 12
result:
ok 5 number(s): "56 0 0 1 12"
Test #14:
score: 10
Accepted
time: 3ms
memory: 47960kb
input:
3 7 10 1 6 678 695 75 6 8 2 3 10 7 1 679 581 731 657 408 476 702
output:
4234 0 0 1 7
result:
ok 5 number(s): "4234 0 0 1 7"
Test #15:
score: 10
Accepted
time: 3ms
memory: 46728kb
input:
15 7 21 17 9 20 2 11 16 4 6 7 14 8 22 3 12 685 223 11 372 557 805 787 806 221 152 769 533 274 111 663 10 7 19 2 5 1 11 721 284 585 110 343 326 321
output:
7690 1 15 1 1
result:
ok 5 number(s): "7690 1 15 1 1"
Test #16:
score: 10
Accepted
time: 4ms
memory: 45556kb
input:
10 10 16 12 5 10 1 15 2 9 7 14 185 680 904 397 596 861 176 377 802 44 11 8 18 17 10 20 3 9 13 2 44 32 920 337 121 295 478 599 489 906
output:
6390 1 6 6 10
result:
ok 5 number(s): "6390 1 6 6 10"
Test #17:
score: 10
Accepted
time: 2ms
memory: 46940kb
input:
10 15 10 24 22 13 3 17 8 12 15 20 277 282 635 297 729 650 920 558 480 777 16 3 2 21 25 9 18 11 22 6 1 17 13 12 4 822 768 11 801 313 611 96 536 425 944 496 729 520 589 434
output:
9807 7 10 1 13
result:
ok 5 number(s): "9807 7 10 1 13"
Test #18:
score: 10
Accepted
time: 4ms
memory: 45240kb
input:
15 10 11 8 1 12 20 24 16 2 3 23 18 4 17 10 13 622 502 410 200 756 465 243 418 947 805 101 616 343 364 420 25 17 19 16 3 20 5 24 2 15 455 606 112 354 177 570 427 433 580 171
output:
7667 1 15 1 1
result:
ok 5 number(s): "7667 1 15 1 1"
Test #19:
score: 10
Accepted
time: 3ms
memory: 44836kb
input:
5 3 2 4 3 1 6 62 398 248 163 311 1 3 6 327 19 424
output:
1295 1 4 3 3
result:
ok 5 number(s): "1295 1 4 3 3"
Test #20:
score: 10
Accepted
time: 2ms
memory: 45376kb
input:
2 23 25 16 274 268 22 11 4 25 24 3 20 15 2 7 13 21 5 12 8 10 19 9 6 18 23 17 1 410 396 430 159 268 199 443 99 210 160 150 102 39 84 10 271 324 144 110 16 47 476 462
output:
5277 2 2 1 23
result:
ok 5 number(s): "5277 2 2 1 23"
Test #21:
score: 10
Accepted
time: 4ms
memory: 45432kb
input:
25 1 19 2 14 15 26 23 18 11 4 12 3 25 20 8 16 6 10 22 1 5 21 9 17 7 24 134 156 8 160 67 140 13 149 20 109 32 31 8 32 121 102 149 151 34 40 73 81 78 47 91 1 83
output:
2026 1 25 0 0
result:
ok 5 number(s): "2026 1 25 0 0"
Test #22:
score: 10
Accepted
time: 2ms
memory: 48684kb
input:
26 21 7 42 12 6 47 37 36 24 31 28 44 35 2 5 19 38 14 46 15 41 3 33 22 26 29 9 177 502 648 241 400 98 470 486 346 236 187 791 212 762 171 544 404 737 251 45 697 686 763 735 571 22 7 44 10 17 13 46 29 3 35 9 22 38 42 31 36 12 6 28 32 1 8 724 267 725 443 344 92 25 108 367 220 498 314 41 573 199 573 510...
output:
12872 1 26 19 21
result:
ok 5 number(s): "12872 1 26 19 21"
Test #23:
score: 10
Accepted
time: 5ms
memory: 45136kb
input:
27 2 18 2 6 15 3 9 14 21 24 27 22 28 20 7 23 12 29 10 26 5 4 25 13 11 19 16 17 753 356 424 753 263 588 843 775 764 476 578 679 530 293 1 323 59 806 458 90 779 669 753 98 677 768 49 1 25 537 557
output:
14142 1 27 1 1
result:
ok 5 number(s): "14142 1 27 1 1"
Test #24:
score: 10
Accepted
time: 5ms
memory: 45300kb
input:
28 7 13 4 25 29 5 17 10 24 18 11 3 2 35 12 27 28 15 32 20 21 6 7 34 19 14 1 33 30 95 331 229 194 107 235 78 16 55 211 16 245 84 165 325 130 200 19 200 321 261 293 162 343 237 289 90 155 12 31 34 8 7 18 33 219 168 101 227 281 57 181
output:
5313 1 28 4 4
result:
ok 5 number(s): "5313 1 28 4 4"
Test #25:
score: 10
Accepted
time: 5ms
memory: 45408kb
input:
29 17 1 44 22 23 29 16 24 46 21 36 18 10 8 27 5 34 42 9 15 26 43 6 35 41 37 39 31 45 25 63 39 44 14 48 70 35 28 51 72 53 24 56 1 33 29 47 27 65 76 73 51 38 2 53 62 52 20 23 10 16 29 35 15 24 28 22 37 43 32 6 9 41 23 8 1 41 23 8 56 29 71 41 72 76 45 59 15 31 52 52 21 42
output:
1308 1 29 11 11
result:
ok 5 number(s): "1308 1 29 11 11"
Test #26:
score: 10
Accepted
time: 4ms
memory: 46756kb
input:
10 40 44 43 20 39 28 32 5 38 30 21 565 592 264 427 256 838 398 697 351 677 45 31 49 14 23 50 16 24 11 26 37 33 12 6 48 34 27 3 36 30 35 41 39 47 1 40 8 15 18 7 4 13 42 19 46 10 22 28 2 29 322 738 303 521 571 858 626 983 45 609 101 578 950 307 464 127 731 696 777 137 761 92 361 326 844 568 605 183 39...
output:
21210 6 8 1 40
result:
ok 5 number(s): "21210 6 8 1 40"
Test #27:
score: 10
Accepted
time: 5ms
memory: 45188kb
input:
45 30 3 48 26 24 4 46 66 2 41 39 10 57 9 16 59 11 33 22 68 34 50 43 67 72 47 55 60 1 30 36 35 52 28 17 65 69 20 62 63 74 45 75 40 31 51 899 886 605 674 856 261 698 562 1000 94 361 109 893 437 406 700 342 384 682 990 550 643 593 826 171 486 956 746 912 749 472 698 563 344 390 965 256 465 345 784 516 ...
output:
27092 1 45 6 8
result:
ok 5 number(s): "27092 1 45 6 8"
Test #28:
score: 10
Accepted
time: 5ms
memory: 45348kb
input:
20 40 11 43 42 50 30 18 3 39 13 8 46 24 27 12 28 48 33 38 41 15 173 616 725 337 666 385 261 339 863 140 960 125 818 159 591 87 456 19 489 708 29 12 54 11 16 57 21 6 18 28 5 14 35 44 52 17 50 19 25 40 49 59 24 47 2 53 43 1 36 32 37 56 7 26 4 51 23 33 22 27 74 892 383 579 307 357 848 886 499 121 823 9...
output:
22238 7 11 1 40
result:
ok 5 number(s): "22238 7 11 1 40"
Test #29:
score: 10
Accepted
time: 2ms
memory: 46752kb
input:
45 50 80 35 28 50 54 45 39 93 31 42 95 5 70 13 84 77 11 17 74 37 91 12 61 49 69 75 87 56 62 27 24 85 6 51 23 79 40 26 38 64 59 16 34 55 66 873 754 550 929 339 822 127 538 650 64 648 628 863 715 394 291 375 764 575 488 341 992 697 344 477 740 153 691 955 259 97 606 514 220 330 841 358 74 239 490 306 ...
output:
34807 1 45 1 22
result:
ok 5 number(s): "34807 1 45 1 22"
Test #30:
score: 10
Accepted
time: 4ms
memory: 45668kb
input:
18 3 11 14 21 4 8 20 9 10 18 5 2 7 17 15 1 3 13 19 414 338 260 191 193 96 196 489 337 183 422 133 171 21 135 148 69 175 19 4 14 433 171 263
output:
4229 1 17 1 1
result:
ok 5 number(s): "4229 1 17 1 1"
Test #31:
score: 10
Accepted
time: 4ms
memory: 48276kb
input:
19 9 6 27 24 26 8 5 11 22 2 17 10 13 3 18 23 21 1 7 15 523 61 165 239 198 58 325 471 54 320 261 206 232 84 512 459 7 396 159 11 5 1 15 17 18 26 21 3 405 336 237 322 6 278 20 442 359
output:
4893 1 18 4 4
result:
ok 5 number(s): "4893 1 18 4 4"
Test #32:
score: 10
Accepted
time: 3ms
memory: 45608kb
input:
50 50 62 6 53 25 8 18 81 78 82 2 7 66 35 14 28 69 68 20 32 90 30 34 60 22 9 80 50 41 23 57 73 79 89 46 54 24 97 84 19 44 72 99 93 65 47 87 70 59 11 31 698 45 957 614 744 224 888 330 371 893 733 301 820 392 566 791 703 635 975 579 612 419 405 39 128 945 117 16 690 514 320 996 918 719 558 606 397 846 ...
output:
49733 1 50 1 50
result:
ok 5 number(s): "49733 1 50 1 50"
Test #33:
score: 10
Accepted
time: 3ms
memory: 45608kb
input:
50 50 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 880430555 185607760 546574706 923257969 490315551 79718502 386191149 21579673 733207249 668571560 378975446 489100720 155817595 978433997 745103515 15354...
output:
28841117357 1 44 1 6
result:
ok 5 number(s): "28841117357 1 44 1 6"
Test #34:
score: 10
Accepted
time: 5ms
memory: 48732kb
input:
50 50 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 3856197 747548791 714175374 663223807 119263198 971618568 233119095 841862500 835302950 627354860 892842696 984043428 754192 299030044 531334536 90667624...
output:
26527688489 1 36 37 50
result:
ok 5 number(s): "26527688489 1 36 37 50"
Test #35:
score: 10
Accepted
time: 3ms
memory: 48548kb
input:
50 50 1 46 2 45 3 44 4 43 5 42 6 41 7 40 8 39 9 38 10 37 11 36 12 13 35 14 34 15 33 16 32 17 31 18 30 19 29 20 28 21 27 22 26 23 25 24 47 49 51 53 70081 40736 2476 54026 91400 95141 79799 4039 23552 55273 52783 89351 47154 27586 20573 38849 45479 82827 999925717 999907410 999902200 999925860 9999891...
output:
29999234811 9 36 16 33
result:
ok 5 number(s): "29999234811 9 36 16 33"
Test #36:
score: 10
Accepted
time: 5ms
memory: 45180kb
input:
50 49 59 68 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 54 48 58 70 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 39 13 38 35 24 45 46 47 48 49 50 51 52 53 54 55 56 57...
output:
83 3 46 6 44
result:
ok 5 number(s): "83 3 46 6 44"
Test #37:
score: 10
Accepted
time: 2ms
memory: 47956kb
input:
48 50 70 65 74 62 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 55 81 48 56 39 42 45 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 16 18 7 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 5...
output:
81 5 41 4 47
result:
ok 5 number(s): "81 5 41 4 47"
Test #38:
score: 10
Accepted
time: 5ms
memory: 48604kb
input:
50 49 69 56 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 52 62 54 58 10616865 4474113 995049853 988146827 986489203 992617258 989730537 981934253 994700835 989624685 991345859 994565090 982739138 980645893 998581292 994505...
output:
82135573823 3 46 6 44
result:
ok 5 number(s): "82135573823 3 46 6 44"
Test #39:
score: 10
Accepted
time: 3ms
memory: 48772kb
input:
48 50 70 56 60 41 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 73 62 72 55 64 51 54 16033920 8795780 15434243 980828419 981973983 979881555 983832792 998992987 985484631 988298993 989810838 995959906 994694415 999113653 990031012 984502430 991...
output:
80206935845 5 41 4 47
result:
ok 5 number(s): "80206935845 5 41 4 47"
Test #40:
score: 10
Accepted
time: 3ms
memory: 45592kb
input:
50 49 22 28 1 6 3 36 34 25 9 15 33 13 31 18 16 24 37 2 12 40 8 27 17 30 19 23 4 29 35 21 5 14 39 32 11 38 7 20 26 10 41 42 43 44 45 46 47 48 49 50 17054015 15628860 983257679 332616 19260277 10106094 16547080 936367 17754893 18907439 16460569 196394 18121674 3631528 17514270 11058288 4860929 295866 ...
output:
44762950665 41 50 1 49
result:
ok 5 number(s): "44762950665 41 50 1 49"
Test #41:
score: 10
Accepted
time: 4ms
memory: 48592kb
input:
48 50 44 42 40 38 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 39 41 43 45 46 47 48 8294211 17027092 314666 990992080 988274223 998270645 998965311 995925568 993353755 991360891 988762084 980282189 998892838 981489026 997133428 994180463 98233...
output:
44675125395 1 48 1 12
result:
ok 5 number(s): "44675125395 1 48 1 12"
Test #42:
score: 10
Accepted
time: 2ms
memory: 47856kb
input:
50 50 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000...
output:
100000000000 1 50 1 50
result:
ok 5 number(s): "100000000000 1 50 1 50"
Subtask #2:
score: 10
Accepted
Dependency #1:
100%
Accepted
Test #43:
score: 10
Accepted
time: 2ms
memory: 48000kb
input:
100 100 1 98 2 97 3 96 4 95 5 94 6 93 7 92 8 91 9 90 10 89 11 88 12 87 13 86 14 85 15 84 16 83 17 82 18 81 19 80 20 79 21 78 22 77 23 76 24 75 25 26 74 27 73 28 72 29 71 30 70 31 69 32 68 33 67 34 66 35 65 36 64 37 63 38 62 39 61 40 60 41 59 42 58 43 57 44 56 45 55 46 54 47 53 48 52 49 51 50 99 101 ...
output:
61999300972 26 71 24 75
result:
ok 5 number(s): "61999300972 26 71 24 75"
Test #44:
score: 10
Accepted
time: 3ms
memory: 48704kb
input:
100 100 149 170 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 126 133 ...
output:
181 3 97 6 91
result:
ok 5 number(s): "181 3 97 6 91"
Test #45:
score: 10
Accepted
time: 3ms
memory: 48192kb
input:
80 100 126 81 138 141 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 71 91 154 130 97 75 79 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1...
output:
164 5 73 4 98
result:
ok 5 number(s): "164 5 73 4 98"
Test #46:
score: 10
Accepted
time: 4ms
memory: 48036kb
input:
100 100 103 133 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 140 175 ...
output:
180096977104 3 97 6 91
result:
ok 5 number(s): "180096977104 3 97 6 91"
Test #47:
score: 10
Accepted
time: 4ms
memory: 48624kb
input:
80 100 157 97 136 89 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 126 82 77 103 155 90 142 9060367 597287 12102508 990027807 995585175 995571077 99...
output:
163101452786 5 73 4 98
result:
ok 5 number(s): "163101452786 5 73 4 98"
Test #48:
score: 10
Accepted
time: 3ms
memory: 47016kb
input:
100 100 98 96 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 97 99 100 ...
output:
98505037262 3 100 91 91
result:
ok 5 number(s): "98505037262 3 100 91 91"
Test #49:
score: 10
Accepted
time: 4ms
memory: 45680kb
input:
80 100 8 24 31 74 1 36 22 77 42 25 79 85 2 90 68 60 56 29 57 75 10 83 34 86 38 37 54 62 89 39 91 82 71 35 15 96 16 64 55 18 63 94 45 12 92 67 11 70 51 87 80 47 5 40 58 72 41 32 7 78 3 27 61 20 65 84 13 30 69 4 33 88 73 52 48 19 50 26 81 17 3143700 8661648 2168020 994810096 994778272 994556672 805143...
output:
97506071905 5 5 4 100
result:
ok 5 number(s): "97506071905 5 5 4 100"
Test #50:
score: 10
Accepted
time: 4ms
memory: 48148kb
input:
60 1 53 29 54 47 19 46 34 40 27 60 57 41 14 30 38 10 20 5 15 36 24 22 31 26 13 11 28 61 35 18 37 21 3 8 49 9 59 44 51 52 4 16 1 45 17 12 25 32 33 56 42 7 55 2 50 6 48 23 58 39 381 548 395 530 999 1 574 951 986 429 290 862 64 305 229 387 531 81 673 445 653 543 445 454 391 536 747 494 230 364 457 424 ...
output:
26314 1 60 0 0
result:
ok 5 number(s): "26314 1 60 0 0"
Test #51:
score: 10
Accepted
time: 3ms
memory: 45384kb
input:
30 65 68 55 9 20 25 70 50 57 74 64 73 36 18 40 66 92 59 29 56 34 72 88 93 51 95 76 15 49 58 53 179 597 125 739 193 9 34 393 43 470 264 648 380 676 620 481 429 33 810 421 489 813 495 582 114 685 214 276 650 667 71 67 45 70 4 17 94 52 78 35 90 15 69 28 61 44 65 3 41 33 75 24 54 87 21 60 23 86 22 47 39...
output:
34840 17 26 1 63
result:
ok 5 number(s): "34840 17 26 1 63"
Test #52:
score: 10
Accepted
time: 2ms
memory: 48360kb
input:
100 100 74 71 148 50 109 78 151 89 72 143 30 190 88 135 115 183 140 189 199 184 170 153 167 95 124 164 137 59 138 82 116 17 182 154 168 39 85 165 23 108 83 186 136 120 84 63 117 126 61 107 57 181 123 92 166 96 24 160 112 113 175 6 172 46 156 36 42 38 12 45 93 15 102 121 69 118 105 179 7 79 101 16 9 ...
output:
98400431944 1 100 1 100
result:
ok 5 number(s): "98400431944 1 100 1 100"
Test #53:
score: 10
Accepted
time: 4ms
memory: 48264kb
input:
100 10 103 35 74 12 39 40 31 30 56 2 15 104 80 13 10 96 106 89 32 9 95 18 16 108 105 46 6 63 20 99 36 49 54 94 88 101 98 78 60 51 4 92 27 58 67 100 71 7 8 73 3 5 107 53 97 69 45 41 34 109 77 81 43 65 55 79 86 91 72 19 17 21 42 76 29 66 61 38 50 93 75 22 90 24 33 64 87 102 83 1 110 62 85 48 26 82 84 ...
output:
51362 1 100 5 6
result:
ok 5 number(s): "51362 1 100 5 6"
Test #54:
score: 10
Accepted
time: 5ms
memory: 45076kb
input:
100 1 62 63 76 69 90 1 7 57 95 15 66 9 25 89 70 41 68 58 49 93 10 34 8 21 55 82 42 61 13 40 19 29 43 6 14 77 64 81 71 4 79 56 11 37 33 97 39 28 83 80 67 20 17 88 91 5 23 72 30 78 54 85 59 46 86 16 44 3 27 94 31 47 53 12 45 24 84 96 98 35 52 32 26 99 100 75 101 92 65 48 73 74 38 60 18 87 51 36 50 22 ...
output:
48949 1 100 0 0
result:
ok 5 number(s): "48949 1 100 0 0"
Test #55:
score: 10
Accepted
time: 5ms
memory: 48716kb
input:
1 100 19 476 55 44 8 14 45 10 80 15 59 60 88 16 92 26 89 41 68 50 72 82 36 75 65 51 76 24 84 67 38 20 32 17 81 2 54 22 94 98 9 5 93 97 53 95 21 83 99 48 11 6 87 73 27 90 69 23 86 35 28 46 78 18 71 62 77 25 85 66 49 29 61 43 101 42 30 33 96 7 100 19 79 58 47 37 63 52 4 57 40 31 64 34 56 3 13 12 70 74...
output:
51785 0 0 1 100
result:
ok 5 number(s): "51785 0 0 1 100"
Test #56:
score: 10
Accepted
time: 5ms
memory: 44796kb
input:
100 100 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 ...
output:
53461340397 1 48 1 52
result:
ok 5 number(s): "53461340397 1 48 1 52"
Test #57:
score: 10
Accepted
time: 5ms
memory: 48172kb
input:
100 100 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 ...
output:
53524694918 1 51 52 100
result:
ok 5 number(s): "53524694918 1 51 52 100"
Test #58:
score: 10
Accepted
time: 4ms
memory: 47872kb
input:
100 100 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 ...
output:
200000000000 1 100 1 100
result:
ok 5 number(s): "200000000000 1 100 1 100"
Subtask #3:
score: 10
Accepted
Dependency #1:
100%
Accepted
Dependency #2:
100%
Accepted
Test #59:
score: 10
Accepted
time: 3ms
memory: 46736kb
input:
300 300 1 298 2 297 3 296 4 295 5 294 6 293 7 292 8 291 9 290 10 289 11 288 12 287 13 286 14 285 15 284 16 283 17 282 18 281 19 280 20 279 21 278 22 277 23 276 24 275 25 274 26 273 27 272 28 271 29 270 30 269 31 268 32 267 33 266 34 265 35 264 36 263 37 262 38 261 39 260 40 259 41 258 42 257 43 256 ...
output:
197995485048 51 248 101 200
result:
ok 5 number(s): "197995485048 51 248 101 200"
Test #60:
score: 10
Accepted
time: 3ms
memory: 45720kb
input:
300 300 425 363 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98...
output:
562 3 275 3 291
result:
ok 5 number(s): "562 3 275 3 291"
Test #61:
score: 10
Accepted
time: 2ms
memory: 45588kb
input:
280 300 395 361 316 483 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 ...
output:
489 5 212 7 287
result:
ok 5 number(s): "489 5 212 7 287"
Test #62:
score: 10
Accepted
time: 4ms
memory: 47892kb
input:
300 300 485 541 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98...
output:
561058222329 3 275 3 291
result:
ok 5 number(s): "561058222329 3 275 3 291"
Test #63:
score: 10
Accepted
time: 4ms
memory: 45256kb
input:
280 300 223 371 445 305 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 ...
output:
488160186166 5 212 7 287
result:
ok 5 number(s): "488160186166 5 212 7 287"
Test #64:
score: 10
Accepted
time: 4ms
memory: 48728kb
input:
300 300 300 299 298 297 296 295 294 293 292 291 162 254 118 135 18 175 84 144 83 192 37 234 213 27 164 51 9 50 167 80 40 255 278 36 176 89 69 117 4 146 290 271 94 68 174 141 73 109 218 265 261 76 287 268 21 14 188 10 276 230 70 212 273 157 209 237 79 195 25 153 115 112 67 238 248 92 123 136 7 284 81...
output:
298468706101 275 275 3 300
result:
ok 5 number(s): "298468706101 275 275 3 300"
Test #65:
score: 10
Accepted
time: 5ms
memory: 45800kb
input:
280 300 214 212 210 209 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 ...
output:
276635244470 1 280 1 91
result:
ok 5 number(s): "276635244470 1 280 1 91"
Test #66:
score: 10
Accepted
time: 4ms
memory: 45052kb
input:
9 111 63 67 113 8 34 37 3 18 93 9 2 10 2 4 8 3 1 3 58 64 57 80 60 40 47 86 21 22 85 69 114 120 48 50 45 103 7 87 76 6 115 77 104 15 70 27 119 118 30 78 92 112 36 13 109 96 59 26 94 116 46 12 62 97 52 56 54 23 43 73 95 24 49 106 65 83 75 35 16 71 99 88 79 117 102 84 107 91 11 100 101 38 61 5 31 68 53...
output:
780 1 9 1 111
result:
ok 5 number(s): "780 1 9 1 111"
Test #67:
score: 10
Accepted
time: 2ms
memory: 45668kb
input:
300 300 36 8 403 347 108 22 46 595 247 60 397 155 282 201 570 587 192 321 369 572 501 253 408 256 103 99 350 20 246 479 151 161 273 54 29 160 316 480 224 312 547 557 536 230 524 482 565 310 368 198 249 122 34 440 105 281 567 264 295 259 423 211 135 297 280 546 158 12 332 89 145 146 490 174 298 41 19...
output:
304976818062 1 300 1 300
result:
ok 5 number(s): "304976818062 1 300 1 300"
Test #68:
score: 10
Accepted
time: 2ms
memory: 48184kb
input:
300 70 89 178 173 74 28 167 14 127 238 139 117 286 62 26 72 39 311 329 199 240 32 292 356 73 190 303 363 343 314 344 191 148 13 40 121 86 320 120 149 150 348 285 55 350 335 126 7 312 17 353 83 214 225 315 19 33 219 259 346 205 97 132 297 351 22 360 245 103 80 334 361 71 241 268 281 118 163 116 138 2...
output:
1198299 1 300 65 66
result:
ok 5 number(s): "1198299 1 300 65 66"
Test #69:
score: 10
Accepted
time: 4ms
memory: 45456kb
input:
300 1 115 224 206 116 110 267 50 18 1 202 46 67 271 280 182 231 254 174 146 252 190 15 71 301 264 114 256 200 135 94 32 265 170 57 172 287 86 103 76 214 52 105 155 14 297 177 187 248 300 275 227 193 22 19 167 154 128 123 9 70 101 196 168 163 34 204 81 63 290 284 145 244 121 130 251 184 208 3 258 129...
output:
512755 1 300 0 0
result:
ok 5 number(s): "512755 1 300 0 0"
Test #70:
score: 10
Accepted
time: 6ms
memory: 45216kb
input:
1 300 146 692 208 301 242 240 65 6 136 123 263 17 201 155 213 251 46 75 241 172 67 66 130 14 230 182 166 202 228 280 171 78 174 132 47 248 121 144 23 68 195 265 238 53 262 72 32 97 111 194 281 50 191 142 283 207 29 289 104 244 4 299 257 159 92 86 206 236 161 291 246 193 8 37 286 143 20 127 183 293 1...
output:
160769 0 0 1 300
result:
ok 5 number(s): "160769 0 0 1 300"
Test #71:
score: 10
Accepted
time: 5ms
memory: 47804kb
input:
300 300 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 ...
output:
150401834252 132 300 170 300
result:
ok 5 number(s): "150401834252 132 300 170 300"
Test #72:
score: 10
Accepted
time: 4ms
memory: 50576kb
input:
300 300 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 ...
output:
155412132715 1 217 218 300
result:
ok 5 number(s): "155412132715 1 217 218 300"
Test #73:
score: 10
Accepted
time: 3ms
memory: 45628kb
input:
300 300 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 ...
output:
600000000000 1 300 1 300
result:
ok 5 number(s): "600000000000 1 300 1 300"
Test #74:
score: 10
Accepted
time: 3ms
memory: 46816kb
input:
500 500 1 498 2 497 3 496 4 495 5 494 6 493 7 492 8 491 9 490 10 489 11 488 12 487 13 486 14 485 15 484 16 483 17 482 18 481 19 480 20 479 21 478 22 477 23 476 24 475 25 474 26 473 27 472 28 471 29 470 30 469 31 468 32 467 33 466 34 465 35 464 36 463 37 462 38 461 39 460 40 459 41 458 42 457 43 456 ...
output:
329992679368 150 348 101 399
result:
ok 5 number(s): "329992679368 150 348 101 399"
Test #75:
score: 10
Accepted
time: 4ms
memory: 48168kb
input:
500 500 817 498 662 694 709 773 621 526 592 803 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 ...
output:
935 11 475 22 491
result:
ok 5 number(s): "935 11 475 22 491"
Test #76:
score: 10
Accepted
time: 5ms
memory: 47800kb
input:
480 500 488 861 728 766 674 843 673 703 454 723 512 465 774 820 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82...
output:
874 15 412 12 487
result:
ok 5 number(s): "874 15 412 12 487"
Test #77:
score: 10
Accepted
time: 5ms
memory: 45056kb
input:
500 500 830 603 605 681 532 698 573 930 673 752 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 ...
output:
934070050711 11 475 22 491
result:
ok 5 number(s): "934070050711 11 475 22 491"
Test #78:
score: 10
Accepted
time: 5ms
memory: 48416kb
input:
480 500 711 488 428 872 660 512 731 815 593 771 448 420 659 848 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82...
output:
873114640864 15 412 12 487
result:
ok 5 number(s): "873114640864 15 412 12 487"
Test #79:
score: 10
Accepted
time: 4ms
memory: 47032kb
input:
500 500 73 265 341 144 444 448 127 226 219 422 1 15 266 401 314 138 96 377 180 236 238 374 297 234 380 90 62 364 322 204 250 9 269 182 244 184 370 109 51 320 105 158 249 470 274 102 60 153 68 417 85 34 442 301 414 87 104 159 285 466 71 78 160 381 408 230 101 150 76 81 286 304 276 411 308 11 45 166 3...
output:
483544605946 472 500 1 500
result:
ok 5 number(s): "483544605946 472 500 1 500"
Test #80:
score: 10
Accepted
time: 7ms
memory: 47044kb
input:
480 500 424 422 420 418 416 414 412 410 408 406 404 402 400 399 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82...
output:
468643776397 1 480 400 500
result:
ok 5 number(s): "468643776397 1 480 400 500"
Test #81:
score: 10
Accepted
time: 5ms
memory: 48220kb
input:
500 500 909 301 894 553 203 51 813 125 803 958 106 933 983 116 210 878 220 366 201 14 494 318 462 469 639 277 538 727 988 397 187 50 382 692 574 526 286 80 559 666 583 73 113 793 439 345 53 227 594 533 985 276 696 524 117 165 943 642 955 660 710 86 346 562 17 854 137 844 802 674 315 962 74 140 211 4...
output:
499316289907 1 500 1 500
result:
ok 5 number(s): "499316289907 1 500 1 500"
Test #82:
score: 10
Accepted
time: 4ms
memory: 48100kb
input:
500 70 333 193 3 36 296 43 432 493 450 26 187 504 253 276 367 558 137 98 496 125 390 286 234 49 70 284 136 171 126 514 268 97 216 526 463 442 334 403 451 121 205 135 13 487 58 275 131 395 64 321 396 119 133 371 534 364 174 238 65 467 430 120 52 141 477 344 413 259 322 443 7 422 533 386 544 200 332 3...
output:
1982801 1 500 26 29
result:
ok 5 number(s): "1982801 1 500 26 29"
Test #83:
score: 10
Accepted
time: 4ms
memory: 48560kb
input:
500 1 53 77 193 192 341 425 1 477 84 292 176 7 363 229 46 92 97 144 222 389 433 272 342 351 361 327 184 455 395 275 484 26 195 35 244 58 31 498 6 303 232 173 160 209 308 408 25 291 14 36 237 367 131 266 158 358 126 301 456 157 326 234 163 320 356 390 249 167 420 18 128 233 271 28 217 224 454 338 469...
output:
846846 1 500 0 0
result:
ok 5 number(s): "846846 1 500 0 0"
Test #84:
score: 10
Accepted
time: 5ms
memory: 46980kb
input:
1 500 36 1015 271 17 421 313 366 261 404 121 336 368 168 320 37 458 282 69 144 169 161 70 77 454 497 118 174 390 40 444 172 25 373 183 349 218 123 406 273 82 244 163 447 127 425 2 479 79 478 274 269 276 432 393 293 243 234 287 262 84 360 50 290 217 176 342 383 13 208 89 184 395 136 280 83 42 453 326...
output:
282135 0 0 1 500
result:
ok 5 number(s): "282135 0 0 1 500"
Test #85:
score: 10
Accepted
time: 5ms
memory: 46904kb
input:
100 200 145 239 28 156 154 263 285 242 25 292 82 136 116 52 128 247 237 214 140 224 172 175 232 149 6 147 18 1 47 158 84 11 105 246 23 281 51 272 39 211 284 85 125 198 71 180 197 269 249 135 37 251 109 57 114 164 36 124 69 258 77 121 184 139 15 123 169 274 210 56 221 215 53 300 42 155 229 264 70 205...
output:
108325 60 64 1 200
result:
ok 5 number(s): "108325 60 64 1 200"
Test #86:
score: 10
Accepted
time: 6ms
memory: 47876kb
input:
300 200 498 129 248 7 282 310 368 354 252 472 279 103 255 36 15 214 63 223 32 174 250 55 404 92 20 395 222 41 9 383 82 93 374 83 91 16 434 167 123 439 162 419 421 166 243 288 186 450 494 413 50 478 158 79 468 65 389 225 89 442 316 261 456 423 295 196 234 215 156 163 138 84 443 88 199 480 21 177 284 ...
output:
160869 2 300 8 26
result:
ok 5 number(s): "160869 2 300 8 26"
Subtask #4:
score: 10
Accepted
Dependency #1:
100%
Accepted
Dependency #2:
100%
Accepted
Dependency #3:
100%
Accepted
Test #87:
score: 10
Accepted
time: 7ms
memory: 48632kb
input:
300 450 5 484 749 283 151 579 455 593 38 738 102 112 393 482 476 489 685 157 275 581 301 204 2 278 333 629 35 612 86 128 538 508 605 619 559 750 700 285 634 423 32 338 13 55 571 225 302 119 1 606 521 438 95 241 297 155 396 105 122 626 561 252 536 401 292 309 596 80 542 718 11 622 127 182 48 652 318 ...
output:
2588 77 79 1 450
result:
ok 5 number(s): "2588 77 79 1 450"
Test #88:
score: 10
Accepted
time: 4ms
memory: 45148kb
input:
300 450 182 264 430 467 178 706 555 354 235 560 747 190 161 488 675 526 485 239 369 12 146 496 110 87 460 17 469 474 40 665 225 250 37 546 557 650 151 28 31 41 629 664 198 51 734 139 666 730 131 7 358 123 329 452 108 601 541 610 157 220 59 14 174 394 503 717 708 413 463 326 294 612 703 659 685 106 5...
output:
32235 120 300 1 450
result:
ok 5 number(s): "32235 120 300 1 450"
Test #89:
score: 10
Accepted
time: 3ms
memory: 48052kb
input:
500 300 671 468 725 676 353 210 710 790 243 139 119 686 14 611 183 270 381 718 296 43 395 531 83 216 333 222 341 392 95 175 21 647 384 471 582 18 530 397 669 185 776 617 166 184 37 346 9 705 583 260 529 207 630 780 53 763 173 238 553 520 592 453 572 105 342 569 737 474 534 356 182 466 498 371 77 372...
output:
4331322 1 500 22 22
result:
ok 5 number(s): "4331322 1 500 22 22"
Test #90:
score: 10
Accepted
time: 5ms
memory: 48696kb
input:
400 150 216 139 347 186 13 31 317 355 64 249 88 115 73 492 35 118 456 450 501 242 222 499 137 144 264 135 109 279 255 122 62 412 351 215 93 101 477 327 520 79 411 163 320 40 198 228 451 227 361 225 358 535 364 525 17 385 104 232 211 367 430 473 513 114 394 426 335 59 315 184 201 187 9 247 81 471 491...
output:
2210 1 400 41 41
result:
ok 5 number(s): "2210 1 400 41 41"
Test #91:
score: 10
Accepted
time: 6ms
memory: 45368kb
input:
500 500 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 ...
output:
261434834782 252 500 250 500
result:
ok 5 number(s): "261434834782 252 500 250 500"
Test #92:
score: 10
Accepted
time: 6ms
memory: 47920kb
input:
500 500 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 ...
output:
267097731549 1 104 105 500
result:
ok 5 number(s): "267097731549 1 104 105 500"
Test #93:
score: 10
Accepted
time: 4ms
memory: 46844kb
input:
500 500 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 ...
output:
1000000000000 1 500 1 500
result:
ok 5 number(s): "1000000000000 1 500 1 500"
Subtask #5:
score: 10
Accepted
Dependency #1:
100%
Accepted
Dependency #2:
100%
Accepted
Dependency #3:
100%
Accepted
Dependency #4:
100%
Accepted
Test #94:
score: 10
Accepted
time: 4ms
memory: 48344kb
input:
2000 2000 1 1998 2 1997 3 1996 4 1995 5 1994 6 1993 7 1992 8 1991 9 1990 10 1989 11 1988 12 1987 13 1986 14 1985 15 1984 16 1983 17 1982 18 1981 19 1980 20 1979 21 1978 22 1977 23 1976 24 1975 25 1974 26 1973 27 1972 28 1971 29 1970 30 1969 31 1968 32 1967 33 1966 34 1965 35 1964 36 1963 37 1962 38 ...
output:
1329967479559 338 1661 663 1336
result:
ok 5 number(s): "1329967479559 338 1661 663 1336"
Test #95:
score: 10
Accepted
time: 5ms
memory: 45508kb
input:
2000 2000 2449 1850 3241 2746 2901 3081 2203 3592 1723 3076 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 ...
output:
3640 11 1721 22 1950
result:
ok 5 number(s): "3640 11 1721 22 1950"
Test #96:
score: 10
Accepted
time: 5ms
memory: 45472kb
input:
2000 1800 2105 2448 2990 2149 2249 3503 3148 2948 2656 2090 3161 2044 2751 3549 2411 2934 2057 1885 2378 2790 2409 2079 2459 2418 1917 3308 2705 1852 3459 3547 1901 2953 1986 3442 2065 2689 2439 1975 3301 3144 2226 2919 2403 1999 2634 2026 3199 2682 3595 2039 2648 2768 2083 3484 3554 2343 2011 2894 ...
output:
3631 65 1912 12 1794
result:
ok 5 number(s): "3631 65 1912 12 1794"
Test #97:
score: 10
Accepted
time: 5ms
memory: 45800kb
input:
2000 2000 3438 2005 1864 3339 1844 3567 2687 2410 1776 2678 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 ...
output:
3639087028098 11 1721 22 1950
result:
ok 5 number(s): "3639087028098 11 1721 22 1950"
Test #98:
score: 10
Accepted
time: 4ms
memory: 45740kb
input:
2000 1800 2415 3062 3468 2462 3059 2196 3382 2213 2331 3491 3240 2475 2187 1883 2344 2337 2994 2711 2483 3353 3180 2570 2035 2696 2335 3211 2750 1917 3531 3621 2691 2930 2644 2936 3071 2309 3520 3039 2423 2554 2247 3352 2230 2860 3260 3358 1991 3530 2325 2340 1927 2405 2729 2867 3440 2313 3134 1923 ...
output:
3630048719485 65 1912 12 1794
result:
ok 5 number(s): "3630048719485 65 1912 12 1794"
Test #99:
score: 10
Accepted
time: 3ms
memory: 49316kb
input:
2000 2000 2114 1849 1307 2185 2259 1170 2258 1517 1288 2257 1757 2231 1348 1444 2047 1684 609 935 649 1376 1793 857 1188 1675 2174 493 1480 655 927 1693 2109 764 2158 799 742 506 1119 2380 2398 737 2389 1827 1296 1248 1113 1291 1656 2393 1611 1392 903 686 1098 1370 2164 1689 2167 1165 1835 2269 738 ...
output:
2419400480644 1231 1721 22 1950
result:
ok 5 number(s): "2419400480644 1231 1721 22 1950"
Test #100:
score: 10
Accepted
time: 4ms
memory: 47628kb
input:
2000 1800 2028 2019 2385 2137 1947 2121 1920 1948 1886 2190 2005 2097 1867 1936 2202 2352 2149 1938 2159 2044 2301 2252 2395 1941 1950 1879 2355 2264 2297 2057 2295 2406 2062 1972 2336 2351 2034 2223 1911 2197 2418 2365 2275 2133 2357 2361 2142 2098 2410 2128 2329 2379 1930 2035 1884 2020 2321 2115 ...
output:
2420370293006 65 1912 1222 1794
result:
ok 5 number(s): "2420370293006 65 1912 1222 1794"
Test #101:
score: 10
Accepted
time: 4ms
memory: 45364kb
input:
2000 1800 1974 1972 1970 1968 1966 1964 1962 1960 1958 1956 1954 1952 1950 1948 1946 1944 1942 1940 1938 1936 1934 1932 1930 1928 1926 1924 1922 1920 1918 1916 1914 1912 1910 1908 1906 1904 1902 1900 1898 1896 1894 1892 1890 1888 1886 1884 1882 1880 1878 1876 1874 1872 1870 1868 1866 1864 1862 1860 ...
output:
1951519771883 1 2000 0 0
result:
ok 5 number(s): "1951519771883 1 2000 0 0"
Test #102:
score: 10
Accepted
time: 3ms
memory: 48020kb
input:
2000 1800 573 428 454 61 166 404 476 494 288 486 296 490 52 197 262 294 417 308 402 442 100 25 36 137 514 359 445 241 201 78 415 353 423 53 69 304 93 491 245 312 410 170 496 458 57 13 396 559 459 438 545 77 97 524 233 550 315 434 259 10 264 298 118 161 1 542 336 574 27 178 487 450 560 518 348 511 34...
output:
884362841258 575 2000 1 1800
result:
ok 5 number(s): "884362841258 575 2000 1 1800"
Test #103:
score: 10
Accepted
time: 11ms
memory: 45224kb
input:
2000 2000 2068 2209 3466 2236 3726 383 2666 467 1054 2943 1925 2741 2960 1191 3760 1879 2073 3183 6 750 1468 3005 1276 3720 2826 1655 2683 3579 2132 3014 3976 556 719 3973 3725 1543 672 2417 1398 748 76 182 2659 993 2167 1390 2792 759 2141 2975 3371 535 169 2007 923 2297 1894 663 2878 328 1602 3087 ...
output:
2010663478910 1 2000 1 2000
result:
ok 5 number(s): "2010663478910 1 2000 1 2000"
Test #104:
score: 10
Accepted
time: 5ms
memory: 46972kb
input:
2000 70 1820 1101 823 718 9 303 1670 574 2052 707 1608 185 2040 1150 350 1455 1494 1421 952 18 1813 1073 1695 1739 1165 222 843 1563 1989 1717 1658 293 702 716 1394 1544 437 1646 472 1757 1239 1673 1080 1199 253 408 746 2063 1715 693 1410 531 1605 1661 1873 1915 1784 470 1158 747 1412 435 1782 642 8...
output:
76587702470 1 2000 51 53
result:
ok 5 number(s): "76587702470 1 2000 51 53"
Test #105:
score: 10
Accepted
time: 4ms
memory: 45600kb
input:
2000 1 1900 1066 1863 681 1005 433 1338 1978 647 843 1094 700 634 18 51 1352 1924 1778 1263 683 1877 1842 1363 1046 1858 635 1954 665 532 745 535 1878 1150 354 1782 847 1989 1480 676 1270 302 1567 1680 441 737 1623 947 584 1591 1304 786 1274 1279 586 964 1634 396 1159 1100 1004 1986 1275 581 151 806...
output:
3341564507 1 2000 0 0
result:
ok 5 number(s): "3341564507 1 2000 0 0"
Test #106:
score: 10
Accepted
time: 4ms
memory: 48492kb
input:
1 2000 455 645107 1893 805 1083 188 1487 1554 1206 509 1664 1822 1230 180 1468 445 1339 1863 1793 373 1281 331 642 1333 1782 932 86 1909 817 1725 429 444 1706 1363 1025 165 1650 1914 1149 101 942 1797 2001 1164 1411 529 147 489 984 1904 1584 1163 343 1065 809 802 1426 1024 647 1410 1609 223 480 851 ...
output:
1111222748 0 0 1 2000
result:
ok 5 number(s): "1111222748 0 0 1 2000"
Test #107:
score: 10
Accepted
time: 6ms
memory: 45436kb
input:
566 239 571 248 795 536 41 579 316 586 437 738 531 343 272 11 6 349 574 717 189 780 334 613 509 684 271 745 635 545 776 505 291 462 645 455 188 710 77 803 544 675 256 740 507 296 553 200 707 289 425 572 71 193 378 229 500 438 701 488 729 421 457 781 326 375 805 727 24 424 482 330 149 287 790 300 761...
output:
3138588 1 566 85 132
result:
ok 5 number(s): "3138588 1 566 85 132"
Test #108:
score: 10
Accepted
time: 4ms
memory: 46880kb
input:
766 739 101 950 1432 107 1047 89 1189 999 1325 1183 1369 963 506 304 209 1019 759 1335 31 1426 135 889 675 199 1123 1406 430 538 29 160 882 587 1289 598 668 943 259 439 969 473 748 278 1501 349 105 112 92 544 661 1156 1280 616 165 11 87 397 211 1464 42 311 1277 1146 720 1500 470 523 534 1293 315 61 ...
output:
39189 1 766 189 200
result:
ok 5 number(s): "39189 1 766 189 200"
Test #109:
score: 10
Accepted
time: 4ms
memory: 48456kb
input:
2000 2000 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 10...
output:
996905609831 1 1252 1 748
result:
ok 5 number(s): "996905609831 1 1252 1 748"
Test #110:
score: 10
Accepted
time: 5ms
memory: 48652kb
input:
2000 2000 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 10...
output:
1023122057127 1 395 396 2000
result:
ok 5 number(s): "1023122057127 1 395 396 2000"
Test #111:
score: 10
Accepted
time: 4ms
memory: 50372kb
input:
2000 1729 1729 1728 1727 1730 1726 1725 1724 1723 1722 1721 1731 1720 1719 1718 1717 1716 1715 1732 1714 1713 1712 1711 1710 1709 1708 1733 1707 1706 1705 1704 1703 1702 1734 1701 1700 1699 1698 1697 1696 1695 1735 1694 1693 1692 1691 1690 1689 1736 1688 1687 1686 1685 1684 1683 1737 1682 1681 1680 ...
output:
1007676846974 48 2000 1689 1729
result:
ok 5 number(s): "1007676846974 48 2000 1689 1729"
Test #112:
score: 10
Accepted
time: 5ms
memory: 45580kb
input:
2000 2000 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 10...
output:
4000000000000 1 2000 1 2000
result:
ok 5 number(s): "4000000000000 1 2000 1 2000"
Subtask #6:
score: 10
Accepted
Dependency #1:
100%
Accepted
Dependency #2:
100%
Accepted
Dependency #3:
100%
Accepted
Dependency #4:
100%
Accepted
Dependency #5:
100%
Accepted
Test #113:
score: 10
Accepted
time: 9ms
memory: 50524kb
input:
5000 5000 1 4998 2 4997 3 4996 4 4995 5 4994 6 4993 7 4992 8 4991 9 4990 10 4989 11 4988 12 4987 13 4986 14 4985 15 4984 16 4983 17 4982 18 4981 19 4980 20 4979 21 4978 22 4977 23 4976 24 4975 25 4974 26 4973 27 4972 28 4971 29 4970 30 4969 31 4968 32 4967 33 4966 34 4965 35 4964 36 4963 37 4962 38 ...
output:
3329918203510 1657 3342 845 4156
result:
ok 5 number(s): "3329918203510 1657 3342 845 4156"
Test #114:
score: 10
Accepted
time: 8ms
memory: 53204kb
input:
5000 5000 6914 7439 7183 8496 4645 7856 7798 8486 5075 8793 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 ...
output:
9040 11 4321 222 4950
result:
ok 5 number(s): "9040 11 4321 222 4950"
Test #115:
score: 10
Accepted
time: 5ms
memory: 45960kb
input:
5000 4000 8214 6799 4963 5548 7335 5718 7102 6377 8384 7857 7565 5133 5803 5786 7611 8537 5184 8343 7963 7111 6605 7731 8201 7613 6731 5686 8706 6640 7530 7535 5467 4913 8520 7044 5427 5482 6635 5573 5187 5911 7094 5663 6511 6446 8426 8573 6527 6578 5164 8406 8746 6572 7000 7494 7677 6160 7348 7183 ...
output:
8831 65 4912 12 3994
result:
ok 5 number(s): "8831 65 4912 12 3994"
Test #116:
score: 10
Accepted
time: 8ms
memory: 48640kb
input:
5000 5000 7127 4509 8618 5685 5539 6652 8753 5178 8160 8038 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 ...
output:
9039101842280 11 4321 222 4950
result:
ok 5 number(s): "9039101842280 11 4321 222 4950"
Test #117:
score: 10
Accepted
time: 10ms
memory: 51232kb
input:
5000 4000 5407 5838 6510 6274 8511 6389 6770 6296 8753 5666 4971 8368 7408 4923 4860 6171 6033 4876 7674 7159 6895 6853 7990 7093 5792 7824 5111 6673 8717 7773 5445 8611 7950 7347 6276 5544 4866 5246 8282 6563 6038 8436 6305 6309 8291 5448 8440 6015 5890 7410 5141 6729 5361 7164 8778 6230 8587 7092 ...
output:
8830010081542 65 4912 12 3994
result:
ok 5 number(s): "8830010081542 65 4912 12 3994"
Test #118:
score: 10
Accepted
time: 10ms
memory: 50800kb
input:
5000 5000 1854 3438 2096 2430 1414 2569 2267 2939 4919 5783 2776 4882 2581 1956 4421 1135 1539 5104 4544 1838 5034 5659 1993 4613 2959 4889 3184 1841 2444 5289 5457 2058 4194 4584 1112 2683 5557 5720 2325 3815 2377 2584 5427 2163 4994 2088 1744 2806 1515 4762 2492 5759 2590 3917 1674 2661 5810 4664 ...
output:
5839407709128 3211 4321 222 4950
result:
ok 5 number(s): "5839407709128 3211 4321 222 4950"
Test #119:
score: 10
Accepted
time: 6ms
memory: 50540kb
input:
5000 4000 5259 5238 5196 4890 5768 6286 4898 6558 6356 5713 5652 5890 5197 5317 4998 5526 6243 5408 5401 5908 6030 4969 4876 4955 5523 5651 5113 5327 6048 5860 6681 6235 5480 6726 6317 5564 5179 6406 4869 6374 6260 5173 5344 4945 4937 4852 5921 5086 6480 6547 5022 6227 5012 5438 6385 6259 6276 6662 ...
output:
6730284110273 65 4912 2112 3994
result:
ok 5 number(s): "6730284110273 65 4912 2112 3994"
Test #120:
score: 10
Accepted
time: 10ms
memory: 53148kb
input:
5000 5000 5000 4999 4998 4997 4996 4995 4994 4993 4992 4991 4990 4989 4988 4987 4986 4985 4984 4983 4982 4981 4980 4979 4978 4977 4976 4975 4974 4973 4972 4971 4970 4969 4968 4967 4966 4965 4964 4963 4962 4961 4960 4959 4958 4957 4956 4955 4954 4953 4952 4951 4950 4949 4948 4947 4946 4945 4944 4943 ...
output:
4833555059439 1 270 1 5000
result:
ok 5 number(s): "4833555059439 1 270 1 5000"
Test #121:
score: 10
Accepted
time: 8ms
memory: 45608kb
input:
5000 4000 4974 4972 4970 4968 4966 4964 4962 4960 4958 4956 4954 4952 4950 4948 4946 4944 4942 4940 4938 4936 4934 4932 4930 4928 4926 4924 4922 4920 4918 4916 4914 4912 4910 4908 4906 4904 4902 4900 4898 4896 4894 4892 4890 4888 4886 4884 4882 4880 4878 4876 4874 4872 4870 4868 4866 4864 4862 4860 ...
output:
4951509067525 1 5000 0 0
result:
ok 5 number(s): "4951509067525 1 5000 0 0"
Test #122:
score: 10
Accepted
time: 9ms
memory: 47752kb
input:
5000 5000 4280 8613 7081 1970 8536 1430 5085 9394 3170 4744 1910 3803 6921 8930 3309 2217 7161 3336 2286 7128 5009 4045 6419 7017 8254 9777 2930 655 4969 4293 8729 864 8055 3821 999 6237 2340 2208 835 3287 4735 4236 3674 5524 3763 3499 1548 7732 5339 3870 4998 2152 8746 9587 1190 5372 2458 6405 1284...
output:
5014144371544 1 5000 1 5000
result:
ok 5 number(s): "5014144371544 1 5000 1 5000"
Test #123:
score: 10
Accepted
time: 11ms
memory: 50448kb
input:
5000 4111 7572 7527 91 928 6989 8033 5034 4163 8978 7971 7434 6534 5424 652 9083 8316 3214 1324 6344 1852 545 3614 1892 6687 8550 6944 8077 3801 4516 2503 2107 4089 3936 8886 6915 8762 1757 3560 963 4326 4009 4988 8051 2841 8344 4662 6014 2004 3564 3436 1360 5265 5572 2375 2873 5079 3315 3798 3549 8...
output:
1938903579434 1 5000 312 317
result:
ok 5 number(s): "1938903579434 1 5000 312 317"
Test #124:
score: 10
Accepted
time: 8ms
memory: 45740kb
input:
5000 1 1843 4108 4710 2774 3805 535 3519 334 4637 860 8 2717 4514 2695 139 3046 177 3424 3851 2020 2646 4633 3502 4221 786 2019 1104 3827 618 2929 1516 4588 2938 2335 2416 1313 1009 4907 4310 265 2684 1989 4570 4265 292 4892 4333 3420 2776 353 4670 4428 2303 3315 1626 2951 1028 1826 765 3211 4343 14...
output:
81618306243 1 5000 0 0
result:
ok 5 number(s): "81618306243 1 5000 0 0"
Test #125:
score: 10
Accepted
time: 6ms
memory: 45932kb
input:
1 5000 4833 33419 1613 490 504 600 489 2778 811 2366 2065 2106 4775 496 4754 784 4797 4979 2384 3003 4050 3005 3401 694 635 3397 3378 3878 3954 4261 4508 509 2988 1406 1653 4929 613 4706 2205 2389 332 454 4277 558 2157 3821 1204 2803 1211 4397 908 983 4708 2568 3844 3874 3090 689 3470 2964 4029 664 ...
output:
27558977341 0 0 1 5000
result:
ok 5 number(s): "27558977341 0 0 1 5000"
Test #126:
score: 10
Accepted
time: 6ms
memory: 48628kb
input:
1000 3000 2942 683 3527 3386 2559 1872 1306 1042 2877 2989 1472 685 53 3552 3112 1702 3362 3407 2708 2988 1406 2230 87 3328 3504 1607 210 377 541 1886 3071 1844 2056 100 2451 505 1908 234 1127 911 3672 292 648 1052 2183 2036 259 1281 1341 1652 3785 859 1206 2744 1693 2881 2593 2274 2987 2148 3213 29...
output:
1820886 396 1000 1 3000
result:
ok 5 number(s): "1820886 396 1000 1 3000"
Test #127:
score: 10
Accepted
time: 8ms
memory: 49124kb
input:
3456 2345 5679 1372 1787 781 4671 5075 1678 2315 2332 4691 1138 2445 1192 2765 4975 911 2279 1871 2093 284 2102 2081 1041 1485 5796 2507 4428 5211 2845 818 3022 3168 2301 5543 736 4652 5257 429 2747 670 3651 2789 3631 1276 860 576 2453 1434 2204 5548 979 2963 4280 5072 4528 2101 1990 745 1324 1534 1...
output:
212026017 1 3456 687 689
result:
ok 5 number(s): "212026017 1 3456 687 689"
Test #128:
score: 10
Accepted
time: 4ms
memory: 50888kb
input:
2000 3000 429 1783 3150 482 3891 2776 1989 2854 3244 493 2529 4436 2177 2393 360 1631 1746 4119 2000 3427 1569 1567 1234 315 2225 4913 3379 2723 362 4295 1661 1319 1969 4707 4195 4757 1624 2378 3576 4935 1122 3581 4490 1304 3628 2091 2586 3333 1651 299 160 1804 2183 1925 4959 4524 921 3134 2656 2869...
output:
2262203 1 1502 1 3000
result:
ok 5 number(s): "2262203 1 1502 1 3000"
Test #129:
score: 10
Accepted
time: 6ms
memory: 45532kb
input:
3456 3345 346 722 1525 3045 6701 659 2742 1410 2262 5949 1212 3815 3517 5873 4445 2144 4201 15 5100 1640 3892 843 6529 3389 4839 725 1039 3675 2228 3531 5938 6603 6599 1713 2596 2443 4001 1958 373 6341 68 4621 3390 3606 1586 2083 4055 2792 1769 6393 5205 1180 41 5122 268 2440 3024 5861 4715 6462 115...
output:
213836228 1 3456 2485 2485
result:
ok 5 number(s): "213836228 1 3456 2485 2485"
Test #130:
score: 10
Accepted
time: 8ms
memory: 45648kb
input:
5000 5000 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 10...
output:
2538697954450 1 3291 1 1709
result:
ok 5 number(s): "2538697954450 1 3291 1 1709"
Test #131:
score: 10
Accepted
time: 8ms
memory: 45660kb
input:
5000 5000 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 10...
output:
2536324896931 3193 5000 1 3192
result:
ok 5 number(s): "2536324896931 3193 5000 1 3192"
Test #132:
score: 10
Accepted
time: 6ms
memory: 47448kb
input:
5000 3729 3729 3730 3728 3727 3726 3731 3725 3724 3723 3732 3722 3721 3720 3733 3719 3718 3717 3734 3716 3715 3714 3735 3713 3712 3711 3736 3710 3709 3708 3737 3707 3706 3738 3705 3704 3703 3739 3702 3701 3700 3740 3699 3698 3697 3741 3696 3695 3694 3742 3693 3692 3691 3743 3690 3689 3688 3744 3687 ...
output:
2507965452889 1 4998 1 2
result:
ok 5 number(s): "2507965452889 1 4998 1 2"
Test #133:
score: 10
Accepted
time: 6ms
memory: 45632kb
input:
5000 5000 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 10...
output:
10000000000000 1 5000 1 5000
result:
ok 5 number(s): "10000000000000 1 5000 1 5000"
Test #134:
score: 10
Accepted
time: 14ms
memory: 48956kb
input:
10000 10000 1 9998 2 9997 3 9996 4 9995 5 9994 6 9993 7 9992 8 9991 9 9990 10 9989 11 9988 12 9987 13 9986 14 9985 15 9984 16 9983 17 9982 18 9981 19 9980 20 9979 21 9978 22 9977 23 9976 24 9975 25 9974 26 9973 27 9972 28 9971 29 9970 30 9969 31 9968 32 9967 33 9966 34 9965 35 9964 36 9963 37 9962 3...
output:
6661835429695 2039 7958 2962 7039
result:
ok 5 number(s): "6661835429695 2039 7958 2962 7039"
Test #135:
score: 10
Accepted
time: 12ms
memory: 49844kb
input:
10000 10000 14760 13711 15732 15299 13883 17323 16609 16013 14195 12003 18759 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 ...
output:
19164 12 9991 222 9405
result:
ok 5 number(s): "19164 12 9991 222 9405"
Test #136:
score: 10
Accepted
time: 12ms
memory: 46420kb
input:
10000 6000 13558 11905 13700 9590 13232 14168 14612 13014 12311 9554 10598 11941 14284 10636 9994 13965 12648 13881 13181 11304 13742 14492 10163 10950 10877 10107 10693 13271 14507 13163 14466 11560 11647 13065 11263 12841 10009 13217 14333 9814 11772 12288 14243 13976 9727 13783 9842 11073 13839 1...
output:
14613 111 9500 333 5555
result:
ok 5 number(s): "14613 111 9500 333 5555"
Test #137:
score: 10
Accepted
time: 11ms
memory: 51224kb
input:
10000 10000 11200 17290 18392 14484 13352 18669 13408 17612 14055 18381 16974 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 ...
output:
19163040609444 12 9991 222 9405
result:
ok 5 number(s): "19163040609444 12 9991 222 9405"
Test #138:
score: 10
Accepted
time: 10ms
memory: 51188kb
input:
10000 6000 12873 12694 10492 11947 10797 12695 13943 14383 9990 14243 14022 14158 13881 11150 14073 9507 11714 13927 11108 14286 10973 13437 12749 10361 9691 14396 12872 14551 13390 13709 12669 10463 12330 11746 11243 14552 14092 9997 11872 12796 14444 13072 12834 12463 10882 9405 12017 10225 14538 ...
output:
14612095070460 111 9500 333 5555
result:
ok 5 number(s): "14612095070460 111 9500 333 5555"
Test #139:
score: 10
Accepted
time: 17ms
memory: 54068kb
input:
10000 10000 10941 5721 9923 7818 9235 3843 6172 8276 3562 10617 10062 8580 2782 4899 5133 9622 2374 3991 4230 7269 5608 6620 4080 2711 7655 2161 9162 2112 5350 4717 5010 4906 6642 4342 7178 3127 6134 8943 8677 8570 3990 2272 4075 3945 5291 6012 8253 5883 9651 9406 9716 8382 6102 8331 10780 8053 8745...
output:
11063445864451 8112 9991 222 9405
result:
ok 5 number(s): "11063445864451 8112 9991 222 9405"
Test #140:
score: 10
Accepted
time: 14ms
memory: 53820kb
input:
10000 6000 10738 11476 10761 10218 10323 11218 10417 9453 11455 11262 10371 9851 9823 10020 10849 10478 9963 10527 11302 10243 10975 9660 10468 10718 9535 10820 9620 9951 10982 10523 10855 11028 10256 9646 9729 9960 11018 9860 9565 10641 10225 9637 9812 10723 10220 10686 9494 10375 10630 10217 11289...
output:
11612347714504 111 9500 3333 5555
result:
ok 5 number(s): "11612347714504 111 9500 3333 5555"
Test #141:
score: 10
Accepted
time: 15ms
memory: 46684kb
input:
10000 10000 10000 9999 9998 9997 9996 9995 9994 9993 9992 9991 9990 9989 9988 9987 9986 9985 9984 9983 9982 9981 9980 9979 9978 9977 9976 9975 9974 9973 9972 9971 9970 9969 9968 9967 9966 9965 9964 9963 9962 9961 9960 9959 9958 9957 9956 9955 9954 9953 9952 9951 9950 9949 9948 9947 9946 9945 9944 99...
output:
9833556998314 1 815 1 10000
result:
ok 5 number(s): "9833556998314 1 815 1 10000"
Test #142:
score: 10
Accepted
time: 15ms
memory: 51332kb
input:
10000 6000 9608 9606 9604 9602 9600 9598 9596 9594 9592 9590 9588 9586 9584 9582 9580 9578 9576 9574 9572 9570 9568 9566 9564 9562 9560 9558 9556 9554 9552 9550 9548 9546 9544 9542 9540 9538 9536 9534 9532 9530 9528 9526 9524 9522 9520 9518 9516 9514 9512 9510 9508 9506 9504 9502 9500 9498 9496 9494...
output:
9916505691951 1 10000 0 0
result:
ok 5 number(s): "9916505691951 1 10000 0 0"
Test #143:
score: 10
Accepted
time: 8ms
memory: 46128kb
input:
10000 10000 8544 9920 3844 14085 19620 14919 11725 13378 8581 15033 15671 16792 12784 18885 4147 17156 10243 6008 16922 141 16333 9656 13307 12985 7225 1013 14056 8546 947 10037 14774 19640 10598 14681 7237 11823 1045 12387 19241 6565 19547 6853 2727 13024 3734 16079 12341 4876 2069 12924 11105 3841...
output:
10001751873657 1 10000 1 10000
result:
ok 5 number(s): "10001751873657 1 10000 1 10000"
Test #144:
score: 10
Accepted
time: 19ms
memory: 48504kb
input:
10000 9111 10350 3982 14218 12307 4004 8370 14163 4333 17816 5338 1142 10067 9033 5765 3483 2592 18133 10326 10389 18241 13383 9734 10532 1093 5945 15817 5743 17028 6184 10116 6701 13037 16952 5090 15014 8124 16252 17521 5900 14683 13485 9971 10967 12066 12068 14339 4235 5050 2024 3638 16338 12983 1...
output:
3894421673350 1 10000 2738 2745
result:
ok 5 number(s): "3894421673350 1 10000 2738 2745"
Test #145:
score: 10
Accepted
time: 4ms
memory: 50936kb
input:
10000 1 2259 4436 9431 6187 3797 5754 9974 2226 5593 3664 5381 2170 1109 8480 6271 7933 1476 868 2789 8277 1457 5095 1026 4272 7469 4018 4032 189 58 87 534 4291 3266 2081 8413 1894 9815 689 6628 3875 1260 8686 8034 9437 2445 7493 7847 8223 2606 1458 9424 2430 6803 4902 3405 2072 7299 6935 5648 3265 ...
output:
167209918638 1 10000 0 0
result:
ok 5 number(s): "167209918638 1 10000 0 0"
Test #146:
score: 10
Accepted
time: 7ms
memory: 45832kb
input:
1 10000 849 2231597 1625 9826 5651 4562 8398 545 2404 3334 244 1526 8289 4607 362 7120 3368 5352 7173 3474 7729 6126 2678 7599 968 290 3295 1157 9496 9856 3778 337 8939 6950 9649 9524 4093 7935 5293 1959 7427 1505 8303 6444 6934 6986 2347 1792 9301 460 1348 606 7254 1127 245 475 3884 3008 6425 9094 ...
output:
55605923080 0 0 1 10000
result:
ok 5 number(s): "55605923080 0 0 1 10000"
Test #147:
score: 10
Accepted
time: 9ms
memory: 51264kb
input:
3456 5555 1702 6302 4291 3598 1678 4426 3915 6931 2800 2765 719 5874 5107 8850 1821 4679 1706 122 6459 8404 2819 2616 4469 2024 65 4627 4517 7410 7014 3911 8645 1337 8330 8251 5971 8111 1521 700 1771 6913 2611 8074 2798 3169 1571 2425 4270 2511 1765 448 2789 7734 2037 412 6972 8082 2378 3092 214 455...
output:
33918620473 1977 1983 1 5555
result:
ok 5 number(s): "33918620473 1977 1983 1 5555"
Test #148:
score: 10
Accepted
time: 6ms
memory: 46360kb
input:
2456 5555 658 492 966 3589 3585 6083 5026 3280 1966 5989 4001 6702 6974 5364 2910 3223 6663 1421 6948 5726 7545 2424 3309 7759 2093 114 238 7763 5586 449 4774 5148 5964 481 5723 3683 968 7944 1232 5191 1656 7114 7963 2716 6988 7237 6813 2775 4925 5910 5347 2926 1125 3838 766 3950 4201 2772 7408 320 ...
output:
34351868752 1160 1175 1 5555
result:
ok 5 number(s): "34351868752 1160 1175 1 5555"
Test #149:
score: 10
Accepted
time: 16ms
memory: 48236kb
input:
8888 7777 10142 7074 2801 5857 14209 10403 11997 1988 8883 3867 5616 3528 9396 1659 9141 1269 875 10405 4825 12681 16126 14596 13318 12117 16290 15678 11651 4099 297 16237 5601 4840 16521 16244 4745 2866 5818 6412 9892 8373 14676 15025 9293 15132 15084 12962 11290 5161 10817 4034 2824 9020 12298 695...
output:
54213916892 1 8888 6221 6228
result:
ok 5 number(s): "54213916892 1 8888 6221 6228"
Test #150:
score: 10
Accepted
time: 11ms
memory: 54100kb
input:
8888 9999 9507 4017 8732 2875 11371 8291 986 1078 17926 15935 12297 7127 13903 9573 2566 13009 7199 17539 14318 11430 13046 10744 16638 10101 4262 16619 14923 18163 14011 16633 16587 6528 15087 6236 13413 2237 9326 2500 4382 2867 12652 10232 17211 3218 3659 12625 12522 8700 15310 531 13523 1187 5308...
output:
62527818768 2173 2238 1 9999
result:
ok 5 number(s): "62527818768 2173 2238 1 9999"
Test #151:
score: 10
Accepted
time: 19ms
memory: 53752kb
input:
10000 9999 7926 10967 9136 1469 17151 4571 9729 18271 4133 10381 6673 13608 1264 15153 5905 2831 15814 13844 4942 9279 10211 4026 317 6297 4565 6274 12941 12281 19446 4367 5152 12090 15426 320 1699 5417 12133 2770 17962 13151 3926 19205 6643 5801 7777 789 15247 12077 9663 18924 15704 2521 13410 8996...
output:
61867891162 2395 2398 1 9999
result:
ok 5 number(s): "61867891162 2395 2398 1 9999"
Test #152:
score: 10
Accepted
time: 4ms
memory: 50840kb
input:
3456 55 976 2315 755 1523 2704 2713 2177 3187 709 1590 2852 2610 3153 1348 3354 543 1923 712 2503 1722 2515 792 3225 975 2412 152 563 96 1162 1878 3475 3184 2462 1733 2664 1990 1739 204 1742 72 3051 1049 1686 132 711 3050 3340 3248 1419 1663 855 1349 458 552 1578 1638 91 2920 3470 1356 1414 1702 277...
output:
21460521595 1 3456 34 50
result:
ok 5 number(s): "21460521595 1 3456 34 50"
Subtask #7:
score: 10
Accepted
Dependency #1:
100%
Accepted
Dependency #2:
100%
Accepted
Dependency #3:
100%
Accepted
Dependency #4:
100%
Accepted
Dependency #5:
100%
Accepted
Dependency #6:
100%
Accepted
Test #153:
score: 10
Accepted
time: 11ms
memory: 46432kb
input:
10000 10000 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 ...
output:
5006542157702 1 4683 1 5317
result:
ok 5 number(s): "5006542157702 1 4683 1 5317"
Test #154:
score: 10
Accepted
time: 14ms
memory: 48684kb
input:
10000 10000 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 ...
output:
5053489917562 1 641 642 10000
result:
ok 5 number(s): "5053489917562 1 641 642 10000"
Test #155:
score: 10
Accepted
time: 12ms
memory: 53636kb
input:
10000 9729 9729 9728 9727 9726 9725 9724 9723 9722 9721 9720 9719 9718 9717 9716 9715 9714 9713 9730 9712 9711 9710 9709 9708 9707 9706 9705 9704 9703 9702 9701 9700 9699 9698 9697 9696 9695 9694 9693 9692 9691 9690 9689 9688 9687 9686 9685 9684 9683 9682 9681 9680 9679 9678 9677 9731 9676 9675 9674...
output:
5036139814787 1 9512 1 475
result:
ok 5 number(s): "5036139814787 1 9512 1 475"
Test #156:
score: 10
Accepted
time: 10ms
memory: 48584kb
input:
10000 10000 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 ...
output:
20000000000000 1 10000 1 10000
result:
ok 5 number(s): "20000000000000 1 10000 1 10000"
Subtask #8:
score: 10
Accepted
Dependency #1:
100%
Accepted
Dependency #2:
100%
Accepted
Dependency #3:
100%
Accepted
Dependency #4:
100%
Accepted
Dependency #5:
100%
Accepted
Dependency #6:
100%
Accepted
Dependency #7:
100%
Accepted
Test #157:
score: 10
Accepted
time: 40ms
memory: 55856kb
input:
30000 30000 1 29998 2 29997 3 29996 4 29995 5 29994 6 29993 7 29992 8 29991 9 29990 10 29989 11 29988 12 29987 13 29986 14 29985 15 29984 16 29983 17 29982 18 29981 19 29980 20 29979 21 29978 22 29977 23 29976 24 29975 25 29974 26 29973 27 29972 28 29971 29 29970 30 29969 31 29968 32 29967 33 29966 ...
output:
19997503809158 6507 23490 8494 21507
result:
ok 5 number(s): "19997503809158 6507 23490 8494 21507"
Test #158:
score: 10
Accepted
time: 28ms
memory: 53148kb
input:
30000 30000 33676 41806 55530 31935 53695 40308 33646 56701 43616 28373 45125 56756 55342 51586 29402 34666 29070 43950 29287 31765 29251 39663 47195 48433 46624 39083 48952 51224 28518 31790 34343 38202 38825 43795 46942 57151 45915 51657 39710 55642 41975 30172 50304 49473 39835 42342 30118 28863 ...
output:
57569 111 28000 222 29900
result:
ok 5 number(s): "57569 111 28000 222 29900"
Test #159:
score: 10
Accepted
time: 26ms
memory: 54812kb
input:
30000 26000 40173 32051 46387 31113 40191 38832 44608 51088 34779 30453 46679 38643 42270 35670 48580 53076 35828 51457 45967 52253 34301 51747 47475 43408 47607 49285 44448 50969 31448 41068 29669 43025 39246 50964 43113 39960 41015 38472 38834 42019 47321 51406 31245 53822 43823 44917 37552 46004 ...
output:
54069 1111 29500 222 25900
result:
ok 5 number(s): "54069 1111 29500 222 25900"
Test #160:
score: 10
Accepted
time: 29ms
memory: 55436kb
input:
30000 30000 47974 28966 42433 43855 45299 31975 40775 35337 50618 48367 38612 56483 29497 47794 35998 33811 32924 34026 49827 39380 52078 54844 53324 53996 33345 56260 45466 53611 48638 32641 44596 39915 38029 48733 34724 52057 35206 55639 34066 42354 39629 44262 55055 42398 52757 49421 28800 44737 ...
output:
57568040026012 111 28000 222 29900
result:
ok 5 number(s): "57568040026012 111 28000 222 29900"
Test #161:
score: 10
Accepted
time: 27ms
memory: 59664kb
input:
30000 26000 50779 37158 43294 49790 43772 50947 53855 46159 44914 37374 40532 40125 53124 53119 40552 40506 35605 30883 42447 30927 36446 49835 28419 50495 40744 47658 46430 30496 31888 48705 40817 39213 32383 46310 47412 46456 52758 40146 44055 43254 32783 51380 53636 37858 40348 30790 34793 42620 ...
output:
54068032983669 1111 29500 222 25900
result:
ok 5 number(s): "54068032983669 1111 29500 222 25900"
Test #162:
score: 10
Accepted
time: 38ms
memory: 52636kb
input:
30000 30000 18580 26611 44542 44844 28459 20946 42073 36918 29444 24668 41027 29463 31295 23432 30027 41109 37758 17127 18542 35212 29742 21390 23254 32755 29328 35131 20200 27528 45473 27938 38047 18465 35593 28756 32311 44763 43312 40481 30292 36682 44082 45633 44527 43615 25397 36186 32253 18801 ...
output:
46568226246359 11111 28000 222 29900
result:
ok 5 number(s): "46568226246359 11111 28000 222 29900"
Test #163:
score: 10
Accepted
time: 21ms
memory: 52412kb
input:
30000 26000 228 1063 2030 1976 2123 1503 299 749 2147 1950 3376 2659 2883 2552 979 1039 2565 1531 2352 2429 2771 3279 3168 1575 2471 1951 1294 83 24 401 2508 2826 1550 2622 561 2693 2427 840 1775 1434 944 2073 1716 1364 605 2673 1053 2148 1613 3045 3035 1518 744 644 3031 1586 1935 1041 1580 2204 211...
output:
9259584783919 3581 30000 1 26000
result:
ok 5 number(s): "9259584783919 3581 30000 1 26000"
Test #164:
score: 10
Accepted
time: 47ms
memory: 56004kb
input:
30000 26000 30000 29999 29998 29997 29996 29995 29994 29993 29992 29991 29990 29989 29988 29987 29986 29985 29984 29983 29982 29981 29980 29979 29978 29977 29976 29975 29974 29973 29972 29971 29970 29969 29968 29967 29966 29965 29964 29963 29962 29961 29960 29959 29958 29957 29956 29955 29954 29953 ...
output:
29166527859479 1 30000 0 0
result:
ok 5 number(s): "29166527859479 1 30000 0 0"
Test #165:
score: 10
Accepted
time: 19ms
memory: 49876kb
input:
30000 30000 22067 30652 27252 35793 11520 20957 29248 33753 24698 53701 20272 55697 19418 41569 3476 7617 19342 25928 12588 45007 39790 44874 48842 8206 55583 29190 8593 59157 58029 13215 21394 3641 7789 807 49572 28210 1739 27374 40253 53182 22010 11044 16540 15850 29922 8212 54698 26179 29496 5941...
output:
29937599965114 1 30000 1 30000
result:
ok 5 number(s): "29937599965114 1 30000 1 30000"
Test #166:
score: 10
Accepted
time: 62ms
memory: 51692kb
input:
30000 29111 32559 1249 17958 11949 22800 8186 5584 37835 12420 54360 45774 34900 39267 43711 18419 40493 46306 31829 6713 19013 6585 45631 54138 30617 12861 46848 41158 50563 7503 55353 57252 28989 42338 58805 41248 23912 34480 56811 38825 40999 1082 32306 35671 30007 20888 10559 23441 4698 9674 413...
output:
11631072511031 1 30000 13413 13420
result:
ok 5 number(s): "11631072511031 1 30000 13413 13420"
Test #167:
score: 10
Accepted
time: 11ms
memory: 51664kb
input:
30000 1 27345 3214 12110 24561 21541 15873 10567 15017 16371 7059 11468 25041 24645 17231 16473 19614 15096 12985 17863 21303 12999 26648 2388 24591 14317 10788 19236 20841 25770 29204 13645 11286 28208 20363 1484 21759 1786 8301 15860 26151 28293 18759 24866 17185 26508 6827 6844 19949 17435 25467 ...
output:
497612009764 1 30000 0 0
result:
ok 5 number(s): "497612009764 1 30000 0 0"
Test #168:
score: 10
Accepted
time: 12ms
memory: 51748kb
input:
1 30000 28397 9235378 11553 4799 25647 25856 297 10324 13820 29068 18402 3299 19991 13542 5974 29338 25917 10576 12635 23756 14164 2195 5631 13437 5012 17021 7770 11976 11797 3680 15351 9208 449 5407 26960 27523 8269 3701 26030 17903 3940 26714 4086 28691 27910 15581 24000 29783 5112 24608 5268 1412...
output:
166810331525 0 0 1 30000
result:
ok 5 number(s): "166810331525 0 0 1 30000"
Test #169:
score: 10
Accepted
time: 26ms
memory: 54928kb
input:
30000 30000 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 ...
output:
15040777565362 1 178 1 29822
result:
ok 5 number(s): "15040777565362 1 178 1 29822"
Test #170:
score: 10
Accepted
time: 26ms
memory: 52476kb
input:
30000 30000 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 ...
output:
15117600947067 17833 30000 1 17832
result:
ok 5 number(s): "15117600947067 17833 30000 1 17832"
Test #171:
score: 10
Accepted
time: 29ms
memory: 59644kb
input:
30000 29729 29729 29728 29727 29726 29725 29724 29723 29722 29721 29720 29719 29718 29717 29716 29715 29714 29713 29712 29711 29710 29709 29708 29707 29706 29705 29704 29703 29702 29701 29700 29699 29698 29697 29696 29695 29694 29693 29692 29691 29690 29689 29688 29687 29686 29685 29684 29683 29682 ...
output:
15015012642985 1 11307 1 18524
result:
ok 5 number(s): "15015012642985 1 11307 1 18524"
Test #172:
score: 10
Accepted
time: 19ms
memory: 56704kb
input:
30000 30000 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 ...
output:
60000000000000 1 30000 1 30000
result:
ok 5 number(s): "60000000000000 1 30000 1 30000"
Subtask #9:
score: 10
Accepted
Dependency #1:
100%
Accepted
Dependency #2:
100%
Accepted
Dependency #3:
100%
Accepted
Dependency #4:
100%
Accepted
Dependency #5:
100%
Accepted
Dependency #6:
100%
Accepted
Dependency #7:
100%
Accepted
Dependency #8:
100%
Accepted
Test #173:
score: 10
Accepted
time: 144ms
memory: 78108kb
input:
100000 100000 1 99998 2 99997 3 99996 4 99995 5 99994 6 99993 7 99992 8 99991 9 99990 10 99989 11 99988 12 99987 13 99986 14 99985 15 99984 16 99983 17 99982 18 99981 19 99980 20 99979 21 99978 22 99977 23 99976 24 99975 25 99974 26 99973 27 99972 28 99971 29 99970 30 99969 31 99968 32 99967 33 9996...
output:
66660325982108 17282 82715 32718 67281
result:
ok 5 number(s): "66660325982108 17282 82715 32718 67281"
Test #174:
score: 10
Accepted
time: 74ms
memory: 73344kb
input:
100000 100000 59265 133264 43317 177536 195725 42366 162002 159502 60606 72118 180915 139823 86681 131558 133428 61551 26388 103550 174896 62718 151017 32154 104359 169783 124415 80309 172309 32256 82803 184359 91968 147788 97542 7061 163523 79366 164867 105824 197316 113149 186557 151704 171112 506...
output:
99983699513219 1 100000 1 100000
result:
ok 5 number(s): "99983699513219 1 100000 1 100000"
Test #175:
score: 10
Accepted
time: 267ms
memory: 80260kb
input:
100000 99111 17000 78783 165808 173080 111757 194263 134478 195287 115082 79529 108244 162635 155687 188662 95280 134826 116440 158637 122205 97978 133077 181449 95095 162548 167278 168106 114506 63005 199002 21369 11767 101928 147879 35313 175915 96885 65811 30477 41033 42105 81084 181953 126223 38...
output:
38946659941940 1 100000 45193 45199
result:
ok 5 number(s): "38946659941940 1 100000 45193 45199"
Test #176:
score: 10
Accepted
time: 56ms
memory: 72316kb
input:
100000 1 36744 40157 51934 65023 43555 38487 536 89800 12803 14451 85856 1131 60941 73085 88098 96510 70237 20864 56204 38474 29798 97497 5383 27679 54597 8142 47877 66329 38245 88827 48193 75392 92925 23293 79762 37165 55831 52761 52840 32295 35918 59131 85831 96852 28467 28741 53731 39816 84790 27...
output:
1669058608153 1 100000 0 0
result:
ok 5 number(s): "1669058608153 1 100000 0 0"
Test #177:
score: 10
Accepted
time: 45ms
memory: 74408kb
input:
1 100000 86309 10988872 4375 35596 11852 62780 39416 2918 63600 6221 67446 83689 30971 5103 54123 15548 54429 42182 21599 77083 41704 20951 79670 56452 70157 16124 60120 75472 64970 67006 46248 24883 37080 4212 25878 23421 94853 18346 4940 26490 26648 95907 40827 5346 17408 27084 75964 16573 42950 5...
output:
555589921623 0 0 1 100000
result:
ok 5 number(s): "555589921623 0 0 1 100000"
Test #178:
score: 10
Accepted
time: 19ms
memory: 59208kb
input:
34567 5555 15331 29857 36528 404 28752 36557 34562 10742 15629 17195 25908 22613 28105 24834 12699 18583 22192 26230 24548 16992 9662 27025 28454 13686 26939 3188 28112 37713 536 8787 8199 25299 29709 173 13481 8837 38228 38967 39879 19540 6365 21076 4019 37496 21443 3202 23049 14311 33189 10029 290...
output:
214362763372 1 34567 1967 2016
result:
ok 5 number(s): "214362763372 1 34567 1967 2016"
Test #179:
score: 10
Accepted
time: 191ms
memory: 79364kb
input:
99999 55558 142343 1162 149477 90234 890 150865 58835 88554 51361 68616 111199 30414 61309 1962 89030 130837 86856 33581 76319 102554 119464 14273 43921 28345 12146 69395 98375 150933 72508 119513 54448 9178 36839 81630 134271 57749 122531 40132 50002 123528 147400 93003 10263 88805 153892 19369 142...
output:
619407413556 1 99999 47387 47390
result:
ok 5 number(s): "619407413556 1 99999 47387 47390"
Test #180:
score: 10
Accepted
time: 202ms
memory: 77068kb
input:
100000 55558 51379 69393 62700 25668 7854 135364 79498 30448 124304 24369 12356 52967 15723 100417 97062 124106 23771 33171 118005 87626 143135 21834 115141 139795 58966 101116 64305 134279 88868 61177 127047 100192 91363 69692 53282 21535 112427 49067 78626 85215 21651 37002 133092 151766 112912 13...
output:
617608428117 1 100000 14424 14427
result:
ok 5 number(s): "617608428117 1 100000 14424 14427"
Test #181:
score: 10
Accepted
time: 137ms
memory: 75592kb
input:
100000 100000 148542 128544 151710 108482 146375 104192 159478 100347 143203 158942 164359 108050 138870 177449 172110 165512 136232 148742 111963 171848 125444 97215 122397 157872 134948 91774 164401 130118 116690 108645 121936 159688 152016 98570 179054 149544 111592 133214 149991 159150 175994 10...
output:
179669 111 90000 222 90000
result:
ok 5 number(s): "179669 111 90000 222 90000"
Test #182:
score: 10
Accepted
time: 121ms
memory: 75944kb
input:
99000 90000 137718 132975 161122 91511 171873 147269 155854 119401 114633 141025 162632 89985 156305 138931 132180 89231 89064 166510 141313 100257 140222 165201 164497 118948 105739 109103 168799 153933 160961 164556 131813 121686 147675 102358 158515 169915 106768 137180 87202 150168 96063 165126 ...
output:
174233 1111 88000 222 87564
result:
ok 5 number(s): "174233 1111 88000 222 87564"
Test #183:
score: 10
Accepted
time: 141ms
memory: 76744kb
input:
100000 100000 119973 124141 177473 126981 161485 155081 120948 119575 137030 156136 96271 173366 97249 143883 113800 138945 171681 147976 146450 166023 90305 132671 155843 165671 141354 90259 153138 123958 92701 106020 134508 156894 115007 90648 152625 175586 154675 125648 161521 148646 124330 98900...
output:
179668101407546 111 90000 222 90000
result:
ok 5 number(s): "179668101407546 111 90000 222 90000"
Test #184:
score: 10
Accepted
time: 124ms
memory: 79572kb
input:
99000 90000 122225 170023 117420 99609 144641 149278 143541 151309 90814 92215 89798 169399 156984 140429 159384 112660 130985 149446 150575 142913 147262 101377 112910 100708 147677 109107 160872 134974 111812 159789 144092 111773 135400 111895 132078 93086 167355 161335 131366 96859 132661 114276 ...
output:
174232076387012 1111 88000 222 87564
result:
ok 5 number(s): "174232076387012 1111 88000 222 87564"
Test #185:
score: 10
Accepted
time: 220ms
memory: 79732kb
input:
100000 100000 100000 99999 99998 99997 99996 99995 99994 99993 99992 99991 99990 99989 99988 99987 99986 99985 99984 99983 99982 99981 99980 99979 99978 99977 99976 99975 99974 99973 99972 99971 99970 99969 99968 99967 99966 99965 99964 99963 99962 99961 99960 99959 99958 99957 99956 99955 99954 999...
output:
99834500903584 88786 88786 2 100000
result:
ok 5 number(s): "99834500903584 88786 88786 2 100000"
Test #186:
score: 10
Accepted
time: 185ms
memory: 77952kb
input:
99000 90000 95653 94437 89571 96684 90428 90822 99015 94764 95021 90859 92973 91095 99037 91664 99007 102233 89713 91307 93006 98419 97248 96791 101526 89071 98761 90660 100455 100545 96626 96729 101866 88117 92100 92167 88774 87247 100654 90352 89387 92910 94340 97125 100508 101936 88932 99116 9193...
output:
102232475524987 1111 88000 72222 87564
result:
ok 5 number(s): "102232475524987 1111 88000 72222 87564"
Test #187:
score: 10
Accepted
time: 78ms
memory: 76804kb
input:
99000 90000 99000 98999 98998 98997 98996 98995 98994 98993 98992 98991 98990 98989 98988 98987 98986 98985 98984 98983 98982 98981 98980 98979 98978 98977 98976 98975 98974 98973 98972 98971 98970 98969 98968 98967 98966 98965 98964 98963 98962 98961 98960 98959 98958 98957 98956 98955 98954 98953 ...
output:
51054367510238 1 99000 1 72220
result:
ok 5 number(s): "51054367510238 1 99000 1 72220"
Test #188:
score: 10
Accepted
time: 211ms
memory: 76356kb
input:
99000 90000 89108 89106 89104 89102 89100 89098 89096 89094 89092 89090 89088 89086 89084 89082 89080 89078 89076 89074 89072 89070 89068 89066 89064 89062 89060 89058 89056 89054 89052 89050 89048 89046 89044 89042 89040 89038 89036 89034 89032 89030 89028 89026 89024 89022 89020 89018 89016 89014 ...
output:
98166525117091 1 99000 1 3109
result:
ok 5 number(s): "98166525117091 1 99000 1 3109"
Test #189:
score: 10
Accepted
time: 57ms
memory: 72844kb
input:
100000 100000 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 9...
output:
200000000000000 1 100000 1 100000
result:
ok 5 number(s): "200000000000000 1 100000 1 100000"
Subtask #10:
score: 10
Accepted
Dependency #1:
100%
Accepted
Dependency #2:
100%
Accepted
Dependency #3:
100%
Accepted
Dependency #4:
100%
Accepted
Dependency #5:
100%
Accepted
Dependency #6:
100%
Accepted
Dependency #7:
100%
Accepted
Dependency #8:
100%
Accepted
Dependency #9:
100%
Accepted
Test #190:
score: 10
Accepted
time: 378ms
memory: 118744kb
input:
250000 250000 1 249998 2 249997 3 249996 4 249995 5 249994 6 249993 7 249992 8 249991 9 249990 10 249989 11 249988 12 249987 13 249986 14 249985 15 249984 16 249983 17 249982 18 249981 19 249980 20 249979 21 249978 22 249977 23 249976 24 249975 25 249974 26 249973 27 249972 28 249971 29 249970 30 24...
output:
166657867884398 50785 199213 74216 175784
result:
ok 5 number(s): "166657867884398 50785 199213 74216 175784"
Test #191:
score: 10
Accepted
time: 192ms
memory: 109904kb
input:
250000 250000 121826 441921 208047 1278 43033 441869 227630 384793 416306 351811 371569 418419 131964 41199 97074 459313 118453 348201 467380 82040 220838 256201 49620 487095 496746 211792 86649 284814 78127 460868 154437 364185 44068 11600 444046 264100 343185 265387 366551 415426 160481 464980 435...
output:
250127096216465 1 250000 1 250000
result:
ok 5 number(s): "250127096216465 1 250000 1 250000"
Test #192:
score: 10
Accepted
time: 634ms
memory: 119624kb
input:
250000 189111 27330 176694 12505 203744 341828 111705 78292 288274 283367 239263 248334 71110 327004 127427 372333 124293 7714 253819 95491 425792 43402 186026 153878 57940 372172 169701 244047 292764 98567 60584 127446 263368 158496 10669 108092 96003 272906 427445 96967 281664 433154 51840 94748 7...
output:
97470022178941 1 250000 27816 27821
result:
ok 5 number(s): "97470022178941 1 250000 27816 27821"
Test #193:
score: 10
Accepted
time: 120ms
memory: 100080kb
input:
250000 1 246122 90297 181857 239446 249381 93941 9247 207049 129901 68896 71461 37775 54525 198003 109055 130739 120888 39813 181915 145344 118793 62621 91953 48208 39563 249903 45646 146126 212166 189036 10243 20600 167818 147165 36015 103389 182664 29731 3858 148850 111817 53054 141346 16013 18009...
output:
4171882956890 1 250000 0 0
result:
ok 5 number(s): "4171882956890 1 250000 0 0"
Test #194:
score: 10
Accepted
time: 100ms
memory: 99396kb
input:
1 250000 38906 6840982 163628 103924 55860 240187 236897 185816 176800 197497 220681 187491 6493 238125 5371 127524 133539 174868 243780 200592 184041 176708 57052 199454 103614 42501 8288 8841 178864 129482 65193 97878 114886 229960 63220 138289 34716 190389 224202 3720 115064 135627 217894 106063 ...
output:
1388028697603 0 0 1 250000
result:
ok 5 number(s): "1388028697603 0 0 1 250000"
Test #195:
score: 10
Accepted
time: 270ms
memory: 110876kb
input:
250000 250000 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 9...
output:
125175252823704 213171 250000 36831 250000
result:
ok 5 number(s): "125175252823704 213171 250000 36831 250000"
Test #196:
score: 10
Accepted
time: 254ms
memory: 112952kb
input:
250000 250000 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 9...
output:
125119751432346 46631 250000 1 46630
result:
ok 5 number(s): "125119751432346 46631 250000 1 46630"
Test #197:
score: 10
Accepted
time: 194ms
memory: 107028kb
input:
250000 129729 129730 129729 129731 129728 129732 129727 129733 129726 129734 129725 129735 129724 129723 129736 129722 129737 129721 129738 129720 129739 129719 129740 129718 129741 129717 129742 129716 129743 129715 129744 129714 129745 129713 129746 129712 129747 129711 129748 129710 129709 129749...
output:
125246271257663 1 250000 0 0
result:
ok 5 number(s): "125246271257663 1 250000 0 0"
Test #198:
score: 10
Accepted
time: 374ms
memory: 118036kb
input:
250000 250000 405366 306909 287286 391087 364438 327483 373932 435301 320598 399185 421567 433070 230093 370935 262408 223955 364192 263392 437577 404948 314162 382990 414492 445507 336453 337612 343367 385460 389035 298635 242023 374277 353134 415218 338172 442477 344291 322050 229045 239716 354213...
output:
447929 456 221919 6465 232929
result:
ok 5 number(s): "447929 456 221919 6465 232929"
Test #199:
score: 10
Accepted
time: 311ms
memory: 120312kb
input:
220000 250000 405168 232994 209667 354733 246074 210672 326166 220540 342442 276565 203567 275400 403442 282457 363166 307996 237220 420363 333548 352604 289862 362701 423095 346460 393128 399442 299378 325572 351776 354726 281970 243521 316573 267003 386864 237344 218134 210741 247949 205838 356592...
output:
425929 2456 201919 16465 242929
result:
ok 5 number(s): "425929 2456 201919 16465 242929"
Test #200:
score: 10
Accepted
time: 387ms
memory: 118072kb
input:
250000 250000 330565 268700 357944 413836 322316 444888 409882 278461 247854 331521 266060 272909 259715 269321 257806 430605 222691 404679 322805 422060 405710 332385 287543 376076 334226 272735 353396 339968 420466 383096 443810 415889 315204 416654 347734 339724 377622 329807 260962 412498 319269...
output:
447928102246168 456 221919 6465 232929
result:
ok 5 number(s): "447928102246168 456 221919 6465 232929"
Test #201:
score: 10
Accepted
time: 322ms
memory: 117880kb
input:
220000 250000 226123 211548 386646 207118 391173 314810 311618 226187 334267 295474 200408 362308 266035 364157 286844 251575 208308 300780 262657 252375 210808 234327 212806 275795 285797 299857 273965 204945 385819 358813 393557 299197 324755 260527 418931 243519 350034 203917 268343 362223 336847...
output:
425928091924986 2456 201919 16465 242929
result:
ok 5 number(s): "425928091924986 2456 201919 16465 242929"
Test #202:
score: 10
Accepted
time: 382ms
memory: 118064kb
input:
250000 250000 319479 259087 245712 271687 356111 324173 418969 304423 266603 227586 229297 347857 363549 333451 377477 254498 249188 297968 281467 295856 245164 306620 445655 443524 259413 243985 319017 390030 379438 426794 412056 292985 388599 243338 431747 424774 368034 299129 422456 246061 248294...
output:
447928102751257 6465 232929 456 221919
result:
ok 5 number(s): "447928102751257 6465 232929 456 221919"
Test #203:
score: 10
Accepted
time: 592ms
memory: 120908kb
input:
220000 250000 224876 125014 103659 109353 155477 97206 97230 177693 9539 75960 202767 93672 5973 219392 12634 161938 99091 227441 66042 45001 106552 205993 188585 191597 151894 154276 219290 55273 112928 6417 199400 70912 110818 98962 203750 160136 167662 177298 137579 216481 161645 152860 91315 598...
output:
237651549418485 0 0 1 250000
result:
ok 5 number(s): "237651549418485 0 0 1 250000"
Test #204:
score: 10
Accepted
time: 138ms
memory: 109088kb
input:
220000 250000 220000 219999 219998 219997 219996 219995 219994 219993 219992 219991 219990 219989 219988 219987 219986 219985 219984 219983 219982 219981 219980 219979 219978 219977 219976 219975 219974 219973 219972 219971 219970 219969 219968 219967 219966 219965 219964 219963 219962 219961 219960...
output:
75007629219805 1 220000 16466 250000
result:
ok 5 number(s): "75007629219805 1 220000 16466 250000"
Test #205:
score: 10
Accepted
time: 611ms
memory: 121824kb
input:
220000 250000 41472 200982 58192 46890 19337 81068 5250 65944 131514 95496 26219 48955 133217 67247 66110 108516 217729 224132 14986 70686 144707 176660 47104 76132 113167 77395 119092 184979 138397 119420 6015 167663 221909 204202 59955 65551 149758 139999 154379 39399 5641 208956 114548 158625 144...
output:
237651549767845 0 0 1 250000
result:
ok 5 number(s): "237651549767845 0 0 1 250000"
Test #206:
score: 10
Accepted
time: 142ms
memory: 110656kb
input:
250000 250000 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 9...
output:
500000000000000 1 250000 1 250000
result:
ok 5 number(s): "500000000000000 1 250000 1 250000"
Subtask #11:
score: 0
Time Limit Exceeded
Dependency #1:
100%
Accepted
Dependency #2:
100%
Accepted
Dependency #3:
100%
Accepted
Dependency #4:
100%
Accepted
Dependency #5:
100%
Accepted
Dependency #6:
100%
Accepted
Dependency #7:
100%
Accepted
Dependency #8:
100%
Accepted
Dependency #9:
100%
Accepted
Dependency #10:
100%
Accepted
Test #207:
score: 10
Accepted
time: 824ms
memory: 175324kb
input:
500000 500000 1 499998 2 499997 3 499996 4 499995 5 499994 6 499993 7 499992 8 499991 9 499990 10 499989 11 499988 12 499987 13 499986 14 499985 15 499984 16 499983 17 499982 18 499981 19 499980 20 499979 21 499978 22 499977 23 499976 24 499975 25 499974 26 499973 27 499972 28 499971 29 499970 30 49...
output:
333321682983611 118275 381724 131727 368274
result:
ok 5 number(s): "333321682983611 118275 381724 131727 368274"
Test #208:
score: 10
Accepted
time: 488ms
memory: 149312kb
input:
300000 300000 1 299998 2 299997 3 299996 4 299995 5 299994 6 299993 7 299992 8 299991 9 299990 10 299989 11 299988 12 299987 13 299986 14 299985 15 299984 16 299983 17 299982 18 299981 19 299980 20 299979 21 299978 22 299977 23 299976 24 299975 25 299974 26 299973 27 299972 28 299971 29 299970 30 29...
output:
199993010450222 57767 242232 92235 207766
result:
ok 5 number(s): "199993010450222 57767 242232 92235 207766"
Test #209:
score: 10
Accepted
time: 633ms
memory: 148412kb
input:
200000 300000 204089 336576 32335 435678 446427 256447 191657 487241 145645 229548 302014 278888 131350 4962 477074 423386 446110 46468 222910 247537 260282 144257 178309 431960 489999 72073 441752 3481 258503 245030 418170 225585 253595 350232 237959 149037 89159 271921 383658 174312 353585 159941 ...
output:
149949981713784 153297 153311 1 300000
result:
ok 5 number(s): "149949981713784 153297 153311 1 300000"
Test #210:
score: 10
Accepted
time: 307ms
memory: 153712kb
input:
200000 300000 357970 326883 381036 381102 450649 306115 228012 385074 434395 399526 307810 399342 464033 454074 256927 417748 231396 464884 424193 225264 195771 235586 439089 300945 220280 338332 439547 288141 448873 407669 468254 442854 319444 386798 423418 451550 437026 441230 336517 187566 424403...
output:
472817054655803 4567 191919 7465 292929
result:
ok 5 number(s): "472817054655803 4567 191919 7465 292929"
Test #211:
score: 10
Accepted
time: 596ms
memory: 154712kb
input:
318759 315131 19318 168462 132423 532724 243956 411597 238629 192421 58750 150825 466201 424637 422916 260236 548282 193085 13221 12999 399376 547237 98472 133201 510852 343704 193519 413726 350970 162826 387399 224841 137706 507954 449567 127228 152839 165878 594297 511743 349109 189143 629646 1912...
output:
78473183868459 1 318759 153463 153502
result:
ok 5 number(s): "78473183868459 1 318759 153463 153502"
Test #212:
score: 10
Accepted
time: 947ms
memory: 161800kb
input:
339255 335887 48180 50330 8965 28127 124906 91187 484173 544598 152456 655797 495841 224115 467540 25749 601759 15642 665607 496634 354451 530536 343033 599466 501367 445726 290411 60783 534878 544610 59093 458067 330022 159469 25134 456768 83570 518170 344939 460945 196620 185284 383013 482132 1314...
output:
13482526633218 1 339255 247596 247609
result:
ok 5 number(s): "13482526633218 1 339255 247596 247609"
Test #213:
score: 10
Accepted
time: 693ms
memory: 159356kb
input:
349561 352853 189397 224042 456857 172541 489659 418267 677528 665480 415448 538703 49357 264048 49572 320784 319278 258133 498026 232758 51382 294103 155076 479659 359728 616036 363021 687614 262788 438913 65852 171914 119063 7323 94059 589563 626097 485396 191280 456559 62569 377646 687819 494736 ...
output:
74856840236430 231892 231937 1 352853
result:
ok 5 number(s): "74856840236430 231892 231937 1 352853"
Test #214:
score: 10
Accepted
time: 1132ms
memory: 167484kb
input:
376626 376495 539003 70497 533055 598724 292903 437187 274773 437786 711921 221209 429484 530355 2763 367242 683390 35218 289544 639410 13016 515906 186154 190907 201202 68826 419257 619559 90995 116761 532503 353408 160637 205704 182362 419558 241540 455760 302124 556451 12814 340316 456678 241267 ...
output:
76247686250866 101591 101603 1 376495
result:
ok 5 number(s): "76247686250866 101591 101603 1 376495"
Test #215:
score: 10
Accepted
time: 748ms
memory: 166908kb
input:
383214 385015 594769 177887 670770 123956 378169 414581 761204 158287 732280 581497 396540 274328 309150 96799 367589 364444 144075 318596 172293 425477 445076 178645 337092 752104 381672 203025 464148 395678 272650 141708 582642 232779 168458 84773 13738 226533 440962 333240 582649 717362 117365 27...
output:
164283461100982 164843 164889 1 385015
result:
ok 5 number(s): "164283461100982 164843 164889 1 385015"
Test #216:
score: 10
Accepted
time: 643ms
memory: 166904kb
input:
409143 412929 259716 697335 294336 472470 608134 365167 462637 407666 127461 439529 11991 123645 470397 39078 97794 526548 719096 453385 692289 364024 586845 187043 115526 127165 130328 284291 95713 75524 594208 450693 176178 147610 460023 482245 393066 617513 456931 301055 633397 436284 389852 1832...
output:
46860618996751 249847 249988 1 412929
result:
ok 5 number(s): "46860618996751 249847 249988 1 412929"
Test #217:
score: 10
Accepted
time: 918ms
memory: 172392kb
input:
427305 426622 493109 695444 621685 769983 219442 634106 463321 143924 477425 816168 758875 389960 671653 161080 331617 308397 585129 801897 768613 302650 745561 319031 466037 330919 813056 780148 173496 143930 319992 631421 115100 848238 501660 439304 611489 73988 568489 11957 688843 615114 399865 4...
output:
107326903286302 1 427305 301279 301316
result:
ok 5 number(s): "107326903286302 1 427305 301279 301316"
Test #218:
score: 10
Accepted
time: 1563ms
memory: 173968kb
input:
445851 442565 654118 858010 836691 697427 419842 46429 867927 18129 35098 645674 558623 289652 217547 663971 795338 41959 834927 749519 382407 535496 308411 127180 677065 418547 878751 634864 705139 323279 746105 211290 551633 195730 340324 673968 758673 680299 842774 13859 611989 2438 634119 116538...
output:
62450665948979 1 445851 162030 162034
result:
ok 5 number(s): "62450665948979 1 445851 162030 162034"
Test #219:
score: 10
Accepted
time: 720ms
memory: 172416kb
input:
471998 474910 344659 886215 733579 38208 840330 764547 399511 36685 84991 474949 692157 643713 451075 864649 478265 516029 169405 176576 635996 172122 599077 284793 331978 752127 173966 81519 55267 61368 846497 944076 288565 931775 853812 346892 91547 32253 114238 787245 558978 549991 326550 774994 ...
output:
133087258650505 392256 392472 1 474910
result:
ok 5 number(s): "133087258650505 392256 392472 1 474910"
Test #220:
score: 10
Accepted
time: 678ms
memory: 172704kb
input:
487108 493152 337779 798405 661779 962292 920971 304300 334294 835482 514788 633544 712059 313974 566156 735933 316830 710642 136918 240272 425332 497941 433439 741094 462265 409041 687999 305636 659563 860793 426953 391515 978713 476246 963410 37517 200358 468791 523977 41426 418455 908749 342243 2...
output:
119015588198183 434604 436570 1 493152
result:
ok 5 number(s): "119015588198183 434604 436570 1 493152"
Test #221:
score: 10
Accepted
time: 522ms
memory: 159420kb
input:
450000 450000 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 9...
output:
225186067269288 149743 450000 300259 450000
result:
ok 5 number(s): "225186067269288 149743 450000 300259 450000"
Test #222:
score: 10
Accepted
time: 506ms
memory: 154424kb
input:
450000 450000 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 9...
output:
225207133657689 303523 450000 1 303522
result:
ok 5 number(s): "225207133657689 303523 450000 1 303522"
Test #223:
score: 10
Accepted
time: 359ms
memory: 154460kb
input:
450000 229729 229730 229729 229731 229728 229732 229727 229733 229726 229734 229725 229735 229724 229736 229723 229737 229722 229738 229721 229739 229720 229740 229719 229741 229718 229717 229742 229716 229743 229715 229744 229714 229745 229713 229746 229712 229747 229711 229748 229710 229749 229709...
output:
225227762669615 1 450000 0 0
result:
ok 5 number(s): "225227762669615 1 450000 0 0"
Test #224:
score: 10
Accepted
time: 654ms
memory: 172360kb
input:
500000 500000 583322 893457 821633 877326 747827 682108 879663 826796 487510 802680 528634 886099 588574 656890 904892 606182 819460 576565 846247 607170 476160 650786 807216 511295 939575 902484 500278 756497 748603 822566 749104 881242 770954 738051 528976 804807 642201 586426 780828 755097 859543...
output:
945726 123 456789 4567 493625
result:
ok 5 number(s): "945726 123 456789 4567 493625"
Test #225:
score: 10
Accepted
time: 669ms
memory: 171684kb
input:
500000 500000 719074 669326 646037 581368 657354 636295 587507 878328 747562 737623 940472 499727 657149 506926 734000 860329 628370 834530 945380 823823 463431 776579 632495 486778 778310 860363 942532 785820 884127 513054 751338 490383 636706 871103 627382 600925 463427 769742 493304 891135 586552...
output:
945725054315926 123 456789 4567 493625
result:
ok 5 number(s): "945725054315926 123 456789 4567 493625"
Test #226:
score: 10
Accepted
time: 1381ms
memory: 183108kb
input:
500000 500000 485205 491154 481897 461162 485467 491435 481674 475579 458758 483228 465392 457874 491531 486041 485240 462297 475714 487898 469778 489515 487052 474724 471889 473968 472608 458588 483837 477928 457393 478351 483601 489650 488413 488686 465249 461793 486462 464676 470253 485734 486436...
output:
499909500012353 63 500000 481842 481843
result:
ok 5 number(s): "499909500012353 63 500000 481842 481843"
Test #227:
score: 10
Accepted
time: 676ms
memory: 170684kb
input:
500000 500000 810487 645442 566991 788817 709667 862811 709888 722895 878405 630208 786532 627629 820848 571750 885599 658884 567672 578518 538055 580278 778562 632480 778680 550991 680053 497112 630687 885868 906808 770163 541148 689082 612321 805113 829543 567212 861855 908081 742410 774953 761360...
output:
945725052767597 4567 493625 123 456789
result:
ok 5 number(s): "945725052767597 4567 493625 123 456789"
Test #228:
score: 0
Time Limit Exceeded
input:
500000 500000 233650 326168 327451 313299 24480 142272 313997 145812 221989 135377 209977 139039 379592 351030 429085 256868 75016 45142 39890 275124 91151 389246 210695 235841 439720 61424 159740 278978 455456 389971 77923 170235 374996 348480 83891 384557 229375 32177 400982 125877 231631 100874 3...
output:
499907543701618 456669 500000 1 500000