QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#796088#9641. Two permutationscarrotqq100 ✓251ms8656kbC++141.2kb2024-12-01 10:35:342024-12-01 10:35:35

詳細信息

Subtask #1:

score: 10
Accepted

Test #1:

score: 10
Accepted
time: 1ms
memory: 5900kb

input:

10
1
1
2
1 1
3
1 2 2
4
1 1 3 2
5
1 2 1 2 1
2
1 1
1
1
3
1 2 2
1
1
5
1 1 1 3 2

output:

Yes
1 1 
Yes
1 2 2 1 
Yes
2 3 1 3 2 1 
Yes
4 3 1 2 3 2 4 1 
Yes
2 4 1 5 3 5 4 3 2 1 
Yes
1 2 2 1 
Yes
1 1 
Yes
2 3 1 3 2 1 
Yes
1 1 
Yes
5 4 1 3 2 3 4 2 5 1 

result:

ok Correct!

Test #2:

score: 10
Accepted
time: 1ms
memory: 5912kb

input:

10
4
1 2 3 3
1
1
5
1 2 1 4 2
1
1
3
1 1 1
5
1 1 1 1 1
3
1 2 1
5
1 1 2 3 4
5
1 1 1 3 2
5
1 1 3 1 5

output:

Yes
3 4 2 1 4 3 2 1 
Yes
1 1 
Yes
4 2 5 1 3 5 4 3 2 1 
Yes
1 1 
Yes
1 3 2 3 2 1 
Yes
1 5 4 3 2 5 4 3 2 1 
Yes
2 1 3 3 2 1 
Yes
5 3 4 1 2 4 5 2 3 1 
Yes
5 4 1 3 2 3 4 2 5 1 
Yes
5 3 1 4 2 5 4 3 2 1 

result:

ok Correct!

Test #3:

score: 10
Accepted
time: 1ms
memory: 5908kb

input:

10
5
1 2 3 4 5
5
1 1 2 3 4
5
1 2 2 3 4
5
1 1 3 2 5
5
1 1 1 1 1
5
1 2 3 4 4
5
1 2 2 2 2
5
1 1 1 2 3
5
1 2 1 2 1
5
1 2 1 2 2

output:

Yes
5 4 3 2 1 5 4 3 2 1 
Yes
5 3 4 1 2 4 5 2 3 1 
Yes
4 5 2 3 1 5 3 4 2 1 
Yes
5 4 3 1 2 5 3 2 4 1 
Yes
1 5 4 3 2 5 4 3 2 1 
Yes
4 5 3 2 1 5 4 3 2 1 
Yes
2 5 4 3 1 5 4 3 2 1 
Yes
5 4 1 3 2 3 5 2 4 1 
Yes
2 4 1 5 3 5 4 3 2 1 
Yes
2 5 4 1 3 5 4 3 2 1 

result:

ok Correct!

Subtask #2:

score: 10
Accepted

Test #4:

score: 10
Accepted
time: 1ms
memory: 8008kb

input:

10
10
1 2 3 4 3 1 2 4 3 8
10
1 2 1 1 4 6 4 5 2 9
10
1 2 2 4 5 3 7 7 2 3
10
1 1 2 4 5 4 3 5 7 7
10
1 2 2 4 4 1 6 6 6 10
10
1 2 2 4 1 3 7 7 1 10
10
1 2 3 4 2 1 3 3 1 7
10
1 1 1 4 5 1 3 5 4 7
10
1 2 2 1 1 2 6 5 8 5
10
1 2 2 2 5 3 6 2 4 5

output:

Yes
10 4 8 3 9 5 2 7 1 6 9 8 10 7 6 5 4 3 2 1 
Yes
10 7 6 5 8 2 9 1 4 3 9 10 8 6 4 7 5 3 2 1 
Yes
10 7 8 6 5 4 2 9 3 1 9 8 7 5 4 3 10 6 2 1 
Yes
10 9 5 8 4 6 3 7 1 2 8 7 10 9 6 5 4 2 3 1 
Yes
10 9 8 7 4 5 2 3 1 6 10 6 9 8 7 5 4 3 2 1 
Yes
10 7 8 6 4 2 3 1 9 5 10 9 8 7 5 4 3 6 2 1 
Yes
10 4 3 8 7 2 5...

result:

ok Correct!

Test #5:

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

input:

10
10
1 1 3 1 1 1 2 3 5 7
10
1 2 2 1 4 5 6 7 9 8
10
1 2 2 1 5 4 2 3 6 8
10
1 1 1 4 5 3 1 2 2 3
10
1 1 2 4 5 2 6 2 6 3
10
1 2 3 3 5 4 6 1 9 6
10
1 1 1 4 1 4 1 2 8 10
10
1 2 2 2 1 3 1 1 5 8
10
1 1 3 1 5 3 2 5 6 5
10
1 2 3 4 1 5 7 8 4 2

output:

Yes
9 7 10 3 8 1 6 5 4 2 10 8 6 5 9 4 3 2 7 1 
Yes
10 9 7 8 5 6 2 3 1 4 9 8 10 6 7 4 5 3 2 1 
Yes
8 10 6 9 5 2 7 3 1 4 10 9 7 5 4 6 3 8 2 1 
Yes
10 9 8 6 5 4 1 7 3 2 7 5 4 3 10 6 2 9 8 1 
Yes
8 6 9 7 5 4 3 10 1 2 10 9 7 5 4 2 8 6 3 1 
Yes
9 6 10 7 5 3 4 2 1 8 10 9 8 7 5 4 6 3 2 1 
Yes
10 8 9 4 6 1 7...

result:

ok Correct!

Test #6:

score: 10
Accepted
time: 1ms
memory: 6036kb

input:

10
10
1 1 1 3 5 4 1 2 8 9
10
1 2 2 1 2 2 5 4 5 1
10
1 1 1 1 1 2 5 2 1 10
10
1 2 2 3 2 1 3 4 7 4
9
1 1 4 3 3 5 5 4 5
9
1 1 2 2 5 4 6 3 3
9
1 2 1 4 3 5 2 5 3
10
1 2 2 4 2 5 5 3 1 9
9
1 2 3 2 4 5 6 8 9
10
1 1 1 1 4 6 4 5 7 10

output:

Yes
10 8 9 5 4 6 1 7 3 2 9 10 7 6 5 3 4 2 8 1 
Yes
9 8 7 2 6 5 3 1 10 4 10 6 5 9 7 4 8 3 2 1 
Yes
10 8 7 6 1 9 5 4 3 2 10 9 5 7 4 3 2 8 6 1 
Yes
7 9 4 10 8 2 5 3 1 6 10 9 8 6 5 3 7 4 2 1 
No
Yes
7 5 4 6 3 9 8 1 2 9 8 6 7 5 2 4 3 1 
Yes
9 5 8 6 4 2 7 1 3 8 7 6 4 3 9 5 2 1 
Yes
10 8 7 6 4 2 5 3 1 9 9 ...

result:

ok Correct!

Subtask #3:

score: 15
Accepted

Test #7:

score: 15
Accepted
time: 70ms
memory: 8264kb

input:

10
177329
1 1 2 2 1 4 1 2 3 3 2 3 4 1 2 3 3 2 2 2 2 3 4 3 1 2 4 2 4 1 4 2 2 4 1 3 3 4 1 1 1 3 2 4 3 3 2 4 2 2 4 1 1 4 3 1 4 4 4 3 1 4 1 3 2 1 2 3 2 4 2 4 4 2 1 3 2 2 2 3 3 1 4 1 3 1 2 4 1 4 2 3 4 3 1 4 4 1 2 2 3 3 4 1 4 4 3 4 3 2 1 2 4 3 1 1 4 4 4 2 3 4 3 3 3 1 4 4 1 1 2 4 4 1 3 4 4 4 2 1 2 2 1 2 3 ...

output:

Yes
177328 177326 177324 177321 177317 177313 177312 177311 177308 177294 177292 177290 177278 177270 177265 177262 177253 177242 177237 177233 177232 177213 177212 177210 177206 177191 177189 177188 177187 177180 177179 177175 177172 177168 177165 177164 177162 177155 177151 177145 177143 177140 17...

result:

ok Correct!

Test #8:

score: 15
Accepted
time: 93ms
memory: 8464kb

input:

10
42861
1 2 1 2 3 1 2 2 1 1 3 4 3 1 2 3 2 2 3 2 3 4 2 2 2 4 2 3 1 2 1 4 4 2 4 3 1 1 4 3 1 1 4 1 1 4 3 3 1 3 3 3 2 4 4 1 3 2 1 1 1 1 1 1 4 3 1 1 2 4 1 1 2 4 2 3 4 4 4 2 4 3 3 3 2 1 3 4 4 3 1 3 4 4 4 1 4 4 1 3 2 4 4 3 3 4 3 3 4 3 1 4 2 1 2 3 2 4 3 4 1 2 3 4 2 4 1 3 4 1 1 1 4 3 4 2 1 4 3 1 3 3 2 1 1 4...

output:

Yes
42861 42860 42858 42857 42854 42853 42841 42839 42838 42836 42835 42834 42831 42827 42824 42820 42819 42816 42814 42812 42808 42806 42805 42799 42798 42797 42796 42795 42791 42790 42785 42782 42781 42778 42777 42774 42773 42771 42770 42768 42765 42763 42761 42759 42757 42756 42755 42753 42751 42...

result:

ok Correct!

Test #9:

score: 15
Accepted
time: 76ms
memory: 8560kb

input:

10
45364
1 1 1 1 1 1 1 2 2 2 2 1 2 4 3 3 1 4 1 3 2 2 3 1 2 2 3 2 3 3 3 2 3 3 2 3 2 1 1 3 4 2 2 4 4 3 1 2 4 1 3 4 4 1 3 4 1 4 3 2 1 2 3 3 4 4 1 3 3 3 2 3 4 4 2 1 2 1 2 1 1 2 2 2 3 1 3 3 1 4 1 3 1 2 3 4 2 2 3 3 1 3 3 4 4 4 4 1 1 4 4 1 4 2 2 1 1 4 3 3 4 3 4 4 4 4 4 1 4 4 1 4 3 1 3 1 3 3 4 1 1 2 1 2 1 3...

output:

Yes
45363 45361 45360 45359 45358 45357 45355 45353 45350 45349 45348 45347 45345 45344 45343 45342 45341 45340 45339 45338 45335 45334 45332 45331 45330 45329 45328 45327 45325 45323 45321 45320 45318 45316 45313 45311 45310 45308 45307 45306 45305 45304 45303 45300 45298 45297 45296 45295 45294 45...

result:

ok Correct!

Test #10:

score: 15
Accepted
time: 86ms
memory: 7832kb

input:

10
60502
1 1 3 2 4 3 2 4 4 1 2 2 3 3 4 3 3 4 3 1 3 4 1 2 1 1 2 1 4 2 2 2 4 4 4 3 3 1 4 1 3 4 4 4 4 2 1 3 1 2 4 4 2 1 4 4 1 2 3 3 1 2 2 4 1 3 3 1 4 1 2 2 4 1 1 4 2 1 3 3 4 4 4 4 2 2 2 2 4 4 4 3 4 3 2 4 4 4 1 4 2 3 2 3 2 3 2 1 3 2 4 2 1 1 1 3 2 3 2 2 1 2 1 4 2 2 4 4 2 3 2 4 2 1 4 2 3 2 1 1 1 1 3 2 2 3...

output:

Yes
60502 60495 60486 60483 60481 60479 60478 60472 60467 60462 60454 60450 60446 60442 60440 60436 60435 60432 60428 60426 60422 60418 60414 60412 60408 60401 60395 60390 60382 60380 60373 60371 60370 60369 60365 60361 60352 60348 60346 60344 60342 60340 60337 60335 60334 60330 60329 60323 60310 60...

result:

ok Correct!

Test #11:

score: 15
Accepted
time: 94ms
memory: 8356kb

input:

10
192651
1 2 4 1 3 2 3 1 1 4 2 2 2 2 1 3 2 3 1 1 1 1 2 4 3 4 2 2 1 2 3 4 4 3 1 3 1 4 1 3 4 1 4 2 4 1 2 1 2 2 4 2 4 4 1 4 3 2 2 1 1 3 1 3 2 2 3 1 4 3 4 4 3 1 3 2 2 2 3 3 3 1 1 2 3 3 2 3 2 3 3 4 2 4 1 1 2 1 4 4 1 1 1 1 1 2 2 2 2 4 3 3 4 4 2 3 2 1 2 3 2 2 1 4 3 4 1 4 2 4 4 4 2 1 1 3 2 1 2 1 3 1 2 3 1 ...

output:

No
Yes
165221 165219 165215 165214 165213 165211 165209 165208 165207 165206 165205 165202 165200 165199 165198 165193 165191 165188 165187 165185 165181 165179 165177 165174 165173 165172 165171 165170 165168 165167 165163 165162 165159 165158 165155 165154 165153 165152 165150 165145 165143 165141...

result:

ok Correct!

Test #12:

score: 15
Accepted
time: 78ms
memory: 8224kb

input:

10
96064
1 1 1 1 4 4 1 4 1 1 2 1 3 4 3 2 2 2 1 1 1 2 1 1 3 4 1 2 2 3 2 2 3 4 4 3 3 3 4 3 2 3 3 4 3 4 3 4 2 3 2 2 3 4 1 1 1 2 3 2 3 3 4 1 4 4 3 1 2 3 3 3 3 2 4 4 2 2 3 4 4 1 4 1 1 2 1 4 2 3 3 2 4 2 1 4 3 4 1 4 4 2 1 3 1 2 4 2 2 4 3 3 4 4 4 3 3 4 1 3 2 1 2 1 2 1 2 1 2 4 3 4 1 4 4 4 2 1 2 1 4 3 3 4 2 1...

output:

Yes
96062 96061 96060 96059 96058 96057 96056 96055 96054 96053 96052 96051 96050 96049 96048 96047 96046 96045 96044 96043 96042 96041 96038 96037 96035 96034 96033 96031 96030 96029 96028 96027 96026 96025 96023 96022 96021 96020 96018 96016 96015 96014 96013 96012 96011 96010 96009 96008 96007 96...

result:

ok Correct!

Subtask #4:

score: 15
Accepted

Test #13:

score: 15
Accepted
time: 211ms
memory: 8544kb

input:

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

output:

Yes
199850 199849 199848 199847 199846 199845 199844 199843 199842 199841 199840 199839 199838 199837 199836 199835 199834 199833 199832 199831 199830 199829 199828 199827 199826 199825 199824 199823 199822 199821 199820 199819 199818 199817 199816 199815 199814 199813 199812 199811 199810 199809 19...

result:

ok Correct!

Test #14:

score: 15
Accepted
time: 218ms
memory: 8488kb

input:

10
199997
1 1 1 4 4 6 4 8 4 10 11 10 6 14 15 16 17 15 19 15 14 4 15 10 25 26 27 1 29 30 31 26 33 15 30 36 37 38 39 38 33 4 10 44 25 33 33 11 49 50 31 1 53 54 55 14 50 58 8 49 36 6 63 39 65 6 33 10 69 29 19 72 29 74 1 76 63 49 4 80 50 82 83 15 4 86 87 50 89 36 27 89 93 11 95 63 1 37 99 100 101 102 10...

output:

Yes
199993 199992 199989 199987 199985 199982 199981 199980 199975 199974 199972 199970 199967 199966 199965 199964 199962 199961 199959 199954 199950 199948 199943 199942 199941 199940 199939 199937 199934 199933 199931 199927 199926 199924 199922 199921 199920 199918 199917 199912 199911 199906 19...

result:

ok Correct!

Test #15:

score: 15
Accepted
time: 226ms
memory: 8468kb

input:

10
199730
1 2 2 2 1 2 2 1 2 10 2 12 13 10 15 16 17 13 19 20 1 13 16 24 19 2 27 28 29 17 28 12 1 16 28 1 17 13 24 17 41 42 24 17 41 28 47 2 2 2 51 52 51 15 42 56 57 42 59 20 51 62 47 64 47 66 42 12 69 70 69 15 51 74 10 47 77 78 13 69 81 82 83 84 64 2 87 28 10 90 91 10 13 74 70 96 97 12 99 17 15 17 87...

output:

Yes
199729 199728 199727 199719 199717 199716 199715 199704 199696 199693 199692 199690 199689 199684 199682 199675 199673 199672 199671 199670 199667 199666 199663 199657 199650 199642 199640 199637 199636 199635 199633 199629 199628 199627 199624 199622 199620 199617 199608 199603 199601 199598 19...

result:

ok Correct!

Test #16:

score: 15
Accepted
time: 227ms
memory: 8532kb

input:

10
199782
1 2 2 2 1 1 1 1 1 2 2 2 2 2 2 2 1 1 1 1 2 2 1 2 1 1 2 1 1 2 2 1 33 33 33 33 1 2 1 1 2 2 1 2 2 33 2 1 1 1 33 33 2 33 2 1 2 2 1 1 2 1 1 33 2 2 1 33 2 1 33 1 1 2 2 33 2 33 2 1 33 33 33 2 2 1 1 1 1 1 33 2 2 2 2 33 1 1 2 33 1 33 1 1 1 2 2 2 33 33 33 2 2 1 33 2 33 2 2 2 33 33 1 1 33 1 33 2 1 2 3...

output:

Yes
199777 199627 199697 199494 199227 199184 199180 199065 198855 198851 198771 199344 198536 199068 198529 199097 198994 198877 198445 198440 198332 199459 199362 198164 198239 198102 198063 198503 198053 197852 198591 198340 197844 199471 199127 198019 197903 197824 199614 198304 197736 197509 19...

result:

ok Correct!

Test #17:

score: 15
Accepted
time: 199ms
memory: 8492kb

input:

10
199768
1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 ...

output:

Yes
1 199768 199767 199766 199765 199764 199763 199762 199761 199760 199759 199758 199757 199756 199755 199754 199753 199752 199751 199750 199749 199748 199747 199746 199745 199744 199743 199742 199741 199740 199739 199738 199737 199736 199735 199734 199733 199732 199731 199730 199729 199728 199727 ...

result:

ok Correct!

Test #18:

score: 15
Accepted
time: 41ms
memory: 8340kb

input:

10
199897
1 133473 137888 154846 104937 137888 3569 104774 144338 186307 16043 175982 174471 97731 56127 91564 38890 40649 89585 22112 91564 169703 102594 111754 96581 132350 39595 142435 3652 102405 58841 71649 89585 104964 111754 27732 141427 45005 177850 292 102734 71015 113628 177036 16043 30227...

output:

No
No
No
No
No
No
No
No
No
No

result:

ok Correct!

Subtask #5:

score: 50
Accepted

Test #19:

score: 50
Accepted
time: 241ms
memory: 8472kb

input:

10
199755
1 2 1 3 5 1 6 7 2 1 5 6 10 9 12 2 4 14 2 18 5 17 23 4 6 7 4 6 20 27 16 24 29 8 33 26 33 27 17 39 5 33 34 41 4 16 24 19 42 8 29 48 48 27 37 24 43 13 4 28 38 27 38 23 29 55 14 62 26 9 62 20 35 31 57 74 69 5 26 60 33 59 5 19 21 45 15 87 3 54 17 2 57 36 18 67 25 62 47 53 89 27 5 59 75 77 29 9 ...

output:

Yes
199755 199754 199748 199743 199741 199739 199738 199737 199735 199734 199732 199729 199728 199726 199722 199718 199714 199713 199712 199710 199709 199708 199706 199705 199704 199703 199700 199695 199694 199692 199691 199688 199687 199685 199683 199682 199681 199680 199679 199678 199677 199676 19...

result:

ok Correct!

Test #20:

score: 50
Accepted
time: 251ms
memory: 8480kb

input:

10
199738
1 1 2 1 5 4 6 6 2 8 7 1 5 13 11 9 7 13 3 8 7 14 8 24 17 12 1 11 20 28 4 20 17 12 6 15 32 36 19 11 25 37 26 43 4 37 22 5 18 10 46 51 41 20 23 52 7 28 49 49 27 62 25 7 17 55 59 27 19 1 32 51 9 54 4 24 13 26 7 78 11 40 30 63 31 8 71 61 24 26 57 35 36 76 49 4 89 51 48 100 72 100 58 3 59 66 36 ...

output:

Yes
199738 199737 199736 199734 199729 199726 199725 199724 199723 199722 199718 199716 199714 199712 199711 199707 199706 199702 199701 199700 199699 199698 199695 199694 199693 199692 199690 199687 199683 199682 199680 199679 199677 199676 199675 199674 199669 199667 199666 199662 199661 199660 19...

result:

ok Correct!

Test #21:

score: 50
Accepted
time: 250ms
memory: 8476kb

input:

10
199701
1 1 3 2 5 6 6 1 1 5 7 10 13 12 1 12 5 16 10 19 16 6 21 20 21 17 18 26 8 17 13 18 9 34 32 1 24 10 35 15 26 31 37 42 1 19 22 40 32 3 16 48 19 11 47 17 31 24 27 54 20 7 55 9 24 4 24 25 21 12 65 62 38 11 50 13 43 69 53 54 78 61 80 19 6 9 55 77 60 26 42 19 16 60 32 94 25 39 29 57 4 93 56 56 86 ...

output:

Yes
199701 199700 199698 199696 199694 199693 199687 199684 199681 199677 199675 199672 199664 199662 199660 199659 199657 199656 199653 199652 199651 199650 199647 199646 199642 199641 199638 199633 199631 199629 199626 199624 199623 199622 199621 199620 199618 199614 199613 199611 199608 199607 19...

result:

ok Correct!

Test #22:

score: 50
Accepted
time: 224ms
memory: 8592kb

input:

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

output:

Yes
199753 199752 199751 199750 199749 199748 199747 199746 199745 199744 199743 199742 199741 199740 199739 199738 199737 199736 199735 199734 199733 199732 199731 199730 199729 199728 199727 199726 199725 199724 199723 199722 199721 199720 199719 199718 199717 199716 199715 199714 199713 199712 19...

result:

ok Correct!

Test #23:

score: 50
Accepted
time: 227ms
memory: 8548kb

input:

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

output:

Yes
199749 199750 199747 199748 199745 199746 199743 199744 199741 199742 199739 199740 199737 199738 199735 199736 199733 199734 199731 199732 199729 199730 199727 199728 199725 199726 199723 199724 199721 199722 199719 199720 199717 199718 199715 199716 199713 199714 199711 199712 199709 199710 19...

result:

ok Correct!

Test #24:

score: 50
Accepted
time: 246ms
memory: 8584kb

input:

10
200000
1 2 2 2 5 3 6 2 9 1 9 5 6 1 15 12 9 15 9 19 7 14 16 23 7 16 6 14 17 20 24 8 32 6 14 11 15 30 4 38 17 37 24 11 27 2 27 17 19 32 36 25 31 26 35 1 10 31 46 17 4 39 28 3 49 22 24 47 33 4 28 26 20 74 67 73 57 33 23 62 73 14 16 67 37 83 8 4 51 2 2 81 88 27 28 11 49 45 25 31 37 77 83 99 8 44 63 3...

output:

Yes
200000 199998 199995 199990 199989 199985 199983 199979 199978 199976 199975 199972 199971 199970 199969 199968 199967 199965 199964 199963 199962 199955 199952 199951 199949 199947 199946 199945 199942 199941 199937 199936 199935 199934 199929 199928 199927 199922 199919 199918 199911 199910 19...

result:

ok Correct!

Test #25:

score: 50
Accepted
time: 249ms
memory: 8588kb

input:

10
199804
1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 2 2 4 3 6 2 5 1 5 6 2 7 1 12 12 14 16 16 3 10 7 16 5 25 17 20 5 13 15 6 7 7 21 9 18 26 8 26 6 22 34 25 24 21 9 16 3 13 48 42 41 50 43 26 17 12 53 57 43 56 60 63 42 29 63 20 40 7 6 65 66 64 36 25 72 49 14 27 37 32 59 61 9 85 31 70 21 2 54 12 50 31 7...

output:

Yes
199801 199797 199795 199791 199790 199788 199787 199785 199783 199780 199779 199777 199775 199774 199773 199772 199770 199768 199761 199760 199759 199754 199752 199751 199750 199748 199747 199744 199742 199741 199740 199739 199737 199736 199734 199732 199729 199725 199724 199721 199720 199719 19...

result:

ok Correct!

Test #26:

score: 50
Accepted
time: 230ms
memory: 8656kb

input:

10
199826
1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 2 3 2 3 6 5 4 1 10 9 7 7 3 6 4 5 7 10 6 7 5 6 3 20 22 11 11 27 27 21 17 5 32 17 26 10 4 29 29 11 24 14 27 32 11 43 36 21 22 13 28 43 33 17 51 7 15 30 37 38 8 28 61 4 38 65 65 4 23 22 35 4 8 1 43 75 39 12 38 73 50 42 71 80 82 69 88 9 44 84 12 49 83 ...

output:

Yes
199826 199825 199824 199822 199819 199817 199814 199811 199810 199809 199807 199805 199804 199803 199801 199796 199795 199793 199789 199785 199784 199781 199778 199777 199775 199774 199772 199771 199770 199769 199767 199764 199763 199762 199759 199755 199752 199751 199749 199748 199747 199746 19...

result:

ok Correct!

Test #27:

score: 50
Accepted
time: 217ms
memory: 8464kb

input:

10
199955
1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 3 4 1 6 7 1 8 8 1 7 12 10 8 9 13 5 3 19 18 8 15 24 5 5 14 23 13 14 6 29 28 12 13 3 7...

output:

Yes
199954 199952 199950 199944 199943 199938 199932 199928 199923 199921 199918 199917 199916 199915 199914 199913 199911 199905 199904 199903 199900 199897 199896 199895 199894 199893 199892 199889 199887 199882 199879 199878 199874 199871 199866 199863 199861 199855 199854 199852 199851 199850 19...

result:

ok Correct!

Test #28:

score: 50
Accepted
time: 226ms
memory: 8544kb

input:

10
199833
1 1 1 1 9 5 4 7 2 6 7 2 12 2 4 7 6 4 6 19 18 2 8 6 18 22 21 7 25 18 22 24 24 29 1 3 10 18 28 26 33 3 25 42 17 37 31 14 26 39 18 25 35 6 21 4 5 37 34 56 25 7 26 25 17 22 31 42 54 6 17 35 13 34 15 1 35 37 43 19 50 70 59 70 34 45 63 37 29 4 82 52 35 8 4 10 45 33 40 40 58 23 73 74 86 3 54 55 4...

output:

No
Yes
199865 199864 199863 199861 199860 199858 199857 199856 199851 199850 199849 199848 199845 199843 199840 199839 199838 199835 199834 199831 199830 199826 199825 199824 199823 199822 199820 199819 199815 199814 199812 199811 199809 199807 199806 199805 199803 199802 199801 199799 199797 199795...

result:

ok Correct!