QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#626421#5245. Chodzenie po linie [B]dongyc6664 3200ms951252kbC++144.3kb2024-10-10 08:18:382024-10-10 08:18:40

Details

Tip: Click on the bar to expand more detailed information

Subtask #1:

score: 1
Accepted

Test #1:

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

input:

1
1

output:

0 

result:

ok 1 number(s): "0"

Test #2:

score: 1
Accepted
time: 6ms
memory: 26764kb

input:

2
2 1

output:

1 1 

result:

ok 2 number(s): "1 1"

Test #3:

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

input:

3
2 1 3

output:

1 1 0 

result:

ok 3 number(s): "1 1 0"

Test #4:

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

input:

4
1 4 2 3

output:

0 2 3 3 

result:

ok 4 number(s): "0 2 3 3"

Test #5:

score: 1
Accepted
time: 3ms
memory: 26416kb

input:

5
4 1 2 3 5

output:

3 5 5 5 0 

result:

ok 5 number(s): "3 5 5 5 0"

Test #6:

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

input:

6
6 4 2 1 3 5

output:

5 6 7 7 8 9 

result:

ok 6 numbers

Test #7:

score: 1
Accepted
time: 3ms
memory: 26416kb

input:

7
4 7 5 1 6 3 2

output:

9 7 8 9 9 7 7 

result:

ok 7 numbers

Test #8:

score: 1
Accepted
time: 6ms
memory: 26336kb

input:

8
2 4 3 1 5 7 8 6

output:

5 4 4 3 0 3 3 2 

result:

ok 8 numbers

Test #9:

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

input:

9
1 2 3 9 7 8 5 4 6

output:

0 0 0 5 6 6 6 6 7 

result:

ok 9 numbers

Test #10:

score: 1
Accepted
time: 6ms
memory: 28104kb

input:

10
4 2 1 6 9 3 8 5 7 10

output:

16 22 22 17 14 13 18 18 20 0 

result:

ok 10 numbers

Test #11:

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

input:

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

output:

20 29 14 19 18 18 17 21 27 20 19 

result:

ok 11 numbers

Test #12:

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

input:

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

output:

12 22 14 14 16 14 14 19 15 14 13 13 

result:

ok 12 numbers

Test #13:

score: 1
Accepted
time: 3ms
memory: 26992kb

input:

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

output:

11 11 11 11 11 11 11 11 11 11 11 11 

result:

ok 12 numbers

Test #14:

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

input:

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

output:

61 43 51 33 37 41 33 31 43 37 61 51 

result:

ok 12 numbers

Subtask #2:

score: 1
Accepted

Test #15:

score: 1
Accepted
time: 6ms
memory: 27200kb

input:

500
205 204 190 155 2 17 29 431 494 438 336 6 310 458 239 327 131 5 93 44 359 398 249 63 314 281 395 177 411 122 55 436 166 447 25 480 242 261 456 43 422 364 46 424 383 279 91 464 448 435 58 220 332 237 485 418 26 370 86 255 56 159 77 206 257 348 468 320 292 212 103 484 68 256 451 167 22 473 64 299 ...

output:

794 794 807 841 1130 1019 980 575 513 568 667 985 693 552 762 677 860 980 898 946 652 614 754 925 693 723 620 815 608 864 926 588 825 581 948 552 759 743 575 929 601 652 927 602 634 723 884 578 589 595 911 772 679 755 566 608 927 648 881 743 905 819 888 784 746 672 591 692 715 774 862 582 887 744 60...

result:

ok 500 numbers

Test #16:

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

input:

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

output:

176 128 157 109 107 108 137 161 171 114 119 169 123 158 121 168 120 166 142 165 165 126 124 136 137 166 151 129 175 130 129 129 132 171 164 169 139 159 150 142 134 147 153 157 155 151 154 148 153 151 153 153 152 147 147 149 147 152 152 145 157 150 144 142 156 157 150 158 138 157 154 167 146 143 147 ...

result:

ok 500 numbers

Test #17:

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

input:

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

output:

29 28 43 30 26 27 27 27 24 26 28 28 26 29 24 34 23 40 23 3 3 3 3 11 12 17 15 15 15 15 17 18 19 10 40 40 61 51 32 49 42 35 40 44 44 39 43 42 41 42 42 39 42 41 39 34 44 43 52 33 48 13 9 8 8 8 9 9 1 1 0 26 24 25 26 24 25 22 21 25 25 24 26 18 26 18 18 17 24 31 37 33 33 34 33 31 33 32 30 31 35 34 27 35 3...

result:

ok 500 numbers

Test #18:

score: 1
Accepted
time: 3ms
memory: 28228kb

input:

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

output:

809 810 810 787 898 786 903 788 787 797 788 786 786 785 785 785 886 788 789 619 703 620 706 706 696 622 705 621 694 623 623 691 633 633 627 627 626 625 626 628 677 650 648 648 668 636 523 597 524 522 594 523 523 546 579 619 619 549 541 550 549 546 533 548 546 549 545 547 506 553 496 613 592 577 577 ...

result:

ok 337 numbers

Test #19:

score: 1
Accepted
time: 7ms
memory: 27676kb

input:

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

output:

255 260 250 254 254 292 255 246 247 247 249 250 249 247 248 248 250 246 227 246 239 223 245 184 227 216 220 225 190 190 191 191 223 189 221 190 207 194 196 196 178 182 199 179 177 178 177 177 206 198 218 211 211 197 209 200 200 212 228 225 227 228 227 223 225 225 223 225 224 224 224 224 172 235 237 ...

result:

ok 466 numbers

Test #20:

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

input:

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

output:

1873 1865 1869 2033 2017 1873 2011 2011 2028 2016 1866 2026 1876 1867 1875 1867 2011 1869 1869 2010 2009 2210 1875 1873 1875 1876 2006 1875 1875 1875 1450 1461 1706 1450 1451 1758 1758 1453 1753 1461 1450 1743 1457 1455 1457 1454 1451 1455 1456 1454 1734 1458 1461 1692 1458 1679 1734 1459 1459 1461 ...

result:

ok 380 numbers

Test #21:

score: 1
Accepted
time: 3ms
memory: 27164kb

input:

500
8 6 12 22 26 5 7 33 24 46 19 13 44 41 11 29 40 10 17 47 51 32 62 23 58 63 39 52 18 35 14 20 34 2 70 28 68 54 65 75 25 53 31 73 3 80 4 84 36 72 56 55 9 93 77 61 57 88 71 45 27 98 97 60 49 92 66 95 1 37 59 43 111 69 107 82 99 21 87 100 64 119 81 122 104 114 110 85 112 96 106 38 50 78 91 118 128 13...

output:

2483 2484 2481 2340 2337 2443 2444 1632 2013 1621 2013 2067 1624 1626 2064 2010 1628 2062 2013 1630 1627 1633 1618 2007 1622 1620 1627 1627 2003 1630 2050 2004 1632 2043 1622 2003 1624 1631 1627 1622 1999 1630 1627 1626 2029 1623 2025 1621 1630 1627 1630 1630 2021 1618 1629 1628 1629 1625 1629 1622 ...

result:

ok 500 numbers

Test #22:

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

input:

458
40 41 38 48 52 12 51 22 13 35 55 23 5 36 16 46 47 19 61 67 27 49 44 65 33 59 2 75 71 76 28 78 11 15 1 45 4 34 3 32 37 88 72 53 77 93 17 14 87 94 31 20 86 100 7 99 26 21 43 89 82 101 63 108 74 9 24 62 42 68 95 107 120 64 114 117 103 39 69 84 91 125 73 106 29 116 85 130 110 115 122 66 57 102 134 8...

output:

1163 1163 1163 1158 1093 1174 1094 1164 1172 1153 1096 1163 1519 1154 1167 1152 1152 1163 1098 1093 1158 1153 1151 1097 1150 1101 1500 1093 1096 1094 1151 1094 1152 1153 1486 1151 1485 1150 1484 1150 1154 1099 1105 1109 1106 1098 1148 1146 1103 1101 1144 1146 1104 1099 1140 1100 1143 1143 1152 1108 ...

result:

ok 458 numbers

Test #23:

score: 1
Accepted
time: 3ms
memory: 28012kb

input:

500
500 499 498 497 496 495 494 493 492 491 490 489 488 487 486 485 484 483 482 481 480 479 478 477 476 475 474 473 472 471 470 469 468 467 466 465 464 463 462 461 460 459 458 457 456 455 454 453 452 451 450 449 448 447 446 445 444 443 442 441 440 439 438 437 436 435 434 433 432 431 430 429 428 427 ...

output:

499 499 499 499 499 499 499 499 499 499 499 499 499 499 499 499 499 499 499 499 499 499 499 499 499 499 499 499 499 499 499 499 499 499 499 499 499 499 499 499 499 499 499 499 499 499 499 499 499 499 499 499 499 499 499 499 499 499 499 499 499 499 499 499 499 499 499 499 499 499 499 499 499 499 499 ...

result:

ok 500 numbers

Test #24:

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

input:

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

output:

63159 62165 62661 61179 61671 61187 61187 60205 60689 59243 59723 59741 58293 58767 58790 58790 58791 58325 58325 58325 57369 57827 57411 57411 56463 56913 56961 56515 55575 56017 56073 55608 55608 55608 55608 55606 55640 55640 55608 55641 54725 55143 53895 54309 53981 53075 53483 52265 52669 52763 ...

result:

ok 500 numbers

Subtask #3:

score: 1
Accepted

Test #25:

score: 1
Accepted
time: 3ms
memory: 28304kb

input:

3000
2916 252 1255 86 554 396 1643 1080 2300 2570 2014 2676 1984 2282 748 2548 1920 1821 2699 437 1186 486 656 2510 2425 2701 2409 259 503 477 302 1155 2468 1512 2817 2303 819 2721 365 2744 249 2013 1542 876 1153 1757 2865 1461 192 1714 814 62 198 953 918 153 147 1245 194 334 2125 1024 697 1993 1846...

output:

3083 5747 4744 5911 5446 5603 4360 4920 3705 3436 3989 3332 4017 3722 5246 3460 4079 4177 3316 5550 4807 5501 5334 3502 3586 3321 3600 5718 5481 5504 5674 4839 3549 4486 3214 3709 5169 3311 5605 3290 5713 3993 4455 5111 4836 4245 3178 4533 5762 4288 5166 5887 5756 5033 5067 5796 5801 4753 5758 5629 ...

result:

ok 3000 numbers

Test #26:

score: 1
Accepted
time: 3ms
memory: 28184kb

input:

3000
213 481 366 714 165 401 359 541 625 817 503 58 421 683 399 595 829 870 845 393 191 347 83 473 87 240 656 674 536 686 93 475 719 629 700 189 698 19 704 474 286 620 409 266 502 138 726 528 663 440 830 882 34 292 883 865 288 736 858 117 557 531 238 522 153 601 365 175 137 589 780 558 203 20 886 67...

output:

1615 1348 1462 1116 1658 1427 1466 1291 1208 1019 1326 1760 1406 1153 1424 1239 1014 974 998 1425 1620 1467 1725 1355 1721 1574 1185 1168 1297 1160 1711 1353 1132 1211 1149 1613 1151 1772 1149 1350 1521 1218 1410 1538 1329 1654 1139 1306 1186 1380 1043 996 1744 1510 998 1011 1511 1132 1019 1663 1280...

result:

ok 3000 numbers

Test #27:

score: 1
Accepted
time: 4ms
memory: 27096kb

input:

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

output:

46 55 54 35 39 54 39 49 49 42 40 42 42 44 43 43 44 42 45 45 49 40 45 43 48 34 50 56 44 31 32 125 105 108 124 86 81 116 98 102 118 137 86 117 91 88 116 91 102 123 94 97 112 102 117 117 123 114 111 107 102 106 111 106 111 109 109 111 109 109 111 109 108 114 113 107 101 102 117 121 109 110 119 97 126 1...

result:

ok 3000 numbers

Test #28:

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

input:

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

output:

1271 1270 1269 1270 1391 1271 1270 1274 1272 1274 1068 1173 1172 1068 1068 1069 1067 1170 1065 1064 1063 1065 1065 1148 1077 893 970 1002 1002 982 982 953 952 772 773 862 774 773 826 808 843 839 842 839 839 840 839 839 800 690 765 767 717 792 791 809 793 808 793 793 794 792 790 791 786 791 791 790 7...

result:

ok 1423 numbers

Test #29:

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

input:

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

output:

138858 141851 138859 141851 138878 141850 141849 138881 138866 138866 138798 141774 138852 138851 138851 138802 138845 138848 132970 135922 135897 132972 132973 135923 132972 132973 135893 135913 135891 132971 135907 135908 135914 132972 132977 135901 132981 132980 132980 132980 132979 132979 132979...

result:

ok 2998 numbers

Test #30:

score: 1
Accepted
time: 4ms
memory: 27232kb

input:

2999
3 19 7 20 12 40 34 2 42 9 5 36 47 45 26 25 31 24 21 23 37 18 48 49 15 38 55 52 16 39 4 54 53 56 69 32 46 43 70 41 67 76 50 33 66 58 28 51 14 22 83 65 44 84 10 90 91 29 93 73 71 88 63 95 6 80 59 94 27 77 8 92 17 1 105 99 109 30 89 101 104 35 113 97 64 86 100 122 111 75 114 118 121 123 108 13 120...

output:

66823 66725 66793 66726 66731 66708 66713 66789 66709 66786 66787 66714 66708 66709 66719 66719 66716 66718 66720 66719 66718 66716 66717 66717 66716 66718 66714 66716 66713 66717 66768 66718 66718 66720 60962 63848 63851 63851 60965 63849 60966 60962 63853 63841 60967 63841 63839 63853 63831 63836 ...

result:

ok 2999 numbers

Test #31:

score: 1
Accepted
time: 4ms
memory: 27404kb

input:

2876
40 32 26 52 36 24 49 50 37 4 59 21 51 30 19 55 41 1 31 18 64 34 35 44 47 45 65 70 75 48 60 23 11 29 73 8 43 22 7 83 56 71 46 91 63 80 92 12 27 96 79 68 99 13 53 62 74 85 105 58 17 107 57 10 88 108 42 14 104 6 116 120 89 33 115 95 77 114 121 125 110 5 86 93 69 2 94 128 124 133 137 101 102 103 11...

output:

45195 45213 45218 45186 45210 45217 45190 45190 45209 47969 45186 45216 45192 45211 45215 45193 45198 48034 45211 45213 45192 45211 45211 45200 45198 45199 45197 45193 45189 45196 45198 45202 47939 45202 45195 47939 45196 45201 47937 45192 45203 45200 45197 45188 45201 45197 45190 47924 45197 45189 ...

result:

ok 2876 numbers

Test #32:

score: 1
Accepted
time: 3ms
memory: 27380kb

input:

3000
3000 2999 2998 2997 2996 2995 2994 2993 2992 2991 2990 2989 2988 2987 2986 2985 2984 2983 2982 2981 2980 2979 2978 2977 2976 2975 2974 2973 2972 2971 2970 2969 2968 2967 2966 2965 2964 2963 2962 2961 2960 2959 2958 2957 2956 2955 2954 2953 2952 2951 2950 2949 2948 2947 2946 2945 2944 2943 2942 ...

output:

2999 2999 2999 2999 2999 2999 2999 2999 2999 2999 2999 2999 2999 2999 2999 2999 2999 2999 2999 2999 2999 2999 2999 2999 2999 2999 2999 2999 2999 2999 2999 2999 2999 2999 2999 2999 2999 2999 2999 2999 2999 2999 2999 2999 2999 2999 2999 2999 2999 2999 2999 2999 2999 2999 2999 2999 2999 2999 2999 2999 ...

result:

ok 3000 numbers

Test #33:

score: 1
Accepted
time: 51ms
memory: 48856kb

input:

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

output:

4270503 4264663 4267582 4258831 4261746 4253007 4255918 4247191 4250098 4241383 4244286 4235583 4238482 4229791 4232686 4224007 4226898 4218231 4221118 4212463 4215346 4206703 4209582 4200951 4203826 4195207 4198078 4189471 4192338 4183743 4186606 4178023 4180882 4172311 4175166 4166607 4169458 4160...

result:

ok 2923 numbers

Test #34:

score: 1
Accepted
time: 4ms
memory: 27928kb

input:

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

output:

0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 ...

result:

ok 3000 numbers

Test #35:

score: 1
Accepted
time: 3ms
memory: 28248kb

input:

3000
48 51 61 34 63 64 54 66 67 33 69 70 22 72 73 75 12 76 19 21 79 81 24 82 84 57 85 40 87 88 90 10 91 6 36 94 55 31 97 15 28 100 7 102 103 46 3 106 108 37 109 42 45 112 114 18 115 49 1 118 2 4 121 5 123 124 8 9 127 11 13 130 14 16 133 17 135 136 20 78 139 23 25 142 26 27 145 29 30 148 32 93 151 35...

output:

80063 79891 79634 80546 79501 79501 79659 79353 79353 80418 79207 79207 80778 79077 79077 78927 80781 78928 80712 80635 78907 78717 80395 78718 78669 79279 78670 79810 78481 78481 78334 80566 78335 80697 79805 78299 79161 80007 78065 80269 79964 77927 80446 77758 77758 79130 80404 77677 77538 79397 ...

result:

ok 3000 numbers

Test #36:

score: 1
Accepted
time: 4ms
memory: 27532kb

input:

3000
14 8 62 11 5 65 7 2 68 4 10 71 13 1 74 16 20 77 17 19 80 26 22 83 23 25 86 28 32 89 29 31 92 38 35 95 37 34 98 43 41 101 44 40 104 46 49 107 50 47 110 52 55 113 53 56 116 59 61 119 3 58 122 6 67 125 9 64 128 12 73 131 15 70 134 18 79 137 21 76 140 24 85 143 27 82 146 30 91 149 33 88 152 36 97 1...

output:

82734 82931 80215 81750 81911 80062 81754 82930 79910 81753 81600 79757 81443 82732 79608 81290 81212 79453 81209 81133 79300 80899 80976 79148 80896 80821 78992 80664 80586 78840 80584 80508 78690 80268 80350 78541 80195 80275 78389 79964 80041 78238 79887 79962 78088 79735 79656 77939 79579 79656 ...

result:

ok 3000 numbers

Subtask #4:

score: 1
Accepted

Test #37:

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

input:

3000
491 2002 187 1922 118 94 2031 1317 31 2585 254 902 2066 543 2342 807 176 2522 2225 386 165 2744 2525 2825 1740 469 1082 727 2571 1201 1086 498 1104 2954 591 512 933 1155 850 212 2086 74 816 414 2187 767 1353 1888 1299 1378 562 2174 1845 2726 1139 2573 847 329 1778 715 1604 815 1766 2710 895 811...

output:

5508 3998 5810 4078 5899 5923 3974 4683 5983 3423 5743 5098 3943 5455 3669 5191 5813 3492 3786 5606 5820 3276 3492 3197 4261 5521 4917 5267 3450 4799 4913 5490 4897 3078 5398 5474 5064 4849 5143 5760 3935 5886 5177 5562 3838 5223 4660 4128 4710 4636 5419 3856 4172 3320 4862 3471 5140 5631 4239 5263 ...

result:

ok 3000 numbers

Test #38:

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

input:

3000
88 388 480 313 445 286 200 176 336 151 251 529 154 525 266 507 82 389 367 349 84 394 157 207 76 69 74 214 67 579 515 58 376 483 536 602 604 555 121 390 126 300 194 506 92 71 479 43 544 174 572 328 517 471 295 197 545 224 422 86 118 304 145 511 320 52 68 124 125 569 310 223 178 546 129 36 137 19...

output:

1119 820 729 893 764 918 1003 1026 873 1049 954 689 1045 693 939 711 1109 825 844 861 1105 824 1038 993 1107 1113 1109 990 1112 657 716 1118 843 747 703 640 639 683 1064 830 1059 906 999 726 1087 1097 750 1117 703 1016 679 882 724 757 908 993 708 972 805 1080 1053 904 1030 735 891 1092 1081 1048 104...

result:

ok 3000 numbers

Test #39:

score: 1
Accepted
time: 3ms
memory: 26844kb

input:

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

output:

5 5 5 7 4 0 72 91 84 97 97 86 84 119 86 134 108 93 83 131 117 107 130 97 95 120 96 91 92 112 110 96 116 106 110 113 108 100 101 108 103 104 103 104 105 106 102 102 108 102 104 101 100 113 111 97 99 99 109 101 101 102 95 90 104 114 99 112 122 111 111 128 110 122 98 108 127 117 112 11 11 15 11 14 14 1...

result:

ok 3000 numbers

Test #40:

score: 1
Accepted
time: 4ms
memory: 27152kb

input:

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

output:

0 99046 99048 99047 95273 97165 95273 95273 97178 97166 95276 95251 95253 95252 95252 97144 95252 95252 97137 95258 95261 91540 91510 91532 91510 93379 93385 93390 93377 93376 91527 91521 91527 91540 91528 93383 91528 91526 91528 93369 91545 93399 91551 91551 91551 91551 91550 91553 91540 91542 9155...

result:

ok 3000 numbers

Test #41:

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

input:

2980
18 16 28 5 14 26 7 8 4 17 13 23 1 32 30 41 9 24 45 42 20 33 46 48 52 50 35 54 51 53 55 43 39 49 22 58 44 29 11 27 56 6 34 67 63 66 37 47 3 15 59 73 57 21 19 72 75 40 68 78 38 64 82 89 77 81 69 83 84 70 74 10 79 101 97 102 71 61 25 92 86 91 88 96 36 110 114 98 115 108 87 90 100 95 120 107 106 11...

output:

89589 89590 89581 89599 89591 89584 89596 89596 89595 89593 89592 89591 92546 84196 86956 84189 86958 86956 84188 84190 86955 84197 84191 84190 84187 84188 84192 84188 84188 84189 84190 84185 84184 84187 86941 84192 84185 86942 86936 86941 84197 86932 84187 83868 83871 83869 84078 84083 86708 86715 ...

result:

ok 2980 numbers

Test #42:

score: 1
Accepted
time: 2ms
memory: 26964kb

input:

2996
18 16 43 27 12 38 7 22 10 1 34 29 39 23 41 24 56 53 46 59 13 47 21 63 65 14 68 30 37 5 45 61 70 48 40 71 72 73 79 26 58 51 36 76 81 67 75 74 20 66 4 84 57 90 69 6 2 64 77 95 93 96 54 103 35 25 32 3 100 83 101 89 15 31 9 99 107 28 117 52 80 82 115 121 55 92 123 50 116 127 106 49 120 119 91 105 1...

output:

59151 59162 59128 59143 59163 59134 62025 59148 59163 62112 59141 59145 59140 59147 59140 59146 59130 59132 59138 59130 59154 59138 59140 59130 59129 59150 59128 59140 59136 61999 59139 59134 59132 59139 59135 59134 59134 59134 59079 59120 59122 59124 59117 59125 59083 59122 59125 59125 59109 59121 ...

result:

ok 2996 numbers

Test #43:

score: 1
Accepted
time: 8ms
memory: 27024kb

input:

2985
25 8 45 3 53 41 33 54 22 14 13 6 56 52 37 46 62 28 35 74 59 48 40 58 34 7 71 44 39 21 29 5 75 82 69 12 67 89 36 2 96 87 88 17 77 78 10 103 30 79 86 98 81 66 57 49 73 99 93 92 61 42 16 119 60 120 108 20 32 94 27 68 105 83 43 116 76 130 50 115 121 1 72 84 11 113 55 129 138 110 143 31 128 70 124 1...

output:

41911 44565 41893 44769 41887 41896 41903 41889 41910 44554 44554 44558 41892 41891 41901 41897 41890 41905 41901 41750 41855 41857 41858 41857 41858 44492 41758 41857 41857 41860 41859 44486 41762 41756 41762 44482 41764 41753 41855 44643 41749 41755 41755 41899 41762 41762 44474 41749 41851 41763 ...

result:

ok 2985 numbers

Test #44:

score: 1
Accepted
time: 19ms
memory: 36372kb

input:

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

output:

1626033 1620039 1623035 1623037 1623037 1614061 1617049 1608091 1611075 1608107 1602131 1605109 1605129 1596185 1599157 1596213 1590249 1593215 1584323 1587285 1587321 1578440 1581400 1581401 1581401 1578438 1578438 1581396 1581396 1578440 1578441 1578439 1581375 1581395 1581395 1581394 1581373 1578...

result:

ok 3000 numbers

Test #45:

score: 1
Accepted
time: 20ms
memory: 38924kb

input:

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

output:

2141833 2143296 2138911 2141833 2135993 2138911 2133079 2135993 2130169 2133079 2127263 2130169 2124361 2127263 2121463 2124361 2118569 2121463 2115679 2118569 2112793 2115679 2109911 2112793 2107033 2109911 2104159 2107033 2101289 2104159 2098423 2101289 2095561 2098423 2092703 2095561 2089849 2092...

result:

ok 2928 numbers

Test #46:

score: 1
Accepted
time: 6ms
memory: 28600kb

input:

3000
40 42 46 21 48 49 13 51 52 54 10 55 6 57 58 27 19 61 63 36 64 15 34 67 30 43 70 72 24 73 75 31 76 22 33 79 81 3 82 84 7 85 1 87 88 2 4 91 5 93 94 8 9 97 11 12 100 14 16 103 17 18 106 20 108 109 23 25 112 26 28 115 29 117 118 32 37 121 35 123 124 38 39 127 41 129 130 44 45 133 47 105 136 50 138 ...

output:

108771 108539 108330 109312 108082 108082 109507 107882 107882 107686 109408 107687 109508 107492 107492 108679 109006 107300 107069 108133 107070 108888 108242 106876 108264 107805 106687 106476 108271 106477 106271 107957 106272 108265 107847 106066 105859 108593 105860 105652 108369 105653 108569...

result:

ok 3000 numbers

Test #47:

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

input:

3000
61 69 79 46 81 82 3 84 85 72 87 88 78 19 91 31 93 94 25 96 97 54 64 100 40 101 103 9 105 106 58 51 109 111 13 112 43 114 115 67 117 118 34 37 121 73 123 124 49 7 12 42 24 127 129 57 130 55 70 133 18 16 136 33 27 139 141 48 142 22 144 145 30 76 148 1 102 151 2 4 154 5 6 157 8 10 160 11 162 163 1...

output:

67025 66680 66187 66923 66063 66063 67620 65768 65768 66167 65622 65622 65984 67190 65492 66990 65362 65362 66982 65359 65359 66445 66276 65352 66721 65353 65352 67187 65229 65229 66343 66453 65103 64922 66924 64923 66391 64795 64795 66018 64373 64373 66392 66322 64364 65581 64044 64044 65900 66465 ...

result:

ok 3000 numbers

Test #48:

score: 1
Accepted
time: 6ms
memory: 28360kb

input:

3000
36 43 46 34 39 49 51 25 52 54 6 55 28 37 58 27 16 61 45 63 64 21 66 67 69 24 70 12 9 73 33 30 76 78 19 79 81 4 82 1 84 85 3 31 88 2 90 91 5 7 94 8 10 97 11 13 100 14 15 103 17 18 106 20 22 109 23 108 112 26 114 115 29 117 118 32 120 121 35 123 124 38 40 127 41 42 130 44 126 133 47 99 136 129 48...

output:

110725 110436 110126 110609 110364 110083 109927 110850 109928 109426 111530 109427 110591 110186 109220 110490 110902 109079 109697 108874 108874 110458 108619 108619 108567 110191 108568 110706 110974 108351 109791 109953 108351 108115 110138 108116 107903 110726 107904 110826 107872 107872 110701...

result:

ok 3000 numbers

Subtask #5:

score: 0
Time Limit Exceeded

Test #49:

score: 1
Accepted
time: 31ms
memory: 31060kb

input:

120000
64409 60114 74653 98538 74129 97296 87880 118079 70393 26626 5555 41719 62956 54903 116107 70653 86719 34349 62338 31410 16535 27192 72902 74322 41431 102664 9925 27101 88186 70542 107230 118319 70003 63640 25068 73660 40531 44770 6428 40655 110977 75243 17262 22912 36271 75941 17391 40319 10...

output:

175590 179884 165348 141464 165870 142706 152121 121927 169602 213364 234434 198273 177039 185089 123904 169347 153286 205637 177655 208574 223446 212792 167103 165686 198556 137356 230050 212879 151831 169460 132795 121711 169994 176354 214903 166348 199450 195216 233535 199327 129056 164775 222703...

result:

ok 120000 numbers

Test #50:

score: 1
Accepted
time: 45ms
memory: 32016kb

input:

120000
13559 3838 4987 24153 13213 31061 35267 8519 61807 61048 16262 13121 4972 48224 19029 55573 13860 34106 60824 27813 62867 21104 17994 526 63339 27209 10388 62670 57822 16974 26483 18577 22354 31147 49966 54728 51322 34739 59788 38771 11376 8675 32550 52963 33937 1681 54632 16928 15050 32086 3...

output:

122417 132138 130990 111826 122763 104920 100714 127454 74176 74934 119713 122849 130993 87760 116948 80413 122113 101876 75165 108165 73128 114870 117977 135426 72660 108769 125571 73328 78169 118994 109494 117393 113621 104839 86027 81266 84671 101247 76213 97217 124571 127269 103433 83035 102046 ...

result:

ok 120000 numbers

Test #51:

score: 1
Accepted
time: 53ms
memory: 31004kb

input:

120000
77 26 196 229 39 136 75 133 62 20 264 233 286 273 111 108 68 110 63 209 155 261 195 36 247 5 150 146 280 28 177 31 199 181 287 119 109 135 251 7 142 13 11 157 220 207 235 163 254 210 115 80 240 178 224 168 183 48 124 27 103 272 85 66 89 175 255 192 91 231 241 34 94 79 204 14 33 54 92 169 131 ...

output:

509 559 391 359 544 450 508 453 519 556 331 361 311 323 472 474 509 474 512 385 436 339 396 530 354 555 439 442 331 534 416 531 400 413 332 461 466 449 360 541 445 535 536 439 389 399 380 431 367 398 458 484 379 418 389 424 416 500 449 511 458 366 474 484 472 423 382 414 468 395 392 498 465 471 411 ...

result:

ok 120000 numbers

Test #52:

score: 1
Accepted
time: 224ms
memory: 106332kb

input:

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

output:

938997 938997 927253 933123 927252 927250 927254 927252 927255 927253 927250 927253 927252 927252 927255 927251 927228 927245 927245 927242 927241 927247 927247 927233 927247 927231 927231 927242 915586 915586 921413 915586 921406 915583 921407 915585 915585 921407 921407 921385 915628 921422 915630...

result:

ok 30599 numbers

Test #53:

score: 1
Accepted
time: 1730ms
memory: 545836kb

input:

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

output:

0 114869965 114870019 114870019 114869976 114869977 114869963 114870016 114869976 114869971 114870014 114869976 114869969 114869969 114869968 114869971 114869969 114869969 114869966 114869967 114869967 114869967 114870002 114869966 114869967 114870000 114869952 114869968 114869969 114869993 11486994...

result:

ok 108332 numbers

Test #54:

score: 1
Accepted
time: 1223ms
memory: 390144kb

input:

119996
10 1 12 33 2 3 37 38 34 13 9 32 6 35 8 45 22 51 39 60 23 44 7 26 30 56 31 55 49 67 25 17 65 61 73 75 47 27 77 21 82 29 15 4 78 5 53 64 50 85 11 20 71 72 16 90 58 28 95 14 96 97 46 62 91 105 86 76 110 83 109 52 112 48 103 79 19 102 40 87 70 68 108 94 120 121 43 119 101 84 118 113 123 107 133 1...

output:

81261167 81381161 81261160 81021284 81141272 81141272 81021285 81021285 81021286 81141239 81141241 81021285 81141242 81021290 81141240 81021286 81021294 81021282 81021291 81021275 81021291 81021287 81141220 81021289 81021286 81021283 81021285 81021284 81021287 81021278 81021283 81141197 81021281 810...

result:

ok 119996 numbers

Test #55:

score: 1
Accepted
time: 571ms
memory: 212912kb

input:

98801
29 19 56 8 37 48 32 21 11 33 59 30 25 39 53 50 67 72 64 47 27 66 14 28 57 52 44 76 7 12 83 49 23 45 51 5 15 54 92 86 91 62 79 10 43 46 97 82 17 63 106 96 94 3 70 60 73 81 35 75 38 65 61 74 31 113 22 6 85 110 109 104 125 100 99 13 123 130 102 9 116 127 132 98 126 141 133 119 88 71 55 124 137 34...

output:

39898395 39898404 39897762 39898212 39898188 39897771 39898191 39898199 39898206 39898193 39897767 39898191 39898193 39898190 39897773 39897775 39897765 39897761 39897766 39897772 39898184 39897767 39898189 39898184 39897773 39897773 39897774 39897767 39898186 39898186 39897763 39897774 39898179 398...

result:

ok 98801 numbers

Test #56:

score: 0
Time Limit Exceeded

input:

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

output:


result:


Subtask #6:

score: 0
Time Limit Exceeded

Test #63:

score: 1
Accepted
time: 40ms
memory: 32612kb

input:

120000
78409 31692 99757 2153 106968 77586 62349 25418 74373 14671 25794 25880 90200 66278 54098 60407 31652 105510 71780 38957 75499 21387 98218 69597 24523 8984 82870 36227 37125 12974 546 83252 118526 74768 32287 22401 91745 31029 16928 99610 110162 116002 34309 47294 87742 8671 34228 27900 25321...

output:

161591 208307 140245 237844 133036 162413 177649 214577 165627 225322 214202 214117 149808 173723 185900 179592 208342 134505 168224 201038 164509 218596 141798 170406 215459 230993 157146 203766 202869 227001 239430 156769 121505 165242 207702 217575 148280 208955 223043 140420 129875 124036 205680...

result:

ok 120000 numbers

Test #64:

score: 1
Accepted
time: 36ms
memory: 31468kb

input:

120000
22203 32675 29136 27616 24511 18716 7339 24332 27530 2138 20309 30422 16897 23478 2698 21915 19161 1112 25858 31419 10930 27712 16104 1994 21631 9211 24604 8966 13333 24664 17056 1569 19534 23948 5559 18590 17849 32102 21940 31912 17802 20234 12152 15613 32242 10540 6527 7800 33381 5295 32619...

output:

44909 34437 37975 39494 42598 48390 59766 42778 39583 64965 46798 36698 50206 43632 64402 45193 47944 65984 41261 35709 56169 39412 50995 65097 45478 57885 42517 58128 53766 42460 50047 65514 47575 43172 61528 48514 49254 35044 45177 35234 49297 46876 54937 51479 34911 56544 60550 59280 33778 61777 ...

result:

ok 120000 numbers

Test #65:

score: 1
Accepted
time: 66ms
memory: 32644kb

input:

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

output:

25 19 17 17 20 21 21 22 21 22 23 21 18 22 24 15 115 130 70 83 113 107 88 73 75 86 106 104 105 105 106 82 79 104 108 82 82 104 105 86 85 97 90 90 88 93 92 92 95 95 90 97 95 96 88 88 94 96 96 86 97 82 97 99 84 102 97 97 77 99 95 102 96 95 99 95 112 117 93 112 0 10 14 11 13 12 12 18 12 12 12 12 12 13 1...

result:

ok 120000 numbers

Test #66:

score: 1
Accepted
time: 3200ms
memory: 951252kb

input:

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

output:

209302975 209063085 209063086 209183040 209183039 209063088 209183038 209063084 209183035 209063085 209183065 209063087 209063087 209183035 209063087 209183033 209063088 209063084 209183031 209063083 209063084 209183028 209183028 209063086 209063086 209063085 209063086 209063084 209063087 209063086 ...

result:

ok 120000 numbers

Test #67:

score: 1
Accepted
time: 41ms
memory: 41368kb

input:

19217
32 33 10 22 34 15 37 41 21 6 11 27 38 26 14 46 12 45 4 1 16 24 2 58 28 5 49 60 25 52 47 63 64 8 7 48 54 72 17 30 74 18 36 9 42 35 50 43 81 82 51 55 77 29 57 69 80 68 84 3 71 67 66 13 93 75 56 102 101 73 19 62 53 86 59 90 110 70 94 114 78 79 107 40 99 20 106 108 44 95 98 31 120 87 128 76 23 109...

output:

2924793 2924793 2943869 2924850 2924795 2943860 2924794 2924784 2924845 2943859 2943857 2924798 2924796 2924797 2943849 2924787 2943851 2924788 2943851 2943969 2943850 2924801 2943967 2924785 2924802 2943847 2924795 2924787 2924799 2924793 2924795 2924525 2924525 2943668 2943668 2924702 2924701 2924...

result:

ok 19217 numbers

Test #68:

score: 1
Accepted
time: 1023ms
memory: 337520kb

input:

119993
36 45 26 23 40 24 44 42 15 47 18 16 17 53 9 52 61 31 62 46 48 25 69 33 39 56 3 43 6 29 49 65 71 4 60 50 68 83 59 80 57 41 10 64 14 63 95 90 19 98 79 35 86 73 22 104 81 103 97 100 12 54 88 21 7 1 110 34 115 99 51 119 107 84 27 124 112 102 125 89 20 111 37 120 126 70 76 135 94 92 32 5 58 77 87 ...

output:

69280602 69280594 69400364 69400366 69280600 69400365 69280598 69280599 69400369 69280600 69400366 69400367 69400367 69280598 69400369 69280599 69280593 69280606 69280594 69280601 69280602 69400360 69280591 69280602 69280599 69280601 69400373 69280600 69400370 69280602 69280607 69280602 69280599 694...

result:

ok 119993 numbers

Test #69:

score: 1
Accepted
time: 39ms
memory: 31520kb

input:

120000
120000 119999 119998 119997 119996 119995 119994 119993 119992 119991 119990 119989 119988 119987 119986 119985 119984 119983 119982 119981 119980 119979 119978 119977 119976 119975 119974 119973 119972 119971 119970 119969 119968 119967 119966 119965 119964 119963 119962 119961 119960 119959...

output:

119999 119999 119999 119999 119999 119999 119999 119999 119999 119999 119999 119999 119999 119999 119999 119999 119999 119999 119999 119999 119999 119999 119999 119999 119999 119999 119999 119999 119999 119999 119999 119999 119999 119999 119999 119999 119999 119999 119999 119999 119999 119999 119999...

result:

ok 120000 numbers

Test #70:

score: 0
Time Limit Exceeded

input:

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

output:


result:


Subtask #7:

score: 0
Time Limit Exceeded

Test #77:

score: 1
Accepted
time: 59ms
memory: 31932kb

input:

160000
156129 44024 78756 29278 87562 149300 123196 70741 25925 116249 53359 49347 137544 59439 48232 127147 41052 31626 44660 97719 37885 66347 134332 85073 139849 36111 113810 121127 93752 45066 130996 65422 38934 44349 136076 12511 72314 20980 21351 105513 113673 137965 67830 22590 102572 71782 1...

output:

163870 275974 241243 290718 232439 170702 196805 249255 294066 203753 266636 270647 182463 260557 271759 192861 278935 288360 275331 222287 282100 253653 185683 234931 180170 283869 206199 198885 226253 274920 189023 254572 281043 275633 183949 307453 247687 298984 298614 214501 206342 182069 252167...

result:

ok 160000 numbers

Test #78:

score: 1
Accepted
time: 67ms
memory: 33584kb

input:

160000
22797 18199 8847 23437 1136 44628 1755 11291 2733 23556 32784 53712 3648 51540 32805 791 18971 29366 17196 50717 7815 6138 26644 13034 24962 3805 52475 7464 38251 9503 44998 29826 23740 14671 10131 53937 25247 21167 49338 20973 41097 6837 5351 36978 12101 43624 30096 12057 7773 5379 19659 171...

output:

87668 92266 101623 87031 109386 65841 108707 99172 107728 86915 77688 56762 106809 58934 77666 109661 91492 81104 93263 59761 102638 104314 83827 97424 85509 106643 58012 102986 72230 100951 65487 80650 86729 95785 100320 56561 85226 89295 61153 89487 69390 103599 105082 73508 98348 66868 80385 9838...

result:

ok 160000 numbers

Test #79:

score: 1
Accepted
time: 64ms
memory: 33712kb

input:

160000
102 163 300 78 203 375 219 420 76 346 553 424 344 382 278 267 41 161 418 440 535 49 376 258 85 502 10 182 269 408 479 401 47 332 476 428 155 31 202 311 433 324 556 481 393 465 46 35 8 268 410 96 350 97 551 118 141 211 312 511 223 98 91 550 475 130 353 81 309 20 282 505 499 212 446 512 50 234 ...

output:

1014 954 816 1034 914 744 897 701 1031 773 570 698 771 738 833 843 1056 943 707 690 596 1045 745 850 1012 632 1077 922 844 720 658 725 1038 784 663 708 938 1047 899 805 708 792 599 667 734 679 1027 1035 1057 838 725 988 773 987 612 968 946 889 805 653 878 980 982 620 682 952 776 985 806 1028 831 667...

result:

ok 160000 numbers

Test #80:

score: 0
Time Limit Exceeded

input:

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

output:


result:


Subtask #8:

score: 0
Memory Limit Exceeded

Test #91:

score: 1
Accepted
time: 50ms
memory: 31488kb

input:

160000
7989 3230 94580 28590 58488 86098 59555 158400 130649 156687 57081 22926 58794 152913 99176 138390 158950 59527 61013 152361 9912 57515 97450 101904 146743 87841 15973 93582 31920 40884 124306 16146 93998 18246 74431 144546 6295 65109 44856 101456 49455 114289 103755 41963 2986 136807 158320 ...

output:

312034 316798 225422 291411 261514 233905 260447 161606 189356 163319 262914 297066 261205 167095 220829 181618 161065 260469 258986 167649 310071 262475 222555 218104 173270 232159 304006 226420 288063 279100 195707 303830 226007 301730 245568 175476 313670 254889 275127 218560 270528 205731 216264...

result:

ok 160000 numbers

Test #92:

score: 1
Accepted
time: 62ms
memory: 32036kb

input:

160000
23113 26233 19410 26687 19787 22 29546 27739 334 6151 35792 11265 14873 31258 20486 29802 28583 23418 2177 27135 28848 8119 29691 16426 14447 12313 2795 33184 28661 13800 24547 33616 14567 14612 21316 22186 25013 6119 13443 21982 10552 36576 6563 4869 26173 24977 26108 5261 15831 11452 12677 ...

output:

50613 47494 54314 47042 53937 73919 44186 45992 73431 67571 37943 62455 58848 42478 53239 43934 45150 50308 71534 46597 44889 65593 44050 57290 59266 61399 70910 40566 45078 59912 49182 40138 59146 59102 52409 51540 48720 67577 60262 51744 63147 37190 67132 68821 47566 48759 47631 68427 57884 62248 ...

result:

ok 160000 numbers

Test #93:

score: 1
Accepted
time: 98ms
memory: 33232kb

input:

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

output:

78 72 71 79 76 76 75 60 60 65 72 66 64 59 60 57 62 62 62 62 61 64 62 61 61 58 68 59 65 59 61 61 62 66 75 62 75 56 57 76 42 67 1 1 41 27 29 30 45 33 32 31 35 33 32 33 33 37 37 32 32 41 41 30 26 30 25 33 13 23 16 15 16 14 15 18 14 15 13 16 35 34 40 28 34 32 37 30 30 35 31 31 30 33 31 32 38 29 32 35 35...

result:

ok 160000 numbers

Test #94:

score: 0
Memory Limit Exceeded

input:

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

output:

370951293 370951303 370951297 370951299 370951299 370951288 370951296 370951294 370951290 370951291 371111263 370951294 370951293 370951294 370951295 370951291 370951290 370951256 370951278 370631425 370791348 370791348 370791356 370631428 370791361 370631427 370791363 370631429 370791363 370631428 ...

result:


Subtask #9:

score: 0
Memory Limit Exceeded

Test #105:

score: 1
Accepted
time: 63ms
memory: 33240kb

input:

200000
189428 64342 135921 32395 188535 169507 64482 42272 25764 6325 147516 156955 59264 22488 40453 177478 186347 2150 25385 186802 67560 112182 134171 51505 110481 157235 97911 134436 108490 140324 72997 193232 172756 69488 181034 73959 63101 176324 65239 102013 179706 139850 57553 85209 101805 6...

output:

210571 335656 264078 367603 211466 230493 335515 357724 374229 393674 252487 243049 340731 377502 359542 222532 213664 397847 374604 213212 332441 287820 265832 348489 289520 242777 302088 265570 291509 259686 326998 206798 227263 330504 218989 326035 336882 223698 334748 297985 220321 260160 342422...

result:

ok 200000 numbers

Test #106:

score: 1
Accepted
time: 65ms
memory: 35140kb

input:

200000
686 4240 5239 2525 2708 1271 4252 3766 1836 242 5151 5517 3387 1 3156 518 745 1170 2461 4836 4994 3623 3956 1220 5123 1398 4861 875 4825 2265 1578 4644 2613 5584 341 978 4155 4823 2209 3282 1364 608 1460 2994 4689 1151 4658 4589 2149 3590 4758 1105 1101 1075 2606 1631 2093 179 735 482 1482 46...

output:

10500 6930 5932 8643 8461 9895 6921 7404 9329 10919 6026 5663 7782 11223 8013 10641 10416 9992 8706 6346 6189 7551 7221 9938 6064 9762 6324 10277 6358 8897 9581 6540 8554 5619 10798 10170 7026 6365 8950 7890 9787 10528 9695 8178 6504 9991 6535 6601 9008 7588 6441 10031 10034 10059 8561 9523 9064 109...

result:

ok 200000 numbers

Test #107:

score: 1
Accepted
time: 90ms
memory: 35644kb

input:

200000
146 252 79 434 619 92 313 75 247 22 389 439 258 433 522 278 111 483 152 234 603 569 41 612 3 160 653 292 350 54 102 448 28 164 2 291 38 99 68 319 582 514 177 276 156 104 404 602 641 67 279 49 644 400 456 435 346 382 42 597 238 44 660 335 629 491 383 103 481 595 150 527 358 151 274 21 634 609 ...

output:

1175 1070 1244 890 706 1226 1010 1239 1074 1291 938 891 1065 895 811 1044 1202 851 1163 1082 736 769 1261 730 1312 1154 694 1032 977 1244 1203 890 1266 1150 1287 1035 1256 1205 1229 1015 771 834 1138 1048 1153 1198 937 758 726 1219 1048 1233 727 940 895 911 987 954 1234 769 1073 1230 723 997 748 867...

result:

ok 200000 numbers

Test #108:

score: 0
Memory Limit Exceeded

input:

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

output:

36314443 36314442 36314442 36314442 36239528 36276992 36277014 36239530 36239529 36239514 36239525 36239525 36239516 36276986 36239524 36276985 36239525 36276973 36239518 36239517 36239519 36239519 36239515 36239519 36239526 36239517 36276965 36239518 36239519 36239516 36239520 36239518 36239524 362...

result:


Subtask #10:

score: 0
Time Limit Exceeded

Test #119:

score: 1
Accepted
time: 73ms
memory: 34792kb

input:

200000
158297 88332 32154 18823 78105 64143 62884 62114 70506 92348 14704 147260 38615 93431 114389 158203 10051 129946 33477 195334 112976 69424 116449 186713 106467 22965 82228 33800 183485 162975 88312 60060 95901 96229 136061 107562 144911 198696 17504 21159 97258 64932 163868 192263 117581 1035...

output:

241703 311667 367851 381181 321895 335858 337116 337885 329496 307659 385294 252749 361386 306578 285621 241810 389941 270065 366520 204684 287031 330573 283562 213307 293538 377016 317771 366185 216538 237047 311687 339925 304106 303779 263958 292448 255110 201340 382461 378809 302749 335054 236165...

result:

ok 200000 numbers

Test #120:

score: 1
Accepted
time: 72ms
memory: 32628kb

input:

200000
41382 29005 29488 16012 1493 20730 48507 23793 48715 27497 4752 32420 21888 14610 19270 35744 40971 640 22319 3535 36749 9190 13616 43643 50549 18705 29128 22273 32301 29697 12391 32512 21310 9872 13295 35651 16253 28994 13341 47292 44718 31011 13943 21864 48386 31748 48197 45055 39322 37259 ...

output:

63957 76333 75851 89325 103851 84609 56838 81545 56632 77841 100581 72924 83447 90721 86064 69604 64378 104686 83018 101791 68602 96137 91712 61715 54814 86626 76217 83063 73048 75651 92929 72842 84021 95445 92025 69707 89073 76350 91977 58080 60653 74341 91375 83468 56991 73606 57180 60319 66043 68...

result:

ok 200000 numbers

Test #121:

score: 1
Accepted
time: 117ms
memory: 36708kb

input:

200000
2 19 15 20 7 12 13 14 18 11 21 9 10 16 22 23 5 17 8 6 4 24 3 1 25 26 37 33 35 27 32 28 31 29 38 30 34 36 44 41 39 40 42 43 60 48 45 73 71 58 68 54 47 69 70 64 65 50 56 53 49 52 59 57 51 66 63 67 62 46 61 55 72 108 115 106 112 76 100 113 109 87 91 101 104 88 85 90 98 80 75 95 79 111 77 86 92 8...

output:

45 29 32 30 38 34 34 34 33 31 36 31 31 36 39 39 28 35 27 26 25 44 24 23 0 0 12 15 14 20 15 19 16 18 22 16 19 20 5 7 8 8 9 9 42 54 68 32 33 42 36 44 48 38 38 39 39 44 41 41 42 42 44 43 40 47 45 48 44 32 46 39 59 48 42 48 45 76 53 47 48 63 60 53 51 60 60 60 55 62 64 59 62 59 62 60 63 61 63 58 59 65 65...

result:

ok 200000 numbers

Test #122:

score: 0
Time Limit Exceeded

input:

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

output:


result: