QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#56211#2643. Bubble Sort 2275307894a100 ✓765ms115696kbC++141.6kb2022-10-17 21:18:232024-07-05 05:56:56

Judging History

你现在查看的是最新测评结果

  • [2024-07-05 05:56:56]
  • 管理员手动重测本题所有提交记录
  • 测评结果:100
  • 用时:765ms
  • 内存:115696kb
  • [2023-08-10 23:21:45]
  • System Update: QOJ starts to keep a history of the judgings of all the submissions.
  • [2022-10-17 21:18:26]
  • 评测
  • 测评结果:100
  • 用时:1160ms
  • 内存:111572kb
  • [2022-10-17 21:18:23]
  • 提交

answer

#include "bubblesort2.h"
#include<bits/stdc++.h>
#define Gc() getchar() 
#define Me(x,y) memset(x,y,sizeof(x))
#define Mc(x,y) memcpy(x,y,sizeof(x))
#define d(x,y) ((m)*(x-1)+(y))
#define R(n) (rnd()%(n)+1)
#define Pc(x) putchar(x)
#define LB lower_bound
#define UB upper_bound
#define PB push_back
using ll=long long;using db=double;using lb=long db;using ui=unsigned;using ull=unsigned ll;
using namespace std;const int N=5e5+5,M=N*8+5,K=2e3+5,mod=1e9+7,Mod=mod-1;const db eps=1e-5;const int INF=1e9+7;mt19937 rnd(time(0));
int n,m,A[N],Ts,x,Ns[N*2],Nh;set<int> f[N*2];vector<int> Answer;
namespace Tree{
	#define ls v<<1
	#define rs v<<1|1
	int g[M],S[M];void Up(int v){S[v]=S[ls]+S[rs];g[v]=max(g[rs],g[ls]+S[rs]);}
	void BD(int l=1,int r=Nh,int v=1){if(l==r){S[v]=f[l].size();g[v]=(f[l].empty()?-1e9:*f[l].rbegin());return;}int m=l+r>>1;BD(l,m,ls);BD(m+1,r,rs);Up(v);}
	void Ins(int x,int l=1,int r=Nh,int v=1){if(l==r){S[v]=f[l].size();g[v]=(f[l].empty()?-1e9:*f[l].rbegin());return;}int m=l+r>>1;x<=m?Ins(x,l,m,ls):Ins(x,m+1,r,rs);Up(v);}
	#undef ls
	#undef rs
}
vector<int> countScans(vector<int> A,vector<int> X,vector<int> V){
	int i,j;n=A.size();m=X.size();for(int i:A) Ns[++Nh]=i;for(int i:V) Ns[++Nh]=i;sort(Ns+1,Ns+Nh+1);Nh=unique(Ns+1,Ns+Nh+1)-Ns-1;
	for(i=0;i<n;i++) A[i]=LB(Ns+1,Ns+Nh+1,A[i])-Ns;for(i=0;i<m;i++) V[i]=LB(Ns+1,Ns+Nh+1,V[i])-Ns;for(i=0;i<n;i++) f[A[i]].insert(i-n+1);Tree::BD();
	for(i=0;i<m;i++)f[A[X[i]]].erase(X[i]-n+1),Tree::Ins(A[X[i]]),f[A[X[i]]=V[i]].insert(X[i]-n+1),Tree::Ins(A[X[i]]),Answer.PB(Tree::g[1]);return Answer;
}

詳細信息

Subtask #1:

score: 17
Accepted

Test #1:

score: 17
Accepted
time: 0ms
memory: 53112kb

input:

522 575
102436426 24979445 361648772 123690081 433933447 476190629 262703497 211047202 471407775 128894325 231963982 322804784 450968417 430302156 482631932 161735902 380895728 423078537 207723857 189330739 410286918 302329211 404539679 303238506 317063340 492686568 273361868 125660016 150287940 339...

output:

487
487
487
487
487
487
487
487
487
487
487
487
487
487
487
487
487
487
487
487
487
487
487
487
487
487
487
487
487
487
487
487
487
487
487
487
487
487
487
487
487
487
487
487
487
487
487
487
487
487
487
487
487
487
487
487
487
487
487
487
487
487
486
486
486
486
486
486
486
486
486
486
486
486
486
...

result:

ok 575 lines

Test #2:

score: 0
Accepted
time: 7ms
memory: 52924kb

input:

769 938
156700085 135331252 275122742 229846496 168781191 137628787 54722828 143931040 21982053 335791582 156766283 68972762 299975583 164112045 30596032 99018833 261062940 128848465 137709065 456156864 139970261 483290987 149161243 12512849 408704856 426500435 40422589 42079271 473121350 383638418 ...

output:

760
760
760
760
760
760
760
760
760
760
760
760
760
760
760
760
760
760
760
760
760
760
760
760
760
760
760
760
760
760
760
760
760
760
760
760
760
760
760
760
760
760
760
760
760
760
760
760
760
760
760
760
760
760
760
760
760
760
760
760
760
760
760
760
760
760
760
760
760
760
760
760
760
760
760
...

result:

ok 938 lines

Test #3:

score: 0
Accepted
time: 7ms
memory: 51136kb

input:

2000 2000
336508124 348597943 366381905 215377078 131177712 28566868 395375460 462998224 393236055 118368155 17215783 369859374 112195801 407572760 391349837 426283862 323080115 405462502 15846205 26323870 180881686 245057593 180919698 79181234 398996645 158010324 454799769 217429266 156239355 12625...

output:

1958
1958
1958
1958
1958
1958
1958
1958
1958
1958
1958
1958
1958
1958
1958
1958
1958
1958
1958
1958
1958
1958
1958
1958
1958
1958
1958
1958
1958
1958
1958
1958
1958
1958
1958
1958
1958
1958
1958
1958
1958
1958
1958
1958
1958
1958
1958
1958
1958
1958
1958
1958
1958
1958
1958
1958
1958
1958
1958
1958
...

result:

ok 2000 lines

Test #4:

score: 0
Accepted
time: 15ms
memory: 53240kb

input:

2000 2000
138318467 132072462 423531124 348979161 291708022 240566534 228890522 161285084 221359875 460536072 446384861 119549361 208697997 495143881 201727273 201380518 246649386 474620368 448684640 205838364 342624805 269615865 115491285 422094089 152513405 271829747 171904978 497925751 81264483 2...

output:

1907
1907
1906
1906
1906
1906
1906
1906
1906
1906
1906
1906
1906
1906
1906
1906
1905
1905
1905
1905
1905
1905
1905
1905
1905
1906
1906
1907
1907
1907
1907
1907
1907
1907
1907
1907
1907
1907
1906
1906
1906
1906
1906
1906
1906
1906
1906
1906
1906
1906
1906
1906
1906
1906
1906
1906
1906
1906
1906
1907
...

result:

ok 2000 lines

Test #5:

score: 0
Accepted
time: 7ms
memory: 53240kb

input:

2000 2000
259271019 450358813 220943522 113904835 323507549 162248301 37378958 191764357 384134083 180264973 443635627 20889027 78843608 332516223 131731909 256188128 202770459 104397607 421211439 475050082 61082575 269069516 58653502 372328051 105539196 4980763 116925897 232592226 325509228 9963882...

output:

730
731
731
731
731
730
730
731
731
731
730
730
729
729
729
729
729
729
730
730
731
732
732
732
733
733
732
732
732
732
732
732
732
732
732
732
731
731
732
732
731
732
733
732
732
731
731
731
731
731
732
732
731
731
732
732
732
732
732
732
732
732
732
732
731
731
731
730
731
731
731
731
730
729
729
...

result:

ok 2000 lines

Test #6:

score: 0
Accepted
time: 8ms
memory: 53040kb

input:

2000 2000
44399 525603 1529827 2626021 2868485 286955287 3057743 3402668 3785674 4187064 151636530 4733493 4821062 5021090 5828020 6159944 6309127 6798102 7046134 7352507 7489444 7632950 7916809 8149841 220745108 8707428 9833063 10664806 10968739 11056715 11500644 11504487 11991699 12026680 12120372...

output:

111
111
111
111
111
111
111
111
110
110
110
110
111
110
110
111
111
110
110
109
109
108
108
108
108
107
106
106
106
106
106
107
107
107
108
109
110
111
111
111
111
110
109
109
108
108
108
109
109
109
109
109
109
110
111
111
111
111
110
109
110
109
108
107
107
107
107
107
108
108
108
108
108
108
108
...

result:

ok 2000 lines

Test #7:

score: 0
Accepted
time: 10ms
memory: 53016kb

input:

2000 2000
3246 81271 176091 470499351 428740 1506691 1616333 2180265 472382149 63486000 2362234 3198891 6372889 260891903 3718384 3808691 340901070 3869338 466173474 4604727 4703438 86259564 444440538 402225248 4837468 174301751 330178721 5061159 5316981 5853359 6492821 14411484 6660002 202072257 68...

output:

281
281
281
281
282
282
282
282
282
282
282
282
282
283
283
282
281
280
280
279
279
279
278
277
277
278
278
278
278
278
278
278
278
278
278
278
277
277
276
276
276
276
275
276
276
276
276
276
276
277
277
276
275
275
275
275
275
276
276
275
275
275
275
275
275
276
276
276
276
277
277
277
276
277
277
...

result:

ok 2000 lines

Test #8:

score: 0
Accepted
time: 8ms
memory: 52596kb

input:

2000 2000
348949 1662431 210203670 457698513 353313518 112843576 2713555 3053109 350949736 3456095 474376733 194977580 3659694 248214098 4292452 4335569 4776592 96759740 5060146 193916713 5105777 6489341 333668154 489714731 6998936 398120266 488238692 92427929 7018553 7283954 303400824 421966184 115...

output:

388
388
389
389
389
388
388
389
390
390
390
390
389
389
389
389
388
388
388
389
389
390
390
390
391
391
391
392
392
392
392
391
391
390
390
390
389
390
390
390
389
390
390
390
390
390
390
390
391
391
391
391
391
392
392
393
394
395
394
393
393
393
392
392
392
392
393
394
394
393
393
393
393
393
393
...

result:

ok 2000 lines

Test #9:

score: 0
Accepted
time: 16ms
memory: 53408kb

input:

2000 2000
63088925 488038746 474932295 31669174 145097926 429852166 107268799 409396158 237719892 397791347 181724418 148701413 33947723 63695935 32296340 10260892 278290767 99803085 89824604 131103577 3288205 115403712 307011116 479716083 304394928 108398520 433609604 203582765 450997646 262809951 ...

output:

724
723
723
724
725
725
724
725
724
724
724
724
725
725
724
725
725
725
724
724
723
722
722
723
723
723
723
723
723
723
723
722
721
721
721
721
721
721
721
721
722
723
722
722
722
722
721
721
722
722
722
721
721
720
720
719
719
719
719
719
720
719
719
719
719
718
717
717
717
717
717
717
717
717
717
...

result:

ok 2000 lines

Test #10:

score: 0
Accepted
time: 4ms
memory: 53564kb

input:

2000 2000
324633401 462915846 142767322 55463917 41028724 251330079 344111489 277959643 2520633 380932827 8189240 383360500 149895062 148051628 113946678 419373748 121145738 56279295 445355925 243490 69130737 95235445 178577842 271818393 44081124 345785811 493532321 259548320 162418294 343952498 392...

output:

1001
1001
1000
1000
1001
1001
1000
1000
1000
1001
1000
1000
1000
1001
1001
1001
1000
1001
1000
1001
1000
1001
1000
1001
1001
1001
1001
1001
1000
1001
1001
1000
1001
1001
1000
1000
1000
1000
1000
1001
1001
1001
1001
1000
1000
1000
1000
1001
1000
1001
1000
1001
1000
1000
1001
1000
1000
1000
1001
1000
...

result:

ok 2000 lines

Test #11:

score: 0
Accepted
time: 8ms
memory: 55584kb

input:

2000 2000
19161566 170561600 275945206 299285629 362572892 337863747 369675683 438761804 95355611 343976594 171111698 155343291 228765672 215409038 347881762 175582757 297492418 155220723 269437181 333182785 276585589 32901988 150162073 377850594 377996530 323693637 416066048 220587599 161374189 458...

output:

1001
1000
1001
1001
1001
1001
1001
1000
1001
1001
1001
1001
1000
1000
1001
1000
1001
1000
1000
1000
1001
1001
1001
1001
1001
1000
1000
1001
1001
1001
1000
1001
1000
1001
1000
1000
1001
1000
1001
1000
1001
1000
1001
1001
1000
1000
1001
1001
1000
1000
1000
1000
1000
1001
1001
1001
1001
1001
1001
1000
...

result:

ok 2000 lines

Test #12:

score: 0
Accepted
time: 3ms
memory: 53240kb

input:

2000 2000
9906371 131093130 139920076 496027052 420499636 242022172 447599322 188120633 19950381 366579442 420990901 429067531 402938506 62374831 261764997 409975526 153946876 431825231 195461243 335696128 124658503 257351660 386995365 398537236 31059811 48445634 221331413 105580522 339623140 241141...

output:

1000
1001
1000
1001
1000
1000
1000
1001
1000
1001
1000
1000
1001
1000
1001
1000
1001
1000
1000
1001
1001
1001
1000
1000
1001
1000
1001
1001
1000
1001
1001
1001
1000
1001
1000
1000
1001
1000
1001
1000
1001
1001
1000
1001
1001
1000
1001
1000
1001
1000
1000
1000
1000
1001
1001
1001
1000
1000
1000
1000
...

result:

ok 2000 lines

Test #13:

score: 0
Accepted
time: 7ms
memory: 55288kb

input:

2000 2000
124422386 439624456 68496916 311482970 143134066 35481576 367504053 87072212 471247019 32282883 137462837 346321435 254790956 278827036 124602680 171405012 32985834 325627359 206857931 72874189 174467804 134883743 170705856 238345994 132603792 8035621 447517159 228124873 38561669 145144368...

output:

1000
1001
1001
1000
1001
1000
1001
1001
1000
1001
1001
1001
1000
1000
1000
1001
1001
1000
1001
1000
1001
1000
1001
1000
1001
1000
1001
1000
1001
1000
1001
1001
1000
1001
1000
1001
1000
1001
1001
1000
1001
1000
1001
1000
1001
1000
1001
1000
1001
1000
1000
1001
1000
1001
1000
1001
1000
1001
1000
1001
...

result:

ok 2000 lines

Test #14:

score: 0
Accepted
time: 8ms
memory: 55356kb

input:

2000 2000
70899951 245200400 179811753 28349305 94208305 448232073 303913841 176227475 51689488 293349449 491916150 199703069 175732859 255249893 293417137 224384502 392756720 130109380 341547025 447090841 310536461 303352014 401992959 488531719 371535895 482155138 249503089 343730705 328091454 2067...

output:

1001
1001
1000
1001
1000
1001
1000
1001
1001
1000
1000
1001
1000
1001
1000
1001
1000
1001
1000
1000
1001
1000
1001
1000
1000
1001
1000
1001
1000
1001
1001
1000
1001
1000
1001
1001
1000
1000
1001
1000
1001
1000
1000
1001
1000
1001
1000
1000
1001
1000
1001
1000
1001
1000
1001
1000
1000
1001
1001
1000
...

result:

ok 2000 lines

Test #15:

score: 0
Accepted
time: 3ms
memory: 55572kb

input:

2000 2000
85051931 100113355 431657743 132242089 193965863 238850187 275392186 284623742 123316659 105790330 411687913 47746977 3011201 98853079 83168234 265964946 388668200 277227884 62605084 211216559 454045337 58352906 294961731 50768241 6514140 420628010 451387399 461413574 140228913 137728740 1...

output:

1001
1001
1000
1001
1000
1001
1000
1001
1001
1000
1001
1000
1001
1001
1000
1001
1000
1001
1000
1000
1001
1000
1001
1001
1000
1001
1000
1001
1000
1001
1001
1000
1001
1000
1001
1001
1000
1000
1001
1000
1001
1001
1000
1000
1001
1001
1000
1000
1001
1000
1000
1001
1000
1001
1000
1001
1000
1001
1001
1000
...

result:

ok 2000 lines

Test #16:

score: 0
Accepted
time: 7ms
memory: 55284kb

input:

2000 2000
423345479 32105920 92711254 497236060 404113139 334022638 188997173 184349171 52346113 149782192 18166764 424602597 182242965 176093884 250277633 374914204 22486814 326399706 354041701 493794408 136038491 311437409 251107023 11702668 193357817 388241896 168803737 476356960 28594758 4653379...

output:

1001
1000
1001
1000
1001
1000
1001
1000
1001
1000
1001
1000
1001
1000
1001
1000
1001
1000
1001
1000
1001
1000
1001
1000
1001
1000
1001
1000
1001
1000
1001
1000
1001
1000
1001
1000
1001
1000
1001
1000
1001
1000
1001
1000
1001
1000
1001
1000
1001
1000
1001
1000
1001
1000
1001
1000
1001
1000
1001
1000
...

result:

ok 2000 lines

Test #17:

score: 0
Accepted
time: 3ms
memory: 55284kb

input:

2000 2000
232550749 26947180 236809117 286797617 89995025 270075054 204869 498912976 190466633 101990953 388633779 371013988 176748259 498259160 423716488 84203323 362932409 51076538 415286151 188566559 396163961 114192186 60564040 424142740 143090525 431157872 115893641 115469507 228402564 49584787...

output:

1001
1000
1001
1000
1001
1000
1001
1000
1001
1000
1001
1000
1001
1000
1001
1000
1001
1000
1001
1000
1001
1000
1001
1000
1001
1000
1001
1000
1001
1000
1001
1000
1001
1000
1001
1000
1001
1000
1001
1000
1001
1000
1001
1000
1001
1000
1001
1000
1001
1000
1001
1000
1001
1000
1001
1000
1001
1000
1001
1000
...

result:

ok 2000 lines

Test #18:

score: 0
Accepted
time: 8ms
memory: 55288kb

input:

2000 2000
481532096 281696802 47521507 485435423 82252882 411768651 37163621 247548048 494004611 167316851 380378029 103883916 265431403 54787249 235821541 132462320 276502589 138521013 357845412 39005201 168111066 167758821 489303051 439366038 11929694 401012938 259518848 25955970 181859730 3613014...

output:

1001
1000
1001
1000
1001
1000
1001
1000
1001
1000
1001
1000
1001
1000
1001
1000
1001
1000
1001
1000
1001
1000
1001
1000
1001
1000
1001
1000
1001
1000
1001
1000
1001
1000
1001
1000
1001
1000
1001
1000
1001
1000
1001
1000
1001
1000
1001
1000
1001
1000
1001
1000
1001
1000
1001
1000
1001
1000
1001
1000
...

result:

ok 2000 lines

Subtask #2:

score: 21
Accepted

Dependency #1:

100%
Accepted

Test #19:

score: 21
Accepted
time: 16ms
memory: 55812kb

input:

7139 6924
25468357 139635209 13893129 89484490 432759537 158225716 222776181 438339291 334506663 78019736 431526424 357615244 279105402 450587748 253116550 496356574 319481632 22740362 360666039 220630485 338024690 40381251 54921352 218009339 181230191 382151048 250543672 439993821 449719481 1985959...

output:

7116
7116
7116
7116
7116
7116
7116
7116
7116
7116
7116
7116
7116
7116
7116
7116
7116
7116
7116
7116
7116
7116
7116
7116
7116
7116
7116
7116
7116
7116
7116
7116
7116
7116
7116
7116
7116
7116
7116
7116
7116
7116
7116
7116
7116
7116
7116
7116
7116
7116
7116
7116
7116
7116
7116
7116
7116
7116
7116
7116
...

result:

ok 6924 lines

Test #20:

score: 0
Accepted
time: 18ms
memory: 57872kb

input:

8000 8000
418707961 134767563 331754502 128841667 210116883 65042049 220136057 125595207 414722443 198859854 197590559 499381478 80244300 215292897 28078964 244552241 134782340 478194128 435243386 271261407 417103399 223886610 61108278 473428042 34621548 43971971 464602160 40220912 137945934 461411 ...

output:

7989
7989
7989
7989
7989
7989
7989
7989
7989
7989
7989
7989
7989
7989
7989
7989
7989
7989
7989
7989
7989
7989
7989
7989
7989
7989
7989
7989
7989
7989
7989
7989
7989
7989
7989
7989
7989
7989
7989
7989
7989
7989
7989
7989
7989
7989
7989
7989
7989
7989
7989
7989
7989
7989
7989
7989
7989
7989
7989
7989
...

result:

ok 8000 lines

Test #21:

score: 0
Accepted
time: 13ms
memory: 55840kb

input:

8000 8000
53064 193736953 50939769 309512 438556 97098589 453745 130031013 476519 503297 506741 629524 243093347 631713 765222 271073538 774651 822806 958216 958915 1000868 1080117 259622318 1414642 1449711 1936314 2035061 2089597 475382119 450919566 328697613 2125101 2138710 2299823 2629664 2216605...

output:

1127
1127
1127
1127
1128
1127
1127
1127
1126
1126
1126
1126
1126
1126
1126
1126
1126
1126
1127
1128
1128
1127
1128
1128
1128
1128
1127
1127
1127
1128
1127
1127
1127
1127
1127
1127
1127
1127
1126
1125
1124
1124
1125
1125
1126
1125
1125
1125
1126
1126
1127
1127
1127
1126
1126
1126
1126
1126
1126
1126
...

result:

ok 8000 lines

Test #22:

score: 0
Accepted
time: 7ms
memory: 55876kb

input:

8000 8000
374995050 91521642 385358564 103898877 572334 187483564 196119511 438798837 116372300 483302336 80871616 939909 435110272 303568209 448906108 474599838 471392234 1643025 2156817 2159539 396103685 438916220 439476146 391684462 65279027 491776548 95435506 353771391 145933047 295212596 418737...

output:

2553
2554
2554
2554
2554
2554
2554
2554
2554
2554
2553
2553
2553
2552
2553
2553
2553
2553
2553
2554
2554
2554
2553
2553
2553
2553
2553
2554
2554
2553
2553
2553
2554
2554
2554
2554
2555
2556
2556
2557
2558
2558
2559
2559
2559
2558
2558
2558
2559
2558
2558
2559
2559
2559
2560
2560
2560
2560
2559
2559
...

result:

ok 8000 lines

Test #23:

score: 0
Accepted
time: 14ms
memory: 57920kb

input:

8000 8000
183314037 45925170 105623952 420449769 26131359 222259811 169704129 418064336 134728249 33835631 196581713 69140428 347669786 117103946 362044375 65027682 474206716 257238603 392057074 471295547 67430621 339905741 484649311 477509220 125532606 8760175 179279844 117066158 22245159 135437652...

output:

4001
4000
4001
4001
4000
4001
4001
4000
4000
4000
4001
4000
4001
4001
4000
4001
4000
4001
4000
4001
4001
4001
4000
4001
4001
4001
4000
4000
4001
4000
4001
4001
4001
4001
4001
4001
4001
4000
4001
4001
4001
4000
4000
4000
4001
4000
4001
4001
4000
4000
4000
4001
4001
4001
4001
4000
4000
4000
4000
4000
...

result:

ok 8000 lines

Test #24:

score: 0
Accepted
time: 16ms
memory: 55824kb

input:

8000 8000
337265171 331682493 284814707 176075655 299170097 56937220 45872539 433043137 372364530 250148620 79906257 404797113 403993459 447340387 481712213 327611824 414368570 292138168 251252591 238867143 252318159 222255202 221204552 82607016 63395645 126041049 45224046 275628155 243143414 465132...

output:

4001
4000
4000
4001
4001
4001
4001
4001
4001
4000
4000
4000
4000
4001
4000
4001
4001
4000
4000
4000
4000
4000
4000
4000
4000
4000
4001
4000
4000
4001
4000
4000
4000
4001
4001
4000
4000
4001
4000
4000
4001
4000
4000
4000
4001
4000
4000
4000
4000
4000
4001
4000
4001
4000
4001
4000
4001
4000
4001
4000
...

result:

ok 8000 lines

Test #25:

score: 0
Accepted
time: 10ms
memory: 55864kb

input:

8000 8000
395837504 393637186 338043733 111338145 22210473 15697635 18083680 10767915 356912366 334088822 325633784 463635420 399260922 78604437 252571819 487955326 292037471 120385468 265936524 317171841 17021391 491229261 311361136 68484119 494096100 398757965 58520402 215507385 203379096 23082874...

output:

4001
4001
4000
4000
4001
4000
4001
4000
4000
4000
4001
4000
4001
4000
4001
4001
4000
4001
4000
4001
4000
4001
4000
4001
4000
4001
4000
4001
4000
4000
4001
4000
4001
4000
4000
4001
4001
4000
4001
4000
4001
4001
4000
4001
4000
4001
4000
4001
4000
4001
4000
4001
4000
4001
4000
4000
4001
4000
4001
4000
...

result:

ok 8000 lines

Test #26:

score: 0
Accepted
time: 16ms
memory: 55880kb

input:

8000 8000
454939252 314923162 64962053 434118749 487546717 200196469 115932615 219918263 116109474 4091252 248517312 130036411 442441168 10023906 100939422 331713798 132513433 245303984 140799958 494727545 95379189 65201455 52188705 236761272 343911035 422729462 363136922 132069069 250276460 4548832...

output:

4001
4001
4000
4001
4000
4001
4000
4000
4000
4001
4000
4001
4000
4001
4001
4000
4001
4000
4001
4000
4000
4001
4000
4001
4000
4000
4001
4000
4000
4001
4000
4001
4000
4000
4001
4000
4001
4001
4000
4001
4000
4001
4001
4000
4001
4001
4000
4000
4001
4000
4000
4001
4000
4001
4000
4001
4000
4001
4000
4000
...

result:

ok 8000 lines

Test #27:

score: 0
Accepted
time: 12ms
memory: 55820kb

input:

8000 8000
306284423 226167215 383551117 349155100 50331113 421761853 58835701 428257085 6476096 386488746 153349589 339261781 229432604 342482485 274506112 12730706 131608241 421272255 202209132 364922952 50455896 103717101 118509490 82267437 228207979 17008008 233940273 316555582 496099788 23630886...

output:

4001
4000
4001
4000
4001
4000
4001
4000
4001
4000
4001
4000
4001
4000
4001
4000
4001
4000
4001
4000
4001
4000
4001
4000
4001
4000
4001
4000
4001
4000
4001
4000
4001
4000
4001
4000
4001
4000
4001
4000
4001
4000
4001
4000
4001
4000
4001
4000
4001
4000
4001
4000
4001
4000
4001
4000
4001
4000
4001
4000
...

result:

ok 8000 lines

Test #28:

score: 0
Accepted
time: 4ms
memory: 55868kb

input:

8000 8000
25666225 115252802 58797808 245603373 304284455 288796442 447244393 261369626 428466630 253156737 491043016 387333646 211340480 271627144 204102690 296062889 166711020 484359744 411903437 296943281 103289156 246159616 243203431 454761679 362137702 331033669 425245615 250590897 224979412 70...

output:

4001
4000
4001
4000
4001
4000
4001
4000
4001
4000
4001
4000
4001
4000
4001
4000
4001
4000
4001
4000
4001
4000
4001
4000
4001
4000
4001
4000
4001
4000
4001
4000
4001
4000
4001
4000
4001
4000
4001
4000
4001
4000
4001
4000
4001
4000
4001
4000
4001
4000
4001
4000
4001
4000
4001
4000
4001
4000
4001
4000
...

result:

ok 8000 lines

Subtask #3:

score: 22
Accepted

Test #29:

score: 22
Accepted
time: 19ms
memory: 56648kb

input:

27483 2104
36 37 18 27 36 86 96 35 35 50 6 74 56 67 31 44 17 42 9 48 21 11 58 72 21 1 3 81 84 32 36 6 54 37 25 76 61 86 19 12 47 31 49 9 90 54 55 89 44 80 63 41 79 86 7 58 70 33 69 9 14 78 55 27 14 22 19 41 64 75 87 2 6 29 94 24 73 82 38 35 73 55 52 14 3 72 11 8 26 72 85 76 71 43 60 33 13 35 22 15 6...

output:

27161
27161
27161
27161
27161
27161
27161
27161
27161
27161
27161
27161
27161
27161
27161
27161
27161
27161
27161
27161
27161
27161
27161
27161
27161
27161
27161
27161
27161
27161
27161
27161
27161
27161
27161
27161
27161
27161
27161
27161
27161
27161
27161
27161
27161
27161
27161
27161
27161
27161
...

result:

ok 2104 lines

Test #30:

score: 0
Accepted
time: 32ms
memory: 57460kb

input:

39864 24416
5 89 28 36 77 45 56 5 81 70 83 32 64 82 12 69 54 55 86 3 4 23 84 19 60 4 38 61 98 66 11 40 12 32 18 58 6 91 33 27 63 19 60 49 87 71 3 71 15 69 91 42 24 12 41 61 20 9 84 99 31 34 66 15 7 30 27 59 97 55 70 50 89 66 58 97 58 18 38 7 100 14 9 88 16 27 34 86 28 35 61 63 84 57 33 64 14 14 37 4...

output:

39341
39341
39341
39341
39341
39341
39341
39341
39341
39341
39341
39341
39341
39341
39341
39341
39341
39341
39341
39341
39341
39341
39341
39341
39341
39341
39341
39341
39340
39340
39340
39340
39340
39340
39340
39340
39340
39340
39340
39340
39340
39340
39340
39340
39339
39339
39339
39339
39339
39339
...

result:

ok 24416 lines

Test #31:

score: 0
Accepted
time: 53ms
memory: 58628kb

input:

50000 50000
36 31 32 14 52 36 82 75 53 45 25 87 65 77 84 91 60 57 37 39 74 23 30 71 49 43 51 39 96 16 49 4 18 32 62 93 64 73 86 27 63 77 24 97 23 11 31 1 15 35 29 53 70 42 20 63 79 96 64 61 50 40 82 10 13 91 8 19 84 49 50 62 57 39 39 2 21 51 6 54 41 87 61 38 90 87 34 81 90 74 53 9 16 69 31 29 79 28 ...

output:

49329
49329
49329
49329
49329
49329
49329
49329
49329
49329
49329
49329
49329
49329
49329
49329
49329
49329
49329
49329
49329
49329
49329
49329
49329
49329
49329
49329
49329
49329
49329
49329
49329
49329
49329
49329
49329
49329
49329
49329
49329
49329
49329
49329
49329
49329
49329
49329
49329
49329
...

result:

ok 50000 lines

Test #32:

score: 0
Accepted
time: 51ms
memory: 58612kb

input:

50000 50000
51 53 3 54 52 23 90 91 88 47 44 28 41 79 8 98 91 6 19 37 36 30 18 42 81 80 32 83 59 35 98 38 59 61 74 19 78 12 12 77 37 95 97 53 2 34 54 11 65 33 50 91 72 86 68 5 56 39 2 45 34 25 33 72 34 51 22 58 59 24 62 30 98 68 47 56 11 35 77 14 23 19 78 31 40 49 22 59 27 28 4 6 93 33 63 13 79 68 14...

output:

49404
49404
49404
49404
49404
49404
49404
49404
49404
49404
49404
49404
49404
49404
49404
49404
49404
49404
49404
49404
49404
49404
49404
49404
49404
49404
49404
49404
49404
49404
49404
49404
49404
49404
49404
49404
49404
49404
49404
49404
49404
49404
49404
49404
49404
49404
49404
49404
49404
49404
...

result:

ok 50000 lines

Test #33:

score: 0
Accepted
time: 48ms
memory: 58696kb

input:

50000 50000
31 32 26 49 94 25 30 34 64 35 14 87 83 24 13 34 10 43 100 20 21 34 83 5 83 64 31 41 89 43 22 26 68 35 3 100 34 29 66 23 74 16 1 9 67 88 89 85 25 74 62 12 69 57 43 56 3 28 35 1 95 34 83 42 94 45 1 78 44 31 74 88 85 52 78 65 29 62 39 70 73 48 53 40 21 28 92 71 57 32 100 55 63 48 17 33 5 46...

output:

29975
29974
29974
29974
29974
29974
29974
29973
29973
29973
29973
29973
29973
29973
29974
29973
29973
29974
29974
29973
29973
29973
29973
29973
29973
29972
29972
29972
29972
29973
29973
29974
29974
29974
29974
29974
29974
29974
29973
29973
29973
29973
29973
29973
29973
29973
29973
29973
29973
29973
...

result:

ok 50000 lines

Test #34:

score: 0
Accepted
time: 54ms
memory: 58436kb

input:

50000 50000
3 64 7 80 30 89 37 12 12 85 29 32 7 83 48 35 10 61 98 54 89 97 17 28 87 81 53 51 59 80 97 80 43 38 9 78 68 8 97 76 44 5 53 34 31 99 79 44 75 68 14 84 83 37 99 87 88 7 71 56 15 76 90 100 92 46 35 59 38 77 6 70 9 72 4 3 15 61 7 60 56 74 31 76 26 60 14 64 49 55 16 83 51 59 100 95 85 69 90 9...

output:

38648
38648
38648
38648
38648
38648
38648
38649
38649
38649
38649
38649
38649
38648
38648
38648
38648
38648
38648
38648
38648
38648
38649
38648
38648
38647
38648
38648
38648
38648
38648
38648
38648
38648
38648
38648
38648
38648
38649
38649
38649
38648
38648
38648
38648
38649
38649
38649
38649
38649
...

result:

ok 50000 lines

Test #35:

score: 0
Accepted
time: 46ms
memory: 58628kb

input:

50000 50000
56 55 90 67 13 67 91 59 8 42 46 6 89 9 24 80 62 66 34 47 48 8 22 65 10 33 2 41 53 68 30 74 30 31 94 98 15 59 74 36 79 31 92 59 17 60 14 34 65 4 97 58 47 18 63 30 10 71 46 6 49 25 15 47 66 3 55 5 98 58 82 82 30 59 91 84 42 82 85 94 65 21 77 28 82 15 69 91 94 97 67 46 79 72 40 80 66 29 6 3...

output:

18201
18200
18200
18200
18200
18200
18200
18200
18199
18199
18199
18199
18200
18200
18200
18200
18201
18201
18200
18200
18200
18200
18199
18199
18199
18199
18199
18199
18199
18199
18199
18199
18199
18199
18199
18199
18199
18199
18199
18199
18199
18199
18199
18199
18199
18199
18198
18198
18197
18197
...

result:

ok 50000 lines

Test #36:

score: 0
Accepted
time: 55ms
memory: 58400kb

input:

50000 50000
62 76 62 100 13 65 57 19 79 75 46 99 69 54 33 95 11 7 58 36 96 79 98 29 4 26 30 75 33 22 93 66 51 51 57 78 32 46 74 20 25 51 75 50 58 29 70 50 98 66 72 39 49 16 35 98 100 37 51 63 77 40 82 78 84 50 64 67 15 97 47 30 58 61 51 71 20 62 28 63 93 3 11 89 62 46 97 2 28 78 40 46 37 52 51 96 89...

output:

22830
22830
22830
22830
22830
22830
22831
22831
22831
22831
22830
22831
22830
22829
22829
22830
22830
22830
22830
22830
22831
22831
22831
22831
22831
22830
22829
22829
22829
22830
22830
22830
22830
22830
22829
22829
22829
22829
22830
22830
22829
22829
22829
22829
22829
22830
22831
22830
22830
22830
...

result:

ok 50000 lines

Test #37:

score: 0
Accepted
time: 42ms
memory: 58492kb

input:

50000 50000
75 77 81 70 46 46 73 79 37 33 50 34 96 20 99 26 95 22 83 21 56 88 92 42 1 26 3 15 59 23 6 60 84 17 18 51 11 26 28 30 46 26 56 37 27 14 22 13 52 3 51 41 37 5 34 77 6 12 28 10 79 51 3 7 66 44 48 31 76 61 9 89 1 18 59 55 83 100 29 59 55 55 84 49 31 17 17 23 13 14 74 20 27 18 25 25 9 90 31 3...

output:

20581
20581
20581
20582
20582
20582
20582
20582
20582
20582
20582
20582
20581
20581
20581
20581
20581
20581
20581
20581
20580
20580
20580
20580
20580
20579
20579
20579
20579
20580
20580
20579
20578
20577
20577
20577
20577
20577
20577
20577
20577
20577
20577
20577
20577
20578
20578
20578
20578
20578
...

result:

ok 50000 lines

Test #38:

score: 0
Accepted
time: 28ms
memory: 58640kb

input:

50000 50000
100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 ...

output:

49901
49901
49901
49902
49902
49901
49902
49901
49901
49901
49901
49902
49902
49902
49902
49902
49901
49902
49901
49901
49902
49902
49902
49901
49902
49901
49901
49901
49901
49902
49901
49901
49901
49902
49902
49901
49902
49901
49902
49902
49901
49901
49902
49902
49902
49901
49902
49902
49902
49902
...

result:

ok 50000 lines

Test #39:

score: 0
Accepted
time: 42ms
memory: 58452kb

input:

50000 50000
100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 ...

output:

49901
49901
49902
49901
49902
49902
49901
49901
49902
49902
49901
49902
49902
49901
49901
49902
49901
49901
49901
49902
49902
49901
49901
49902
49902
49902
49902
49902
49901
49901
49902
49901
49902
49901
49902
49901
49902
49901
49902
49901
49902
49902
49902
49901
49902
49902
49901
49901
49902
49902
...

result:

ok 50000 lines

Test #40:

score: 0
Accepted
time: 34ms
memory: 58480kb

input:

50000 50000
100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 ...

output:

49901
49901
49902
49901
49902
49901
49902
49902
49901
49901
49902
49902
49901
49901
49901
49902
49901
49902
49902
49902
49901
49902
49901
49901
49901
49902
49902
49901
49902
49902
49902
49901
49901
49901
49902
49901
49901
49902
49902
49902
49902
49901
49901
49902
49902
49901
49901
49902
49901
49902
...

result:

ok 50000 lines

Test #41:

score: 0
Accepted
time: 34ms
memory: 60504kb

input:

50000 50000
100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 ...

output:

49902
49901
49902
49901
49902
49902
49901
49902
49901
49902
49902
49901
49902
49901
49901
49902
49901
49902
49901
49902
49901
49902
49901
49902
49901
49902
49901
49902
49901
49902
49901
49901
49902
49901
49901
49902
49901
49902
49901
49902
49901
49902
49901
49902
49901
49901
49902
49901
49902
49902
...

result:

ok 50000 lines

Test #42:

score: 0
Accepted
time: 36ms
memory: 58628kb

input:

50000 50000
100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 ...

output:

49902
49901
49902
49901
49902
49901
49902
49901
49902
49901
49902
49902
49901
49902
49901
49901
49901
49902
49901
49902
49902
49901
49901
49901
49901
49902
49901
49902
49901
49902
49901
49902
49902
49901
49901
49901
49902
49901
49901
49902
49901
49901
49902
49902
49901
49902
49901
49902
49902
49901
...

result:

ok 50000 lines

Test #43:

score: 0
Accepted
time: 37ms
memory: 58632kb

input:

50000 50000
100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 ...

output:

49902
49901
49902
49901
49902
49901
49902
49901
49902
49901
49902
49901
49901
49902
49901
49901
49902
49901
49902
49901
49902
49901
49902
49902
49901
49902
49902
49901
49901
49901
49901
49901
49902
49901
49902
49902
49901
49902
49901
49902
49901
49902
49902
49902
49901
49902
49902
49901
49901
49902
...

result:

ok 50000 lines

Test #44:

score: 0
Accepted
time: 30ms
memory: 58432kb

input:

50000 50000
100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 ...

output:

49902
49901
49902
49901
49902
49901
49902
49901
49902
49901
49902
49901
49902
49901
49902
49901
49902
49901
49902
49901
49902
49901
49902
49901
49902
49901
49902
49901
49902
49901
49902
49901
49902
49901
49902
49901
49902
49901
49902
49901
49902
49901
49902
49901
49902
49901
49902
49901
49902
49901
...

result:

ok 50000 lines

Test #45:

score: 0
Accepted
time: 25ms
memory: 58388kb

input:

50000 50000
100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 ...

output:

49902
49901
49902
49901
49902
49901
49902
49901
49902
49901
49902
49901
49902
49901
49902
49901
49902
49901
49902
49901
49902
49901
49902
49901
49902
49901
49902
49901
49902
49901
49902
49901
49902
49901
49902
49901
49902
49901
49902
49901
49902
49901
49902
49901
49902
49901
49902
49901
49902
49901
...

result:

ok 50000 lines

Test #46:

score: 0
Accepted
time: 29ms
memory: 58436kb

input:

50000 50000
100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 ...

output:

49902
49901
49902
49901
49902
49901
49902
49901
49902
49901
49902
49901
49902
49901
49902
49901
49902
49901
49902
49901
49902
49901
49902
49901
49902
49901
49902
49901
49902
49901
49902
49901
49902
49901
49902
49901
49902
49901
49902
49901
49902
49901
49902
49901
49902
49901
49902
49901
49902
49901
...

result:

ok 50000 lines

Subtask #4:

score: 40
Accepted

Dependency #1:

100%
Accepted

Dependency #2:

100%
Accepted

Dependency #3:

100%
Accepted

Test #47:

score: 40
Accepted
time: 179ms
memory: 75276kb

input:

158597 138696
47462257 113496080 44175364 423149 143395153 247578734 354182480 45543402 351007029 346671283 242977214 313089419 85899212 337062998 414305589 440207377 95868120 138853634 53181937 341572913 148372397 77662486 428958720 438004883 242683574 231760675 478584008 328069204 38551280 1386545...

output:

157822
157822
157822
157822
157822
157822
157822
157822
157822
157822
157822
157822
157822
157822
157822
157822
157821
157821
157821
157821
157821
157821
157821
157821
157821
157821
157821
157821
157821
157821
157821
157821
157821
157821
157821
157821
157821
157821
157821
157821
157821
157821
157821...

result:

ok 138696 lines

Test #48:

score: 0
Accepted
time: 704ms
memory: 109848kb

input:

430039 481711
129568996 65854972 20395020 320845180 186264024 302686087 391063545 3299280 482886611 375498157 7665593 33498999 22897243 76016148 496874108 475843025 285552615 456011380 43046819 460233361 421989221 360597276 443738438 10539583 345901749 55396461 471116206 362931383 494357035 38395555...

output:

429331
429331
429331
429331
429331
429331
429331
429331
429331
429331
429331
429331
429331
429331
429331
429331
429331
429331
429331
429331
429331
429331
429331
429331
429331
429331
429331
429331
429331
429331
429331
429331
429331
429331
429331
429331
429331
429331
429331
429331
429331
429331
429331...

result:

ok 481711 lines

Test #49:

score: 0
Accepted
time: 737ms
memory: 112364kb

input:

500000 500000
340979804 3423209 341300647 6044567 134021707 182919273 242944285 192619712 316574777 479616741 43368209 437718589 11662024 279912379 136851392 67442325 146844273 171946298 271816060 30317954 432391167 307104551 255871531 161664883 272355090 208395579 15027141 65943051 469194654 337844...

output:

498798
498798
498798
498798
498798
498798
498798
498798
498798
498798
498798
498798
498798
498798
498798
498798
498798
498798
498798
498798
498798
498798
498798
498798
498798
498798
498798
498798
498798
498798
498798
498798
498798
498798
498798
498798
498798
498798
498798
498798
498798
498798
498798...

result:

ok 500000 lines

Test #50:

score: 0
Accepted
time: 721ms
memory: 115008kb

input:

500000 500000
263660659 7037005 130494188 440030444 476828971 353837775 313940743 267458905 21736560 92443084 323290052 258959030 319365728 174087851 297442680 285209139 355477547 383833350 174197713 413864566 379166871 210991404 397579854 406752790 481137535 467316639 419625666 209622305 309097807 ...

output:

499077
499077
499077
499077
499077
499077
499077
499077
499077
499077
499077
499077
499077
499077
499077
499077
499077
499077
499077
499077
499077
499077
499077
499077
499077
499077
499077
499077
499077
499077
499077
499077
499077
499077
499077
499077
499077
499077
499077
499077
499077
499077
499078...

result:

ok 500000 lines

Test #51:

score: 0
Accepted
time: 733ms
memory: 112308kb

input:

500000 500000
149317292 52366017 206133261 23263235 121035422 253950982 24613835 113203176 78435886 191363539 447478818 471530933 315253399 99331894 154446885 442420967 365837154 88305590 417703032 427382442 366156017 221513931 394900948 290929249 332869110 402145377 167045769 84997924 20409080 8893...

output:

499278
499278
499278
499278
499278
499278
499278
499278
499278
499278
499278
499278
499278
499278
499278
499278
499278
499278
499278
499278
499278
499278
499278
499278
499278
499278
499278
499278
499278
499278
499278
499278
499278
499278
499278
499278
499278
499278
499278
499278
499278
499278
499278...

result:

ok 500000 lines

Test #52:

score: 0
Accepted
time: 742ms
memory: 114696kb

input:

500000 500000
103236737 426338588 429704891 242395053 226587361 240693073 88650696 93953744 222770632 452031350 363495821 478870019 91734314 91590885 242862451 288117672 457723531 414395565 417387195 48646937 187703173 265511184 203049464 329126947 46164038 273517830 238443923 227290246 377284111 35...

output:

499547
499547
499547
499547
499547
499547
499547
499547
499547
499547
499547
499547
499547
499547
499547
499547
499547
499547
499547
499547
499547
499547
499547
499547
499547
499547
499547
499547
499547
499547
499547
499547
499547
499547
499547
499547
499547
499547
499547
499547
499547
499547
499547...

result:

ok 500000 lines

Test #53:

score: 0
Accepted
time: 728ms
memory: 115696kb

input:

500000 500000
260869919 225953548 335612018 86632903 491497042 88410991 372824594 421990059 387074330 31703128 117676794 318158528 243875779 330250763 466731410 271307509 237097324 310279873 160008273 186774893 350185611 186058790 99146310 274402045 322579301 39616731 205120146 416721586 368512407 4...

output:

498896
498896
498896
498896
498896
498896
498896
498896
498896
498896
498896
498896
498896
498896
498896
498896
498896
498896
498896
498896
498896
498896
498896
498896
498896
498896
498896
498896
498896
498896
498896
498896
498896
498896
498896
498896
498896
498896
498896
498896
498896
498896
498896...

result:

ok 500000 lines

Test #54:

score: 0
Accepted
time: 717ms
memory: 115312kb

input:

500000 500000
2529 183105131 394308476 1608718 204492577 5589 7438 9105 63666562 269685090 310335710 9765 11322 12219 405524701 12361 12808 15950 209352728 307145131 17334 243574561 19212 444669862 218112008 408653575 19299 374642078 19334 19798 20195 3988283 20849 22270 27030 29781 180411629 31127 ...

output:

92974
92974
92974
92974
92974
92974
92974
92974
92974
92974
92974
92974
92974
92973
92973
92972
92972
92973
92974
92974
92973
92974
92975
92975
92975
92975
92975
92975
92975
92975
92975
92975
92975
92974
92974
92974
92974
92974
92974
92974
92975
92975
92976
92975
92975
92975
92976
92976
92976
92976
...

result:

ok 500000 lines

Test #55:

score: 0
Accepted
time: 746ms
memory: 115040kb

input:

500000 500000
24066082 351514349 337073348 41939402 312443918 4221903 46433152 256742476 432281137 149468391 178256679 444692248 224683240 114657498 145411408 25667486 451137957 441734787 396746472 4782788 251527277 253925234 66854829 387555426 374545243 423953512 5973 320081916 188194128 469092035 ...

output:

175418
175418
175418
175418
175418
175419
175418
175418
175418
175418
175418
175417
175417
175417
175416
175415
175414
175414
175413
175413
175413
175412
175412
175412
175411
175411
175412
175411
175411
175411
175410
175410
175411
175412
175412
175413
175413
175414
175415
175415
175415
175415
175415...

result:

ok 500000 lines

Test #56:

score: 0
Accepted
time: 702ms
memory: 114900kb

input:

500000 500000
281550392 327443695 346771285 189601657 438 337884171 338942718 1282 242418914 3250 3839 6690 60370405 9179 335839460 310528253 12426 13978 17055 22109 185757422 407095119 39876289 247783477 57231415 22185 24053 31838 32698 33944 34733 39008 348408321 40752 43157 44299 376490039 45005 ...

output:

84082
84082
84082
84083
84083
84083
84083
84082
84083
84082
84081
84081
84081
84082
84082
84081
84080
84080
84080
84079
84079
84079
84079
84079
84078
84078
84078
84079
84079
84080
84080
84080
84079
84079
84078
84078
84078
84077
84076
84075
84075
84075
84075
84075
84075
84075
84075
84075
84075
84076
...

result:

ok 500000 lines

Test #57:

score: 0
Accepted
time: 765ms
memory: 115632kb

input:

500000 500000
2875 24543751 155404088 72925287 276049146 37081262 186749793 55998828 484941092 419935249 384156766 32798360 376840403 91797698 196338347 5038 69863900 6775 145677782 292744238 92904544 73519462 376731498 379833995 204232078 392462569 9402 307413188 128856019 14003 39055137 27531 3116...

output:

143015
143015
143016
143015
143014
143015
143015
143015
143014
143014
143014
143014
143013
143013
143013
143012
143012
143012
143012
143012
143012
143012
143012
143012
143012
143012
143011
143010
143009
143009
143010
143009
143009
143010
143010
143010
143010
143010
143011
143011
143012
143011
143011...

result:

ok 500000 lines

Test #58:

score: 0
Accepted
time: 683ms
memory: 112440kb

input:

500000 500000
378955969 643 6243 7325 291329065 10372 20444 400232911 470799526 21268 24180 317369786 96974946 27988 30033 34637883 31102 383165135 31265 34438 38743 39035 41645 41708 287082943 176866211 43741 44821 487570592 45110 369305584 388717240 46417 350260298 50692 51468 52887 52937 53655 56...

output:

81428
81428
81427
81426
81426
81426
81426
81426
81427
81427
81427
81426
81427
81426
81426
81426
81426
81425
81425
81426
81426
81426
81426
81426
81426
81426
81427
81426
81425
81425
81425
81426
81425
81425
81425
81425
81424
81424
81424
81424
81424
81424
81425
81425
81425
81425
81424
81424
81424
81424
...

result:

ok 500000 lines

Test #59:

score: 0
Accepted
time: 647ms
memory: 114932kb

input:

500000 500000
134627587 55518845 348146279 116262197 495443345 228906600 459154727 40354996 64500887 152551293 451783252 274854064 488546833 135489307 196225932 39370316 162755853 187651752 34921663 124796957 318320911 168617242 438666612 472918078 481068638 213571279 229317122 403547709 278083269 6...

output:

250001
250000
250000
250000
250001
250000
250000
250000
250001
250001
250000
250001
250000
250000
250001
250001
250000
250001
250001
250001
250001
250000
250000
250000
250000
250001
250000
250001
250000
250000
250000
250001
250001
250000
250000
250000
250000
250001
250000
250001
250001
250001
250000...

result:

ok 500000 lines

Test #60:

score: 0
Accepted
time: 644ms
memory: 115032kb

input:

500000 500000
370334188 345048244 140316300 333722176 91414966 438621650 229358820 265302880 455228948 443034950 415083972 47879489 248042047 23234814 444661046 134173155 455885891 178745788 344715690 38698122 111939554 5341384 70472419 121646590 421048304 463409690 117138552 416694956 187488888 377...

output:

250001
250001
250000
250001
250001
250000
250001
250000
250000
250001
250000
250000
250001
250000
250001
250000
250001
250001
250001
250001
250000
250000
250001
250001
250000
250000
250001
250000
250001
250000
250001
250001
250000
250000
250001
250001
250000
250000
250001
250001
250001
250000
250001...

result:

ok 500000 lines

Test #61:

score: 0
Accepted
time: 628ms
memory: 112284kb

input:

500000 500000
241922658 303103400 57926755 467168574 253983628 135115419 93555636 297133907 122680521 308111871 389097589 283584348 447839538 46948035 152465631 466567193 416171588 136131352 484138963 138668447 144195984 404443014 348907859 227114710 488330971 118887927 400988694 150383145 215559935...

output:

250000
250001
250000
250000
250000
250000
250001
250001
250000
250000
250001
250001
250001
250001
250000
250000
250001
250001
250000
250000
250001
250001
250001
250001
250001
250001
250000
250001
250000
250000
250001
250000
250000
250001
250000
250000
250000
250001
250000
250001
250001
250000
250001...

result:

ok 500000 lines

Test #62:

score: 0
Accepted
time: 613ms
memory: 115068kb

input:

500000 500000
239309881 325044186 58474419 155450189 204361618 351477839 158894169 19468889 87605313 244390218 54926180 217208547 286828568 208691762 4734024 104637475 173827882 177063954 218038797 178079892 475356850 255570839 198432686 307959783 342018349 5451523 423557945 261362144 368378459 2763...

output:

250000
250001
250001
250000
250001
250000
250001
250001
250000
250001
250000
250001
250001
250000
250001
250001
250001
250000
250001
250000
250001
250000
250001
250001
250000
250001
250000
250001
250000
250001
250000
250000
250000
250001
250000
250000
250001
250000
250001
250000
250001
250000
250001...

result:

ok 500000 lines

Test #63:

score: 0
Accepted
time: 625ms
memory: 112372kb

input:

500000 500000
291020416 399663289 462760576 222249066 81680087 85328577 344907235 388869136 59896085 484316937 259878984 489229359 334812673 454907116 108966999 26391172 478457590 227543194 265580607 197098643 272586050 308613128 453431104 303055968 436532267 230343582 309739855 50716327 151327365 3...

output:

250001
250000
250001
250000
250001
250000
250001
250001
250001
250000
250001
250001
250001
250000
250001
250000
250001
250000
250000
250001
250000
250000
250000
250001
250000
250000
250001
250000
250001
250000
250000
250001
250000
250001
250000
250000
250001
250001
250000
250001
250001
250000
250001...

result:

ok 500000 lines

Test #64:

score: 0
Accepted
time: 616ms
memory: 114896kb

input:

500000 500000
182129393 140692354 125655073 98078017 116821267 438594558 198251513 148648167 465011715 336616642 323029304 258182965 356783125 201779272 121238214 195137544 47590852 208662557 257817630 29867070 266369291 237454324 67066543 75605086 212386221 467750180 303439932 84018654 236954989 32...

output:

250000
250001
250000
250000
250000
250001
250000
250000
250001
250001
250000
250001
250000
250001
250000
250001
250000
250001
250000
250001
250000
250001
250001
250000
250001
250000
250001
250001
250000
250001
250000
250001
250000
250001
250000
250001
250000
250001
250000
250001
250001
250000
250001...

result:

ok 500000 lines

Test #65:

score: 0
Accepted
time: 557ms
memory: 114768kb

input:

500000 500000
449050678 190098841 268576769 428412182 402954858 300117365 281477563 496731622 308780179 26391190 52299079 44636262 255467481 258768314 130329004 376181636 424657079 482433073 285492472 447059074 122228124 101361069 251133949 354625941 302691931 228499225 364522943 159792554 875356 31...

output:

250001
250000
250001
250000
250001
250000
250001
250000
250001
250000
250001
250000
250001
250000
250001
250000
250001
250000
250001
250000
250001
250000
250001
250000
250001
250000
250001
250000
250001
250000
250001
250000
250001
250000
250001
250000
250001
250000
250001
250000
250001
250000
250001...

result:

ok 500000 lines

Test #66:

score: 0
Accepted
time: 577ms
memory: 115656kb

input:

500000 500000
360403376 352153893 98027887 480959299 72766013 112708138 380752738 26260257 101210158 299248996 200769356 187623585 464770811 383424659 123033225 264945425 123862401 413563512 279465224 285014647 424742402 341177241 323756763 441870265 35931108 5215810 326577178 45852613 340690718 489...

output:

250001
250000
250001
250000
250001
250000
250001
250000
250001
250000
250001
250000
250001
250000
250001
250000
250001
250000
250001
250000
250001
250000
250001
250000
250001
250000
250001
250000
250001
250000
250001
250000
250001
250000
250001
250000
250001
250000
250001
250000
250001
250000
250001...

result:

ok 500000 lines

Test #67:

score: 0
Accepted
time: 570ms
memory: 114812kb

input:

500000 500000
302320423 468409038 265730539 253080203 328625094 143314956 385127922 406954130 469453207 1553401 427684057 400541347 49276229 243626277 252667868 50762546 328926910 217019237 401505596 389315107 63449128 227160001 175347774 199428978 316542279 348484468 378737596 109620124 181871112 1...

output:

250001
250000
250001
250000
250001
250000
250001
250000
250001
250000
250001
250000
250001
250000
250001
250000
250001
250000
250001
250000
250001
250000
250001
250000
250001
250000
250001
250000
250001
250000
250001
250000
250001
250000
250001
250000
250001
250000
250001
250000
250001
250000
250001...

result:

ok 500000 lines

Extra Test:

score: 0
Extra Test Passed