QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#459944#8835. GoodmanKevin5307AC ✓160ms17100kbC++231.2kb2024-06-30 17:18:112024-06-30 17:18:11

Judging History

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

  • [2024-06-30 17:18:11]
  • 评测
  • 测评结果:AC
  • 用时:160ms
  • 内存:17100kb
  • [2024-06-30 17:18:11]
  • 提交

answer

//Author: Kevin
#include<bits/stdc++.h>
//#pragma GCC optimize("O2")
using namespace std;
#define ll long long
#define ull unsigned ll
#define pb emplace_back
#define mp make_pair
#define ALL(x) (x).begin(),(x).end()
#define rALL(x) (x).rbegin(),(x).rend()
#define srt(x) sort(ALL(x))
#define rev(x) reverse(ALL(x))
#define rsrt(x) sort(rALL(x))
#define sz(x) (int)(x.size())
#define inf 0x3f3f3f3f
#define pii pair<int,int>
#define lb(v,x) (int)(lower_bound(ALL(v),x)-v.begin())
#define ub(v,x) (int)(upper_bound(ALL(v),x)-v.begin())
#define uni(v) v.resize(unique(ALL(v))-v.begin())
#define longer __int128_t
void die(string S){puts(S.c_str());exit(0);}
int p[1001000];
int vis[1001000];
int main()
{
	ios_base::sync_with_stdio(false);
	cin.tie(0);
	cout.tie(0);
	int t;
	cin>>t;
	while(t--)
	{
		int n;
		cin>>n;
		for(int i=1;i<=n;i++)
		{
			int x;
			cin>>x;
			p[x]=i;
		}
		for(int i=1;i<=n;i++)
			vis[i]=0;
		for(int i=1;i<=n;i++) if(!vis[i])
		{
			vector<int> vec;
			int cur=i;
			while(!vis[cur])
			{
				vec.pb(cur);
				vis[cur]=1;
				cur=p[cur];
			}
			for(auto x:vec)
				cout<<x<<" ";
		}
		cout<<'\n';
	}
	return 0;
}

这程序好像有点Bug,我给组数据试试?

詳細信息

Test #1:

score: 100
Accepted
time: 0ms
memory: 5604kb

input:

2
4
1 2 3 4
6
6 5 4 3 2 1

output:

1 2 3 4 
1 6 2 5 3 4 

result:

ok Correct (2 test cases)

Test #2:

score: 0
Accepted
time: 1ms
memory: 5676kb

input:

873
6
1 5 2 4 6 3
6
5 1 6 4 3 2
4
1 4 3 2
6
2 1 6 5 4 3
6
4 5 1 3 6 2
6
6 2 1 5 4 3
5
1 5 4 3 2
6
1 2 6 3 5 4
4
2 1 3 4
6
1 6 4 2 3 5
6
6 1 3 5 2 4
6
2 1 4 5 3 6
6
3 4 1 5 2 6
6
4 1 5 2 6 3
6
5 2 1 4 6 3
6
4 1 6 2 3 5
6
5 1 3 4 6 2
6
6 2 5 4 1 3
6
6 2 5 1 4 3
6
5 2 3 6 4 1
6
6 1 2 5 4 3
6
2 3 4 6 1 ...

output:

1 2 3 6 5 4 
1 2 6 3 5 4 
1 2 4 3 
1 2 3 6 4 5 
1 3 4 2 6 5 
1 3 6 2 4 5 
1 2 5 3 4 
1 2 3 4 6 5 
1 2 3 4 
1 2 4 3 5 6 
1 2 5 4 6 3 
1 2 3 5 4 6 
1 3 2 5 4 6 
1 2 4 3 6 5 
1 3 6 5 2 4 
1 2 4 3 5 6 
1 2 6 5 3 4 
1 5 3 6 2 4 
1 4 5 3 6 2 
1 6 4 5 2 3 
1 2 3 6 4 5 
1 5 6 4 3 2 
1 5 2 3 6 4 
1 4 2 3 5 6...

result:

ok Correct (873 test cases)

Test #3:

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

input:

46233
7
2 1 7 5 3 4 6
7
5 6 2 4 3 7 1
4
3 4 1 2
7
4 5 1 6 3 2 7
8
4 2 6 5 1 3 8 7
8
3 4 8 6 7 5 2 1
7
6 2 4 3 7 1 5
8
8 1 3 2 7 4 6 5
8
6 5 4 2 1 3 7 8
8
8 3 5 6 2 7 1 4
8
7 3 6 1 8 5 2 4
8
2 3 4 5 8 6 1 7
8
5 8 2 4 7 3 1 6
8
3 4 8 2 7 5 6 1
8
2 8 3 5 7 4 6 1
8
8 4 5 7 6 1 2 3
8
5 2 6 3 4 7 8 1
8
2 ...

output:

1 2 3 5 4 6 7 
1 7 6 2 3 5 4 
1 3 2 4 
1 3 5 2 6 4 7 
1 5 4 2 3 6 7 8 
1 8 3 2 7 5 6 4 
1 6 2 3 4 5 7 
1 2 4 6 7 5 8 3 
1 5 2 4 3 6 7 8 
1 7 6 4 8 2 5 3 
1 4 8 5 6 3 2 7 
1 7 8 5 4 3 2 6 
1 7 5 2 3 6 8 4 
1 8 3 2 4 5 6 7 
1 8 2 3 4 6 7 5 
1 6 5 3 8 2 7 4 
1 8 7 6 3 4 5 2 
1 7 4 2 3 5 6 8 
1 3 6 5 2 ...

result:

ok Correct (46233 test cases)

Test #4:

score: 0
Accepted
time: 153ms
memory: 17100kb

input:

1
999995
992870 548521 579550 387108 249895 990007 476463 686591 907510 311379 340877 491996 478527 996443 681309 483046 760005 905577 711115 275827 697004 737465 904964 381424 774578 217570 554656 914370 935328 624905 590395 761191 265062 978389 670994 184745 662928 389422 952905 447853 325275 9796...

output:

1 132245 383971 261953 656331 270527 970809 790889 835925 602408 740955 902904 402263 477022 512483 673821 583417 536168 789725 856686 311714 364928 460916 222320 439223 804293 525493 300009 555145 962060 733127 871002 287865 71481 140991 951143 91847 302023 547447 781377 194821 109195 569529 535027...

result:

ok Correct (1 test case)

Test #5:

score: 0
Accepted
time: 112ms
memory: 15544kb

input:

1
999999
132956 959208 556000 604257 627699 841942 392337 85216 596714 941258 128586 319266 589450 975529 945897 459533 878473 562877 170464 568730 134581 853340 114919 588755 677661 246220 410344 431559 600933 71503 340747 300767 956226 134024 377489 407095 922690 597383 328440 183077 305496 911409...

output:

1 709905 685985 978853 222811 177067 22723 810503 560659 184375 772719 509739 112941 388751 29043 11759 492769 382969 9766 68396 1282 439815 704705 33786 477462 707414 766206 84857 319863 109941 781447 150149 395354 620491 365003 164764 684921 907193 412671 790716 992460 255594 745409 750228 333677 ...

result:

ok Correct (1 test case)

Test #6:

score: 0
Accepted
time: 160ms
memory: 11708kb

input:

1
999995
185456 546022 237157 854346 194860 12795 423507 139747 41617 745842 562041 586948 901868 41548 724084 551713 363602 993352 196139 134920 732744 223803 52636 647112 662549 111584 37972 544386 618225 516655 675627 995447 377631 547578 200968 309294 943960 544713 472717 970952 614182 556187 87...

output:

1 104022 333932 716610 732047 371948 336479 207839 391311 773194 202421 775973 952261 882100 193311 730328 296585 129523 160723 584253 444515 71680 668529 298068 990682 88262 374179 163202 987570 59028 725031 582174 257751 391959 90698 886463 819820 535805 495601 444712 86744 429235 994631 196282 36...

result:

ok Correct (1 test case)

Test #7:

score: 0
Accepted
time: 128ms
memory: 11744kb

input:

1
999995
106319 883863 505649 461531 879328 592439 610753 498388 652259 561960 714720 4816 619701 583083 891705 422579 600013 649185 247069 757914 629341 259990 491011 371586 561323 496611 245037 738066 356885 551034 869487 727770 296409 616290 689659 540280 866041 373099 500141 78755 296645 410259 ...

output:

1 716634 199346 293320 525889 507442 830393 933930 978294 355087 701114 567312 332052 644727 763060 792188 876683 749960 277649 348053 544384 355411 600367 34366 148556 516240 562647 275024 252761 974445 646288 589757 948772 859484 397711 497250 804532 669491 314072 958800 773343 246504 859116 52338...

result:

ok Correct (1 test case)

Test #8:

score: 0
Accepted
time: 131ms
memory: 11444kb

input:

1
999997
647436 223560 313749 173791 208472 19484 202293 58288 577646 25489 244804 502016 110660 46059 201131 215956 785297 601887 950455 761106 206866 813740 939637 640694 854103 13254 848440 623785 581087 736815 802377 395356 692446 827316 489135 986276 352461 218066 58935 546307 287432 954710 200...

output:

1 727570 643125 286155 398582 734308 277665 276051 616779 116806 973860 594928 170794 421252 175916 387692 185437 320030 411683 894776 331071 380318 54826 165527 202710 90380 301299 475247 591107 745754 909707 380273 3744 379138 411139 653128 583563 858934 670292 167058 925361 139530 191551 311139 6...

result:

ok Correct (1 test case)

Test #9:

score: 0
Accepted
time: 125ms
memory: 15540kb

input:

1
999995
376560 189743 96064 714725 867320 410293 327461 399762 389351 517285 704557 989487 207994 873227 905081 242749 393577 520522 234915 645189 838929 828070 762191 768295 341660 516402 615369 153009 702022 820850 232061 336729 691838 160947 191695 675838 826901 56793 381344 839583 914210 752257...

output:

1 753224 581219 139190 12432 191322 608972 812363 743568 65159 455948 354285 678916 46364 981601 622736 598926 696014 226837 826121 416115 762173 236735 985578 803563 432914 632309 676142 793410 649953 937316 928134 338633 368490 417206 258278 931110 132352 133211 283960 14013 269963 573021 493901 3...

result:

ok Correct (1 test case)

Test #10:

score: 0
Accepted
time: 115ms
memory: 11740kb

input:

1
999997
69588 647230 167087 991071 412817 332088 426389 505132 301 303011 826476 261371 472289 436452 333073 396919 683995 819266 408456 235065 994502 537023 770928 354622 409101 557451 303341 765827 126406 603996 972615 930685 347903 634610 50624 706028 918863 574760 921336 411043 829389 369276 37...

output:

1 730073 193345 161058 57052 203626 549722 265008 268441 44249 514609 424310 805187 247605 88359 971369 340793 270255 997972 314379 809529 575928 232619 839295 634243 949338 588640 102635 255668 806017 250210 879502 138364 826071 566316 387496 335452 661691 20295 191553 662506 422480 672127 872220 5...

result:

ok Correct (1 test case)

Test #11:

score: 0
Accepted
time: 121ms
memory: 16048kb

input:

1
999995
944829 184022 584189 44931 382020 646738 472283 116610 935974 570355 788773 241934 738294 626043 874067 603890 741968 138232 528117 609827 426413 419495 494434 809342 94243 198801 749308 766492 505446 969921 372479 49158 138897 702882 55890 776117 638050 57623 553563 26230 261953 942379 323...

output:

1 980826 939221 349001 436031 480004 884225 52966 650289 98731 845023 701349 529915 818795 492357 535247 169915 802568 873975 596204 111526 324862 771384 115312 386100 52807 435175 625133 372669 609698 51499 965090 617862 465436 910048 151876 506929 667056 915100 61443 325237 109401 391512 6207 2026...

result:

ok Correct (1 test case)

Test #12:

score: 0
Accepted
time: 132ms
memory: 11668kb

input:

1
999999
598262 800757 953677 4 792073 6 136708 66880 371324 212640 11 634080 13 385137 494685 16 48898 394580 171289 165715 21 165348 103815 24 208885 877590 916434 28 265045 30 410055 32 33 34 35 38471 37 350679 287494 120609 571575 973011 513657 892070 45 46 118690 410186 49 977441 756000 40886 5...

output:

1 598262 2 800757 3 80271 953677 4 5 960413 792073 6 7 589145 136708 8 699681 171426 66880 9 345122 315842 371324 10 59711 212640 11 12 850048 634080 13 14 794865 385137 15 984765 494685 16 17 137139 54738 48898 18 394580 19 248190 230572 171289 20 165715 21 22 387255 63929 165348 23 786991 103815 2...

result:

ok Correct (1 test case)

Test #13:

score: 0
Accepted
time: 145ms
memory: 13680kb

input:

1
1000000
598176 980780 744557 853014 801288 772247 686653 948835 432494 397868 653067 88262 742372 978141 748202 436733 798902 30649 648030 890447 124194 832356 162447 690075 519137 485417 580895 188011 923659 541160 793504 808452 587076 664683 992260 711573 958279 280009 695716 468598 162778 94422...

output:

1 173868 342573 870118 954049 928794 844038 925365 828569 247167 375682 223425 190299 431809 275917 235246 361952 775245 481860 573456 619731 394301 390880 749947 602508 900288 701601 639973 78471 602586 433825 354578 812998 779854 627697 968407 757948 596384 312263 298865 739750 380456 683889 3516 ...

result:

ok Correct (1 test case)

Test #14:

score: 0
Accepted
time: 142ms
memory: 11316kb

input:

2
971703
762817 773672 219107 586536 332168 315958 296133 682875 574385 514958 225986 401184 585660 790285 726807 784565 967457 873283 910489 454986 183546 184833 114031 602717 368603 143720 164887 161047 795581 607835 863860 280058 803410 734559 493748 847157 251064 200343 658098 142723 738858 8711...

output:

1 578999 430381 465293 859252 170359 742685 427051 101022 647305 947339 384753 570878 930034 501485 639241 406499 22329 242083 797964 159125 540729 206758 870261 190004 713253 505652 111312 50077 687323 497513 926894 545586 441021 552523 137266 488361 538947 673911 233985 821243 110067 231930 429993...

result:

ok Correct (2 test cases)

Test #15:

score: 0
Accepted
time: 138ms
memory: 11580kb

input:

2
940880
111423 813285 759715 575729 564486 700432 368517 290146 832317 243897 473955 698594 394826 240249 172631 330487 448008 923374 194632 300004 214964 371360 588767 48592 166492 461462 549128 15020 291507 192368 543356 182395 625291 371071 30251 920902 162794 530453 587740 906092 231419 117911 ...

output:

1 667021 608711 876656 622209 136612 268302 749660 123957 781526 363588 394259 79050 744273 744624 498692 479888 539373 8528 522832 793719 439159 601832 17652 299983 856827 97494 226767 200570 235307 660451 883104 208111 767412 373917 762969 820170 862067 484420 378475 389491 29308 679925 117188 599...

result:

ok Correct (2 test cases)

Test #16:

score: 0
Accepted
time: 142ms
memory: 11208kb

input:

2
860629
735188 534252 744523 117977 300521 124360 836277 733811 399530 449393 606669 107978 303823 356049 223557 217235 222785 29525 489289 166055 741811 125793 594271 165471 40345 271714 320863 185123 177911 603339 701397 374390 350130 722274 497043 286267 391000 639814 512894 4979 666163 331108 8...

output:

1 228502 820928 332121 334385 627173 576186 15753 183893 120691 812570 192964 475712 687368 388810 599403 492131 278375 511524 758314 259504 400530 543302 360474 272301 612681 800028 506830 111587 221259 698689 315074 218031 732624 190834 123296 631323 584226 444007 290188 588310 415701 245835 27129...

result:

ok Correct (2 test cases)

Test #17:

score: 0
Accepted
time: 148ms
memory: 11356kb

input:

2
829683
1 431959 16473 4 5 6 732917 467247 9 97836 11 263443 280696 14 77453 16 75676 18 19 20 672505 789285 605702 24 25 26 635082 444514 29 346335 324390 32 391754 34 699517 36 37 38 509820 284968 807779 42 472180 739589 45 46 627304 48 49 525992 381425 143087 53 710147 55 56 57 225867 113034 256...

output:

1 2 431959 3 16473 4 5 6 7 732917 8 467247 9 10 741053 668831 97836 11 12 263443 13 280696 14 15 521630 77453 16 17 75676 18 19 20 21 448790 633371 672505 22 438848 360264 789285 23 605702 24 25 26 27 635082 28 466007 444514 29 30 346335 31 421030 324390 32 33 391754 34 35 432089 699517 36 37 38 39 ...

result:

ok Correct (2 test cases)

Test #18:

score: 0
Accepted
time: 134ms
memory: 11456kb

input:

2
114226
10177 47219 101883 102864 32912 88330 112020 9867 97854 21341 46080 93875 84379 32540 15256 58601 105938 89861 105525 22416 10688 84874 46087 88318 35202 31508 18928 20099 39856 89872 112368 11246 43553 102822 40104 16396 7333 25520 62338 46542 35767 23602 84780 33447 110677 33337 94547 306...

output:

1 105180 89744 58066 21403 98259 77317 25292 36638 63197 110992 96201 7884 53535 75614 86801 28160 49797 92720 53132 17746 29348 11915 37374 55881 107969 48606 107295 44429 31440 46421 78683 9259 50525 1761 55400 23402 6500 49741 3833 2421 43175 19288 94784 53365 49405 38925 63792 57192 83426 3518 9...

result:

ok Correct (2 test cases)

Test #19:

score: 0
Accepted
time: 129ms
memory: 10228kb

input:

2
490803
247930 211116 224844 4 244683 6 193671 485364 225504 421778 140897 50721 1860 14 416567 372449 225900 476979 387561 377844 41836 384022 23 355383 411447 302152 128244 88216 130829 169089 398076 101119 64788 371087 194408 67042 37 124187 247834 108274 376285 246797 118696 337858 27533 299129...

output:

1 49463 269210 266765 280171 448018 247930 2 211116 3 228808 106956 324433 151074 224844 4 5 244683 6 7 29000 193671 8 485364 9 464489 40612 79074 394466 225504 10 63749 479671 8634 147429 214826 446169 255080 357420 456011 421778 11 172440 227365 421043 140897 12 115295 2323 348227 185893 226531 46...

result:

ok Correct (2 test cases)

Test #20:

score: 0
Accepted
time: 120ms
memory: 15004kb

input:

2
761593
728574 427183 105004 539902 490594 19394 641085 680208 603234 469570 13865 523930 161239 728643 145061 58553 79305 527939 498712 205099 648967 167771 490981 527188 241919 713720 29645 269740 712984 312637 358383 160090 352029 195148 410521 217910 407035 735962 465901 591533 262438 683820 17...

output:

1 502635 593142 675214 322047 195034 234539 574685 531422 154870 231361 560155 91564 116214 593477 330718 421728 597956 606656 261691 594096 544131 599903 724685 560564 706096 293183 222583 382170 721430 271772 341560 495975 183612 412287 191953 76627 669268 601108 483755 687888 382136 374690 563506...

result:

ok Correct (2 test cases)

Test #21:

score: 0
Accepted
time: 137ms
memory: 10424kb

input:

2
740849
306411 103496 631429 340096 197195 407246 688964 419402 200695 303965 338708 12 131085 586905 595912 215676 448624 392728 730988 298088 628536 132706 164216 589774 127513 86929 348093 569335 380268 33670 391430 252531 423710 439306 678824 9999 645092 314322 328803 536960 379519 104374 20466...

output:

1 726729 689913 714345 131482 40559 306411 2 539791 103496 3 631429 4 167338 407069 238460 327269 207440 213066 326503 164119 68719 340096 5 737 104189 422210 184578 197195 6 321780 75591 447659 523868 520648 114658 527793 407246 7 569081 541571 223723 382459 250146 688964 8 95312 226564 419402 9 71...

result:

ok Correct (2 test cases)

Test #22:

score: 0
Accepted
time: 118ms
memory: 11916kb

input:

2
372608
6161 118264 213659 293946 359350 233967 998 257534 249401 347493 368805 32132 103517 237945 271044 277292 119681 196699 283337 151083 111301 275696 191897 108525 323510 11725 161417 86376 136605 216341 62779 311126 89583 122522 291813 154811 246045 54158 369436 107863 22017 201059 155982 15...

output:

1 211789 322277 183740 344393 53299 108842 348895 16340 219195 332184 47171 17914 162877 77391 273822 321756 327674 119051 343978 242469 47307 304378 369017 160750 39425 366916 232460 256804 120247 277651 15931 318092 310578 334194 93594 359834 83498 103958 86691 200832 2674 3308 154945 309188 24906...

result:

ok Correct (2 test cases)

Test #23:

score: 0
Accepted
time: 100ms
memory: 9940kb

input:

2
422157
48267 316096 323543 400772 78389 341504 248827 236534 99971 415431 374598 189566 164740 367740 46908 284090 17 68342 387377 349247 218752 145102 285235 348717 33025 414010 180283 241559 230772 372204 229293 8883 35967 346124 288272 36 301437 362593 111482 367922 34022 316392 159968 1972 391...

output:

1 222502 200342 330418 48267 2 382503 223968 89926 316096 3 357961 24027 323543 4 413090 400772 5 263974 17047 127152 376107 132201 326453 5010 215570 99580 278993 78389 6 256150 274176 72546 118607 385403 42076 169198 269612 122068 371641 280281 46898 255112 200743 341504 7 129992 22507 372890 1158...

result:

ok Correct (2 test cases)

Test #24:

score: 0
Accepted
time: 126ms
memory: 10608kb

input:

3
129186
31755 11876 57100 86126 81796 35836 60008 95679 121107 63977 48671 107704 75245 125881 1952 84481 72400 20538 9788 121467 58250 15284 52305 122856 124667 83008 20996 32166 49867 96890 58689 101545 105869 105678 37189 124501 30217 72764 8227 124244 12229 34971 55154 56311 114246 41135 79766 ...

output:

1 49832 67623 43164 90247 60412 74327 98942 72619 39437 81875 118658 128865 40693 126414 60205 13424 7184 114918 2892 18447 127333 110546 60526 98918 126757 80850 127441 39981 92586 60719 107204 77584 58124 87894 26533 113772 61068 92861 8160 61319 111286 105185 124890 4402 24916 100571 72140 122540...

result:

ok Correct (3 test cases)

Test #25:

score: 0
Accepted
time: 121ms
memory: 10000kb

input:

4
576473
138534 9158 386505 271582 253613 505067 21315 255917 531131 70593 200185 399046 63462 384920 398535 135563 77884 46170 167179 416370 353883 271084 196966 361621 493549 195011 524237 384979 548509 88272 75116 465541 555434 505759 323150 511129 210266 362446 472113 217471 541744 121619 464159...

output:

1 135593 319356 187166 518085 64545 391303 158222 82799 46209 439061 251830 531161 495727 391461 186774 40565 472121 421633 323335 378482 437523 254109 25981 7987 437136 230403 296342 153564 253000 568657 386348 188109 537946 181996 344026 440466 311769 531288 5085 458922 335034 381316 263671 82814 ...

result:

ok Correct (4 test cases)

Test #26:

score: 0
Accepted
time: 118ms
memory: 11888kb

input:

5
291107
4344 253602 242407 4 5 236812 1999 179653 90206 274589 11 12 13 14 100064 16 17 151536 19 20 29619 22 23 290167 25 26 27 162665 29 198598 40701 215269 183865 34 52718 147488 129463 38 214863 149217 251494 266166 8325 44 75704 92419 277502 48 283269 272669 51 164404 53 146186 29598 169233 57...

output:

1 4344 2 253602 3 203643 181854 163755 242407 4 5 6 21497 25421 59731 257735 195968 35342 236812 7 1999 8 93051 233627 179653 9 90206 10 170250 162905 274589 11 12 13 14 15 100064 16 17 18 187440 151536 19 20 21 230053 258341 223837 228019 29619 22 23 24 290167 25 26 27 28 162665 29 30 198598 31 193...

result:

ok Correct (5 test cases)

Test #27:

score: 0
Accepted
time: 116ms
memory: 11380kb

input:

6
171846
88727 167968 171648 104621 113388 170614 83131 171812 114961 72135 75118 138444 119342 167606 83183 2544 119818 1538 47334 8831 148067 120230 50991 142431 131115 160279 25321 88060 34171 40731 87202 148162 122759 55748 157938 71982 39735 30505 77905 59596 60948 118087 124927 35449 131770 13...

output:

1 37915 149631 17465 9528 16436 43305 166552 106612 83568 109855 166000 74701 41673 12529 19264 72965 98797 50586 63269 103032 103944 93452 67753 30803 59885 157464 131334 39676 50130 168815 111196 82524 74130 127996 5743 135583 153636 70273 66434 78955 137033 68780 4416 59099 74284 157364 75786 242...

result:

ok Correct (6 test cases)

Test #28:

score: 0
Accepted
time: 109ms
memory: 9840kb

input:

7
34222
23613 18586 30860 26673 1470 24232 3310 9740 18142 24635 9368 4183 9405 3042 11074 13003 5948 19837 17297 6192 3902 15446 19385 21861 2574 22358 23569 12381 28520 4915 34060 13423 2816 10801 30581 16798 8629 17508 16908 16312 28630 8832 16593 32016 19801 19926 24548 4722 29268 9130 7641 8301...

output:

1 13082 12313 6503 1282 7315 4058 13157 17854 20235 13890 17868 29831 12046 22293 17201 23613 2 21817 27747 6729 20189 21885 33924 26082 7727 13241 17633 21325 12308 28201 16843 13191 16887 8425 20224 29624 14977 19148 10658 9819 21235 19591 4251 22425 10129 26279 9327 20370 25130 11546 8903 25218 1...

result:

ok Correct (7 test cases)

Test #29:

score: 0
Accepted
time: 100ms
memory: 7236kb

input:

8
124117
1 2 94219 73581 102279 57865 7 7582 362 44659 11 12 13923 50071 117683 16 48835 18 19 119653 68403 22 23 23598 25 26 27 112321 1175 99981 39947 30139 33 99236 84885 32089 24773 38 39 39429 93420 42 65218 44 109731 46 87083 44915 2873 50 97092 122740 32459 88363 55 4390 57 58 110977 14017 61...

output:

1 2 3 21938 98394 18505 94219 4 22858 73581 5 102279 6 57865 7 8 7582 9 113174 362 10 44659 11 12 13 91173 13923 14 50071 15 117683 16 17 94259 98088 54462 48835 18 19 20 119653 21 70079 68403 22 23 24 42189 68009 23598 25 26 27 28 112321 29 49866 1175 30 99981 31 103882 46446 22333 39947 32 30139 3...

result:

ok Correct (8 test cases)

Test #30:

score: 0
Accepted
time: 98ms
memory: 7156kb

input:

9
25269
3656 4305 20794 20524 4941 18071 11432 1354 24292 17833 21323 7468 13870 14 20138 5430 24955 23127 15922 20067 17287 22 22670 14424 22468 26 23166 7053 22199 23721 22154 24074 4257 7538 23332 21057 2107 2984 24798 11542 21386 11387 24020 7935 45 8540 1882 8124 24682 16920 24947 13365 6825 25...

output:

1 22317 23844 3656 2 16432 15789 4305 3 14128 16140 20794 4 20524 5 19939 19540 20363 24960 4941 6 13189 11970 18071 7 3384 9126 8090 11432 8 3309 16533 24729 1354 9 4253 24292 10 4005 24982 2957 17833 11 20326 10800 6882 22264 12798 23933 16688 4227 13906 21323 12 7468 13 13870 14 15 7080 3274 1111...

result:

ok Correct (9 test cases)

Test #31:

score: 0
Accepted
time: 103ms
memory: 6660kb

input:

10
143919
67710 2 129458 107948 49717 120331 7 128218 58515 79909 11 104303 70438 14 70861 63592 17 18 98891 20 45882 66998 93668 51451 81268 26 19878 28 25598 69454 45455 5371 64724 34 14288 72335 79409 65860 1896 40 55669 78955 43 103019 105786 116605 47284 6056 49 13596 141664 87382 53 54 62439 3...

output:

1 67710 2 3 129458 4 38780 107948 5 87752 129165 131496 49717 6 114089 31445 19847 93691 132245 120331 7 8 128218 9 29999 132980 58515 10 40963 15017 102761 129203 22353 128369 79909 11 12 104303 13 3538 70438 14 15 91649 70861 16 63592 17 18 19 98891 20 21 9110 22512 105873 20982 45882 22 66998 23 ...

result:

ok Correct (10 test cases)

Test #32:

score: 0
Accepted
time: 100ms
memory: 10448kb

input:

11
59994
28919 7546 17564 46765 16954 24583 33885 48269 37805 25491 9859 10000 56306 38924 59750 54979 17 13468 1054 56316 14451 44679 21323 55444 46596 58891 50718 7148 10580 27177 47509 48370 55051 29986 6217 5555 17183 1144 56697 49615 11242 34179 15502 19415 50815 35422 15680 27712 55002 25995 5...

output:

1 9063 13829 13423 29389 16659 14423 13318 28919 2 28873 49612 9193 10286 33722 3574 17591 12118 21724 39123 6779 59340 41816 40247 43062 8870 16248 3792 50658 59428 7546 3 57991 2919 1210 53703 15493 17564 4 446 1590 41224 54816 56338 32966 43955 42764 50627 942 45502 47446 16195 49347 56230 20922 ...

result:

ok Correct (11 test cases)

Test #33:

score: 0
Accepted
time: 115ms
memory: 7052kb

input:

12
296268
246194 195113 285819 144995 110267 278665 115028 243078 134463 264181 127223 112549 257710 245008 76626 14552 83091 221158 150463 278137 104120 125573 86778 137185 63708 260801 273375 284624 26676 8478 13628 144241 278947 89469 216821 176481 256176 283540 190373 255420 291753 110932 259911...

output:

1 129205 237259 4826 40620 106460 264849 28109 111944 247334 161206 235344 294068 38373 244788 143587 27575 151954 120200 126735 110210 250363 65604 127248 168126 149781 272931 103366 262728 224761 228726 226060 255499 152561 201983 276765 17091 159653 271657 49382 202717 281047 262870 83351 80078 2...

result:

ok Correct (12 test cases)

Test #34:

score: 0
Accepted
time: 110ms
memory: 7720kb

input:

13
58622
3302 18027 49527 11722 8017 35628 53598 48494 9324 28940 14825 24185 3548 56985 42983 13063 51742 41327 28216 12898 5492 32222 5228 19649 20509 48109 20044 21012 51120 5138 26491 28380 51448 37123 45036 25750 13970 1804 31231 20498 12066 986 57872 33097 35489 31770 54639 4045 13690 15786 46...

output:

1 39724 6818 25308 57435 36811 1215 16665 40123 15705 44197 41480 31793 29620 17413 46862 24489 5206 4789 42508 20508 58384 42207 36272 54986 40907 56215 48269 15676 8107 8957 37299 55191 3216 44022 14638 20713 58523 21688 49540 16599 9771 7067 34096 14996 20891 27086 10781 21422 30234 20686 24420 1...

result:

ok Correct (13 test cases)

Test #35:

score: 0
Accepted
time: 108ms
memory: 9248kb

input:

14
287735
250431 222877 25799 117882 153424 6 51352 180699 147333 223582 11 134078 255320 176994 221961 194160 109851 247808 32565 203538 9844 283440 166776 57945 281831 34772 152796 28 48870 30 189994 242066 61845 226764 110535 249472 195706 261012 239150 117942 98734 42 87817 226894 278701 43883 1...

output:

1 124722 226317 250431 2 5675 104595 215640 66413 31593 144127 272878 148150 220020 216070 222877 3 177508 124111 36980 25799 4 266170 117882 5 141100 50667 153424 6 7 243573 145905 262919 132069 5638 51352 8 180699 9 147333 10 223582 11 12 134078 13 97816 143655 255320 14 253199 216691 128821 17699...

result:

ok Correct (14 test cases)

Test #36:

score: 0
Accepted
time: 103ms
memory: 6348kb

input:

15
6181
3268 3157 394 214 5 6 2955 2598 1907 371 3273 12 13 3806 2104 16 3233 871 4997 1792 21 3013 4008 5153 5723 3060 2137 1322 1375 669 2726 3836 33 2867 5361 5995 1570 745 39 2633 136 5617 43 836 3043 2651 3462 4787 5758 771 4341 5774 53 2974 5735 4182 694 1305 1177 4287 2052 62 5382 64 5980 136...

output:

1 3498 2968 5513 2155 3268 2 3157 3 394 4 3719 763 1328 3924 5397 583 2030 5712 4843 214 5 6 7 1864 2955 8 3025 2598 9 4811 2791 2044 3223 1907 10 3400 2217 3984 961 371 11 237 5786 1364 5611 2757 3273 12 13 14 1266 3835 2191 3194 4582 6098 3806 15 5871 2104 16 17 659 3233 18 4111 2118 4573 3733 422...

result:

ok Correct (15 test cases)

Test #37:

score: 0
Accepted
time: 100ms
memory: 5916kb

input:

100
3026
1 2 3 4 2466 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 1822 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 1842 84 85 827 87 88 89 90 91 92 93 94 95 96 97 9...

output:

1 2 3 4 5 2466 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 1822 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 1842 84 85 86 827 87 88 89 90 91 92 93 94 95 96 97...

result:

ok Correct (100 test cases)

Test #38:

score: 0
Accepted
time: 90ms
memory: 6048kb

input:

101
8146
1 2 3883 4960 4762 3205 3799 1640 9 4446 255 4211 7920 7719 15 7820 697 18 3033 20 3199 1610 23 3547 2140 413 4588 3739 29 6962 31 8098 3747 34 5067 36 3407 38 5240 3509 41 4078 7441 2865 1409 46 7334 48 1653 7949 51 52 2123 1016 729 1374 57 4925 59 6743 61 62 1768 3984 5726 1894 5433 68 35...

output:

1 2 3 3465 3883 4 1216 4960 5 4762 6 7969 7529 3205 7 3799 8 1640 9 10 4887 4446 11 7161 782 746 255 12 4211 13 7920 14 7357 1670 1801 1524 7719 15 16 7882 7820 17 3347 697 18 19 6200 3033 20 21 3199 22 1610 23 24 1591 3547 25 3998 2140 26 3574 2938 3001 557 8109 413 27 4588 28 3555 5674 3739 29 30 ...

result:

ok Correct (101 test cases)

Test #39:

score: 0
Accepted
time: 90ms
memory: 6272kb

input:

102
14999
5489 4491 8375 6095 10926 2441 9421 1641 14240 10984 7862 6111 4031 8049 14669 9982 5229 14768 8209 13573 11158 4078 3308 6807 8681 1905 2701 4586 10924 1025 5433 9647 8381 2792 9868 10470 7144 4980 12189 11938 4034 11840 2779 6338 1055 3945 13152 11293 10954 9377 12727 1867 7296 14524 906...

output:

1 11480 1177 6648 11267 3588 14134 1698 8599 6010 8390 5327 13489 1691 5636 948 427 1778 14798 3106 9294 9078 3164 13298 2132 7183 12397 10018 12982 4231 8718 9966 1201 7206 9089 13199 4322 2442 8694 11681 437 13732 12920 2775 9014 14849 3250 2202 8420 11334 10487 10938 8291 12010 9508 12496 6377 14...

result:

ok Correct (102 test cases)

Test #40:

score: 0
Accepted
time: 83ms
memory: 5916kb

input:

103
19032
18365 130 13329 18529 2938 608 13636 12776 2937 18130 17907 18446 458 4634 4003 5804 1779 7958 2827 16045 7917 6139 9405 6110 16419 11364 16563 9659 18273 4062 17687 15599 9891 11866 15901 12774 11796 11690 17729 8186 6465 17803 15097 17721 9833 5026 1251 13562 16038 15438 4467 5441 11527 ...

output:

1 4066 7539 1279 15399 5298 19023 18550 15923 8455 12317 14813 2139 9795 5893 2711 66 7109 13311 5746 15515 16121 13714 5010 10181 9785 11339 1364 190 529 16468 14014 9636 10226 11547 18266 18856 17490 13488 2496 12700 5602 10169 9287 16370 10962 5436 9634 7452 13967 17815 10090 6360 11553 13016 864...

result:

ok Correct (103 test cases)

Test #41:

score: 0
Accepted
time: 93ms
memory: 7860kb

input:

104
1474
974 1408 1403 1265 168 854 65 1135 1158 940 100 1258 388 1292 255 1360 179 49 918 1468 498 1313 1358 1108 489 1169 387 785 914 569 1392 52 570 1455 1084 78 316 382 894 248 631 682 948 597 954 53 1055 926 114 137 749 959 314 324 277 60 994 57 1216 898 207 549 1270 853 1212 532 243 680 267 22...

output:

1 1360 16 371 1209 1319 471 849 100 11 381 785 28 1060 1184 989 1112 828 450 1280 708 124 959 52 32 808 933 186 551 470 252 1344 401 704 386 476 980 474 300 1407 513 436 765 703 497 1429 457 321 277 55 427 419 1454 594 1284 432 388 13 485 904 1411 266 1418 239 195 1249 1095 1341 104 1328 495 1203 79...

result:

ok Correct (104 test cases)

Test #42:

score: 0
Accepted
time: 96ms
memory: 6160kb

input:

105
4350
4127 1488 2648 3557 435 3468 1407 533 3564 2386 2446 114 3246 3460 368 1896 3446 2999 1812 1864 581 871 512 1495 3455 3874 2563 1382 3630 2472 4135 4317 2924 4025 2367 1322 2619 22 1101 3207 2086 2564 3153 2604 4156 3920 208 1023 1114 1482 1159 4177 4348 627 400 2878 1724 982 2250 1790 2274...

output:

1 2530 1524 1384 251 4108 4192 2090 2682 273 3582 3855 1824 3692 3639 3241 723 1626 3574 4057 3602 3477 4127 2 4136 3161 1028 3274 1326 1486 4290 1074 2951 213 2570 3148 3018 2681 3901 831 303 1127 2177 427 2445 359 610 3652 3335 1039 2634 1145 1305 1924 2135 142 3993 2066 1714 1783 2278 2281 700 99...

result:

ok Correct (105 test cases)

Test #43:

score: 0
Accepted
time: 100ms
memory: 5964kb

input:

1000
1896
29 588 1481 15 1020 1139 748 1085 725 368 580 1520 362 670 210 1031 1796 1366 596 1500 1513 277 1561 303 485 997 1055 253 1766 1140 1195 669 1403 1188 22 880 675 1057 1503 1385 1127 1274 1015 587 1817 1590 1792 859 1750 1490 401 1266 283 619 526 151 284 443 629 508 1865 795 1613 1416 1757 ...

output:

1 1561 23 533 1766 29 2 872 455 1526 561 1320 846 716 1380 1528 777 1105 809 1798 163 223 604 1556 639 588 3 1612 110 841 238 174 1286 108 342 1231 147 1135 1462 1481 4 714 627 413 1674 1716 903 948 296 1439 821 162 584 260 1196 1371 319 280 331 1539 1187 521 1575 257 603 1107 464 98 158 1138 927 85...

result:

ok Correct (1000 test cases)

Test #44:

score: 0
Accepted
time: 91ms
memory: 5924kb

input:

1001
877
49 700 741 217 744 510 396 418 592 791 227 164 749 311 865 750 573 45 199 173 98 443 310 157 413 773 63 567 248 33 798 481 171 4 466 656 392 281 868 873 588 845 201 703 124 365 184 154 505 256 565 180 179 754 513 651 468 140 30 558 678 89 126 736 735 721 346 587 692 393 451 529 377 330 775 ...

output:

1 406 473 614 322 384 679 794 206 423 547 751 855 582 558 60 757 217 4 34 383 534 796 126 63 27 692 69 877 85 284 124 45 18 486 505 49 2 456 251 404 631 345 849 321 435 416 700 3 781 763 294 807 583 622 215 431 503 374 762 760 466 35 349 636 874 83 766 784 747 571 517 80 589 639 210 753 286 458 92 7...

result:

ok Correct (1001 test cases)

Test #45:

score: 0
Accepted
time: 74ms
memory: 5692kb

input:

1002
92
21 2 48 88 66 41 7 8 71 16 12 57 67 60 15 10 17 79 61 20 1 22 19 24 84 26 27 29 33 85 50 32 28 64 11 80 81 38 52 77 6 42 76 44 5 46 47 30 92 31 51 39 25 49 9 91 35 65 59 14 23 62 69 34 58 45 13 73 40 37 55 72 68 74 75 43 63 78 4 36 3 82 90 53 70 86 87 18 89 83 56 54
152
146 18 123 92 116 29 ...

output:

1 21 2 3 81 37 70 85 30 48 4 79 18 88 5 45 66 6 41 7 8 9 55 71 10 16 11 35 57 12 13 67 14 60 15 17 19 23 61 20 22 24 25 53 84 26 27 28 33 29 31 50 32 34 64 36 80 38 39 52 40 69 63 77 42 43 76 44 46 47 49 54 92 51 56 91 58 65 59 62 68 73 72 74 75 78 82 83 90 86 87 89 
1 128 96 62 107 116 5 145 130 73...

result:

ok Correct (1002 test cases)

Test #46:

score: 0
Accepted
time: 92ms
memory: 5908kb

input:

1003
2339
1433 1479 282 611 118 1509 1150 1827 602 1702 2277 2323 801 1523 2076 1683 1708 688 1959 20 2230 395 1564 1709 2080 304 1305 2160 733 915 771 1611 2104 985 1178 1657 2112 632 1927 1998 911 1366 1251 1926 1527 1810 47 1570 572 1764 1161 1399 1464 1870 155 1092 2010 2060 2270 1372 786 1595 4...

output:

1 1629 1711 1703 1722 505 976 703 952 709 930 1882 1918 533 1583 2184 1474 1433 2 202 1445 1780 135 2326 2196 1245 1923 751 1912 2207 415 1167 1479 3 863 796 590 1821 285 284 1106 626 1420 120 1387 372 369 1322 2039 1169 878 1557 282 4 1803 1943 1115 320 1156 1393 1873 611 5 665 118 6 392 1700 1120 ...

result:

ok Correct (1003 test cases)

Test #47:

score: 0
Accepted
time: 91ms
memory: 5992kb

input:

1004
932
1 732 177 4 5 6 79 8 9 10 11 12 13 14 15 429 819 618 19 20 859 22 23 281 25 26 27 857 35 30 884 32 33 118 623 914 37 38 39 40 41 372 136 807 45 46 47 48 263 627 790 530 599 54 892 222 876 58 59 60 61 62 63 64 443 66 370 68 69 169 71 72 73 74 214 88 77 78 7 167 451 352 76 84 425 241 87 83 89...

output:

1 2 598 867 732 3 177 4 5 6 7 79 8 9 10 11 12 13 14 15 16 429 17 819 18 618 19 20 21 859 22 23 24 448 281 25 26 27 28 107 857 29 623 35 30 31 557 884 32 33 34 118 36 914 37 38 39 40 41 42 372 43 136 44 606 807 45 46 47 48 49 263 50 627 51 764 790 52 530 53 599 54 55 892 56 222 57 876 58 59 60 61 62 ...

result:

ok Correct (1004 test cases)

Test #48:

score: 0
Accepted
time: 85ms
memory: 5612kb

input:

1005
656
506 74 507 505 512 187 641 151 469 182 234 457 359 18 15 259 1 153 561 326 116 107 55 102 123 51 200 235 227 410 581 286 33 58 558 514 518 453 431 272 264 42 138 101 60 27 4 545 468 12 84 257 494 406 10 83 451 93 419 474 625 541 373 293 390 647 86 485 575 233 499 573 498 633 77 205 439 418 ...

output:

1 17 226 506 2 442 628 121 546 421 477 368 164 526 529 533 520 588 485 68 282 613 633 74 3 535 603 410 30 431 39 278 507 4 47 92 203 505 5 382 408 528 634 512 6 550 272 40 430 576 187 7 258 569 360 106 648 191 589 641 8 331 552 266 488 575 69 291 403 188 284 592 554 138 43 445 155 439 77 75 598 556 ...

result:

ok Correct (1005 test cases)

Test #49:

score: 0
Accepted
time: 87ms
memory: 5568kb

input:

10000
4
1 2 4 3
108
48 64 35 75 59 65 101 93 56 104 83 100 69 43 38 18 15 67 33 29 92 51 77 52 44 36 96 66 89 24 70 16 31 72 7 40 95 45 79 84 28 3 82 71 12 34 47 1 103 105 20 37 5 85 42 86 32 80 58 60 49 62 8 2 57 4 99 21 78 22 11 46 63 26 91 13 39 50 14 98 17 61 81 108 53 9 107 19 87 90 94 102 73 4...

output:

1 2 3 4 
1 48 2 64 3 42 55 98 80 58 59 5 53 85 54 101 7 35 4 66 28 41 94 91 75 6 102 92 21 68 99 67 18 16 32 57 65 8 63 73 93 9 86 56 10 104 11 71 44 25 100 12 45 38 15 17 81 83 13 76 106 105 50 78 69 14 79 39 77 23 107 87 89 29 20 51 22 70 31 33 19 88 103 49 61 82 43 24 30 95 37 52 26 74 96 27 97 1...

result:

ok Correct (10000 test cases)

Test #50:

score: 0
Accepted
time: 84ms
memory: 5848kb

input:

10001
35
13 31 11 23 35 1 26 21 34 3 10 20 14 5 16 24 33 2 9 32 17 30 15 8 29 18 28 27 6 19 12 22 4 7 25
27
5 18 17 26 6 19 25 21 3 1 2 27 4 12 13 20 7 23 14 9 11 22 24 8 15 16 10
309
92 183 305 4 100 249 93 83 101 245 226 56 131 58 186 179 94 187 71 11 52 147 16 207 75 146 3 122 285 123 152 150 259...

output:

1 6 29 25 35 5 14 13 2 18 26 7 34 9 19 30 22 32 20 12 31 3 10 11 4 33 17 21 8 24 16 15 23 27 28 
1 10 27 12 14 19 6 5 2 11 21 8 24 23 18 3 9 20 16 26 4 13 15 25 7 17 22 
1 203 219 90 204 176 230 133 231 248 206 36 92 2 193 140 155 72 129 183 3 27 249 6 262 232 76 229 305 4 5 139 188 241 122 28 43 20...

result:

ok Correct (10001 test cases)

Test #51:

score: 0
Accepted
time: 91ms
memory: 5684kb

input:

10002
402
275 227 367 402 91 249 345 167 268 222 290 36 215 156 280 23 78 119 240 231 129 300 270 293 378 352 10 107 76 112 234 301 216 82 336 221 252 386 37 147 110 348 173 118 127 385 377 286 135 214 287 132 384 382 321 61 387 83 272 172 186 150 370 210 116 28 332 140 397 284 322 64 103 209 188 26...

output:

1 298 156 14 378 25 214 50 275 2 315 278 193 206 211 153 119 18 367 3 90 354 133 128 217 260 346 231 20 272 59 91 5 126 282 370 63 401 105 175 252 37 39 305 230 142 189 224 222 10 27 132 52 139 390 110 41 351 281 118 44 273 303 192 284 70 372 79 279 157 248 232 87 395 325 399 236 314 179 263 241 220...

result:

ok Correct (10002 test cases)

Test #52:

score: 0
Accepted
time: 83ms
memory: 5616kb

input:

10003
18
16 7 15 4 13 14 17 11 10 3 6 2 18 9 12 1 8 5
40
20 22 33 29 25 19 40 28 36 30 9 7 12 34 38 24 6 14 18 15 37 8 3 1 13 35 26 27 5 31 21 39 10 4 11 23 32 2 17 16
19
19 13 10 4 16 15 8 14 3 9 5 12 2 11 18 7 6 1 17
187
1 2 3 4 5 6 40 8 154 10 11 12 13 14 15 141 17 18 19 20 21 22 23 24 25 26 27 2...

output:

1 16 2 12 15 3 10 9 14 6 11 8 17 7 4 5 18 13 
1 24 16 40 7 12 13 25 5 29 4 34 14 18 19 6 17 39 32 37 21 31 30 10 33 3 23 36 9 11 35 26 27 28 8 22 2 38 15 20 
1 18 15 6 17 19 2 13 3 9 10 4 5 11 14 8 7 16 12 
1 2 3 4 5 6 7 40 8 9 154 10 11 12 13 14 15 16 141 17 18 19 20 21 22 23 24 25 26 27 28 29 30 3...

result:

ok Correct (10003 test cases)

Test #53:

score: 0
Accepted
time: 91ms
memory: 5616kb

input:

10004
67
45 3 27 21 49 35 66 32 64 15 59 48 36 19 53 25 52 12 29 63 33 37 43 14 62 65 67 5 8 54 11 41 44 22 23 55 50 7 58 16 39 6 40 28 51 9 20 61 38 30 10 13 60 17 56 4 42 18 26 1 57 24 2 46 34 47 31
349
283 187 282 266 5 58 233 264 44 184 210 158 104 14 48 179 2 291 218 207 15 22 342 333 141 298 2...

output:

1 60 53 15 10 51 45 2 63 20 47 66 7 38 49 5 28 44 33 21 4 56 55 36 13 52 17 54 30 50 37 22 34 65 26 59 11 31 67 27 3 6 42 57 61 48 12 18 58 39 41 32 8 29 19 14 24 62 25 16 40 43 23 35 9 46 64 
1 124 28 83 300 240 302 227 191 283 2 17 230 40 133 154 67 199 132 187 3 293 125 260 282 4 233 7 212 338 11...

result:

ok Correct (10004 test cases)

Test #54:

score: 0
Accepted
time: 91ms
memory: 3648kb

input:

10005
64
12 21 16 34 42 8 54 19 22 48 59 55 62 47 13 64 61 60 29 6 23 2 49 5 44 56 33 26 25 37 39 57 27 52 14 11 20 18 3 36 30 50 53 58 46 38 35 10 32 4 31 24 45 1 7 28 51 41 63 43 9 15 40 17
43
41 33 31 14 12 27 11 16 22 40 8 19 30 10 6 5 29 35 24 1 42 20 38 34 13 17 4 18 21 37 25 43 3 2 15 9 36 39...

output:

1 54 7 55 12 2 22 9 61 17 64 16 3 39 31 51 57 32 49 23 21 4 50 42 5 24 52 34 6 20 37 30 41 58 44 25 29 19 8 10 48 11 36 40 63 59 13 15 62 14 35 47 18 38 46 45 53 43 60 26 28 56 27 33 
1 20 22 9 36 37 30 13 25 31 3 33 2 34 24 19 12 5 16 8 11 7 40 10 14 4 27 6 15 35 18 28 42 21 29 17 26 39 38 23 43 32...

result:

ok Correct (10005 test cases)

Test #55:

score: 0
Accepted
time: 102ms
memory: 3568kb

input:

99995
20
3 13 5 2 1 12 9 14 10 6 7 16 4 20 11 8 18 17 15 19
28
26 5 14 25 2 19 12 18 24 9 1 3 7 22 11 6 10 21 4 28 16 13 17 23 20 15 27 8
1
1
9
1 7 8 9 5 3 4 6 2
12
4 9 8 6 2 1 7 11 12 10 3 5
10
1 2 3 4 5 6 7 8 9 10
41
13 24 5 22 3 10 23 12 15 6 11 9 1 20 39 16 17 18 19 35 30 25 7 27 8 26 2 28 29 21...

output:

1 5 3 2 4 13 6 10 9 7 11 15 19 20 14 8 16 12 17 18 
1 11 15 26 2 5 3 12 7 13 22 14 4 19 6 16 21 18 8 28 20 25 9 10 17 23 24 27 
1 
1 2 9 4 7 3 6 8 5 
1 6 4 2 5 12 9 3 11 8 7 10 
1 2 3 4 5 6 7 8 9 10 
1 13 2 27 24 3 5 4 36 39 15 9 12 8 25 22 6 10 7 23 11 14 35 20 16 17 18 19 21 30 26 28 29 31 32 33 3...

result:

ok Correct (99995 test cases)

Test #56:

score: 0
Accepted
time: 102ms
memory: 5672kb

input:

99996
1
1
12
3 8 12 6 7 10 1 4 9 2 5 11
5
1 2 5 4 3
23
22 6 15 9 14 8 7 4 10 18 20 16 2 3 1 5 12 11 17 13 19 23 21
18
11 18 3 9 17 7 4 8 16 10 15 14 12 13 1 6 5 2
3
3 1 2
18
10 14 5 9 16 7 17 13 15 1 2 8 11 12 18 3 6 4
1
1
2
1 2
6
1 5 4 6 3 2
1
1
21
1 2 10 15 5 6 7 8 9 3 11 12 13 14 4 16 17 18 19 20...

output:

1 
1 7 5 11 12 3 2 10 6 4 8 9 
1 2 3 5 4 
1 15 3 14 5 16 12 17 19 21 23 22 2 13 20 11 18 10 9 4 8 6 7 
1 15 11 2 18 3 4 7 6 16 9 5 17 8 10 12 13 14 
1 2 3 
1 10 2 11 13 8 12 14 3 16 5 4 18 15 9 6 17 7 
1 
1 2 
1 2 6 4 3 5 
1 
1 2 3 10 4 15 5 6 7 8 9 11 12 13 14 16 17 18 19 20 21 
1 5 3 6 9 8 7 2 4 
...

result:

ok Correct (99996 test cases)

Test #57:

score: 0
Accepted
time: 94ms
memory: 3508kb

input:

99997
5
2 3 4 5 1
8
3 6 2 1 8 7 5 4
18
3 11 16 13 2 17 10 5 14 6 18 15 12 1 7 9 8 4
6
6 5 1 3 2 4
17
11 2 8 9 12 17 10 15 4 16 1 5 13 14 3 7 6
2
2 1
7
7 5 3 4 2 6 1
4
1 2 3 4
4
4 1 2 3
7
3 2 4 6 1 5 7
11
10 2 3 4 5 6 7 8 9 1 11
2
1 2
1
1
5
1 2 3 4 5
8
8 5 1 3 7 4 6 2
19
1 4 3 2 19 12 7 16 9 10 11 6 ...

output:

1 5 4 3 2 
1 4 8 5 7 6 2 3 
1 14 9 16 3 2 5 8 17 6 10 7 15 12 13 4 18 11 
1 3 4 6 2 5 
1 11 2 3 15 8 4 9 5 12 6 17 7 16 10 13 14 
1 2 
1 7 2 5 3 4 6 
1 2 3 4 
1 2 3 4 
1 5 6 4 3 2 7 
1 10 2 3 4 5 6 7 8 9 11 
1 2 
1 
1 2 3 4 5 
1 3 4 6 7 5 2 8 
1 2 4 3 5 19 6 12 7 8 16 9 10 11 13 14 15 17 18 
1 13 3 ...

result:

ok Correct (99997 test cases)

Test #58:

score: 0
Accepted
time: 100ms
memory: 3864kb

input:

99998
15
10 13 6 14 7 8 15 1 9 12 5 4 2 3 11
10
8 7 9 2 3 4 6 10 5 1
1
1
9
7 2 1 4 5 6 9 8 3
15
10 9 3 4 5 14 11 8 2 1 12 6 13 7 15
10
9 6 7 1 8 10 2 3 5 4
18
1 2 3 16 5 6 7 8 17 10 11 12 13 14 15 4 9 18
4
1 3 2 4
5
1 2 3 4 5
40
38 18 9 39 22 40 24 5 1 31 10 27 32 4 29 33 13 21 37 8 19 30 34 3 25 35...

output:

1 8 6 3 14 4 12 10 2 13 5 11 15 7 9 
1 10 8 2 4 6 7 3 5 9 
1 
1 3 9 7 2 4 5 6 8 
1 10 2 9 3 4 5 6 12 11 7 14 8 13 15 
1 4 10 6 2 7 3 8 5 9 
1 2 3 4 16 5 6 7 8 9 17 10 11 12 13 14 15 18 
1 2 3 4 
1 2 3 4 5 
1 9 3 24 7 38 2 40 6 34 23 30 22 5 8 20 36 37 19 21 18 4 14 28 27 12 35 26 39 10 11 32 13 17 3...

result:

ok Correct (99998 test cases)

Test #59:

score: 0
Accepted
time: 98ms
memory: 3552kb

input:

99999
33
7 26 21 23 17 27 13 16 28 2 11 19 15 20 4 14 6 1 5 8 30 9 12 22 32 10 29 3 33 31 18 24 25
16
13 15 5 1 16 14 2 6 3 10 4 12 7 8 11 9
19
17 16 6 9 1 10 5 7 4 14 11 3 2 12 15 13 18 8 19
15
4 5 11 13 3 12 6 15 14 7 10 1 8 2 9
3
1 2 3
7
1 3 7 6 4 2 5
6
2 4 1 3 6 5
9
3 8 4 9 1 7 5 2 6
25
12 3 21 ...

output:

1 18 31 30 21 3 28 9 22 24 32 25 33 29 27 6 17 5 19 12 23 4 15 13 7 2 10 26 8 20 14 16 11 
1 4 11 15 2 7 13 3 9 16 5 6 8 14 10 12 
1 5 7 8 18 17 2 13 16 3 12 14 10 6 4 9 11 15 19 
1 12 6 7 10 11 3 5 2 14 9 15 8 13 4 
1 2 3 
1 2 6 4 5 7 3 
1 3 4 2 5 6 
1 5 7 6 9 4 3 2 8 
1 12 2 21 3 4 10 5 6 8 17 14 ...

result:

ok Correct (99999 test cases)

Test #60:

score: 0
Accepted
time: 98ms
memory: 3668kb

input:

100000
1
1
9
8 1 2 7 5 3 4 6 9
14
4 2 10 5 6 12 13 1 8 11 9 3 14 7
7
4 6 5 3 7 2 1
46
31 34 46 5 4 36 24 21 3 16 23 2 29 38 14 10 15 35 45 12 19 39 25 37 33 7 22 43 1 41 9 13 27 40 17 42 26 20 11 18 30 28 44 6 8 32
4
1 4 3 2
1
1
14
1 2 3 10 14 12 13 4 9 8 7 6 5 11
1
1
27
11 25 22 26 5 14 27 21 13 15...

output:

1 
1 2 3 6 8 4 7 5 9 
1 8 9 11 10 3 12 6 5 4 2 7 14 13 
1 7 5 3 4 2 6 
1 29 13 32 46 3 9 31 2 12 20 38 14 15 17 35 18 40 34 4 5 6 44 43 28 42 36 7 26 37 24 8 45 19 21 10 16 11 39 22 27 33 25 23 30 41 
1 2 4 3 
1 
1 2 3 4 8 10 5 13 7 11 14 6 12 9 
1 
1 14 6 17 12 13 9 11 2 25 3 22 4 20 15 10 23 21 8 ...

result:

ok Correct (100000 test cases)

Extra Test:

score: 0
Extra Test Passed