QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#563356#9231. Random Numbersarnold518#AC ✓732ms6016kbC++17970b2024-09-14 10:25:542024-09-14 10:25:54

Judging History

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

  • [2024-09-14 10:25:54]
  • 评测
  • 测评结果:AC
  • 用时:732ms
  • 内存:6016kb
  • [2024-09-14 10:25:54]
  • 提交

answer

#include <bits/stdc++.h>
#define ff first
#define ss second
using namespace std;

typedef long long ll;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;

mt19937 rnd(1557);

int main() {
    cin.tie(0); ios_base::sync_with_stdio(0);

    int T; cin >> T;
    while(T--)
    {
        int n; cin >> n;
        int P[n]; for(auto &i : P) cin >> i;

        // int n = 200000;
        // int P[n]; iota(P, P + n, 1);
        // shuffle(P, P + n, rnd);

        ll S[n + 1]{};
        for(int i = 0; i < n; ++i) S[i + 1] = S[i] + P[i];
        int ans = 1;
        for(int i = 0; i <= n - 2; ++i) if(4 == S[i + 2] - S[i]) ++ans;
        for(int l = max(3, n / 2 - 5000); l <= min(n, n / 2 + 5000); ++l)
        {
            for(int i = 0; i <= n - l; ++i)
                if(1ll * l * l == S[i + l] - S[i]) ++ans;
        }

        cout << ans << '\n';
    }
    // cout << "TIME : " << (double)clock() / CLOCKS_PER_SEC << endl;
}

詳細信息

Test #1:

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

input:

2
3
2 1 3
5
3 4 2 5 1

output:

2
2

result:

ok 2 number(s): "2 2"

Test #2:

score: 0
Accepted
time: 467ms
memory: 3712kb

input:

32
9811
3756 4960 5623 8471 9330 2388 7066 5434 4707 1711 2109 7274 9630 5057 6390 3252 2632 2291 4697 1923 6423 369 2430 2586 549 1344 1518 9170 268 1315 8808 4843 4603 532 2210 275 835 9059 8529 3449 1412 6071 6737 6944 788 8202 6684 6926 1729 7530 6506 9781 5523 5864 7067 9398 3446 2044 2578 2530...

output:

2
1
1
3
1
4
2
2
2
1
3
2
3
4
2
3
1
1
2
2
2
2
2
1
1
2
1
1
3
2
1
1

result:

ok 32 numbers

Test #3:

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

input:

30
197277
196178 84300 27937 106346 19833 131659 146010 164112 125344 93600 5183 26597 55011 30797 100914 95876 43674 164981 46730 54589 170497 74527 174820 95270 4993 78003 192129 55163 191465 156865 7654 164216 22085 118048 86126 178144 77067 60852 180286 180626 3165 43878 111790 131714 96251 9864...

output:

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

result:

ok 30 numbers

Test #4:

score: 0
Accepted
time: 732ms
memory: 5940kb

input:

1
200000
137314 193717 79689 175047 84798 4387 143791 85750 74947 54899 184128 11640 65653 28078 162472 26557 67059 131134 76117 106373 112748 129954 162927 153580 108335 90723 55445 10637 129723 50828 49548 181363 173509 114849 139837 78161 184622 85313 149952 137930 3981 20555 35145 188575 101906 ...

output:

2

result:

ok 1 number(s): "2"

Test #5:

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

input:

133
1614
1272 303 1151 1402 1380 1564 1048 654 1493 994 1243 972 1437 617 940 458 1220 1597 889 60 3 1420 478 1396 905 528 332 1552 45 1548 503 703 1070 2 770 1413 472 400 1011 584 771 542 1588 1529 566 1467 364 216 835 1035 1462 555 1503 1001 304 378 762 732 948 476 10 799 908 620 295 249 439 718 9...

output:

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

result:

ok 133 numbers

Test #6:

score: 0
Accepted
time: 130ms
memory: 3624kb

input:

135
1434
226 580 497 715 1367 589 298 216 1027 982 1307 231 306 1084 627 752 490 684 481 500 354 1346 1353 1028 473 457 991 1283 264 235 1045 1308 970 209 971 1197 1191 204 572 735 1280 1246 523 1103 384 757 1272 639 618 1372 50 16 335 599 1219 1284 449 840 1140 416 91 1407 868 1420 317 1385 119 170...

output:

4
1
2
2
3
2
3
3
2
2
2
2
1
1
1
2
1
1
1
4
1
2
2
2
3
2
1
2
1
2
1
4
1
1
1
2
2
4
3
1
1
1
2
3
1
1
1
3
1
1
1
2
2
3
1
2
1
2
1
3
2
1
1
1
3
1
2
2
1
2
2
4
2
1
2
1
2
2
1
3
2
1
2
2
2
2
3
1
2
1
1
2
1
4
1
3
2
1
2
2
1
3
2
1
3
1
1
1
3
1
2
1
2
1
2
2
3
1
2
2
2
1
1
1
1
2
2
2
2
1
2
2
1
4
3

result:

ok 135 numbers

Test #7:

score: 0
Accepted
time: 133ms
memory: 3620kb

input:

138
1852
41 1044 775 469 513 1590 1151 582 1213 43 270 505 774 1845 1050 626 704 1491 1832 600 95 1131 1176 1144 663 831 1757 373 62 748 936 1026 1090 1784 1014 370 901 675 100 635 1147 1088 1162 495 1029 891 1173 511 828 1604 570 637 1313 641 18 906 1186 256 946 1314 607 1596 1243 523 1225 863 970 ...

output:

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

result:

ok 138 numbers

Test #8:

score: 0
Accepted
time: 136ms
memory: 3624kb

input:

134
1471
1079 1269 675 699 1048 786 553 1378 1466 1152 867 302 1252 1441 563 1415 339 279 404 392 1400 614 983 908 760 1281 120 1233 818 1045 609 1454 248 1345 1023 638 826 913 1267 28 1024 988 2 1329 68 903 1195 1361 445 380 1451 1304 200 333 258 1167 1215 837 1238 641 1251 1113 59 899 1244 1138 10...

output:

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

result:

ok 134 numbers

Test #9:

score: 0
Accepted
time: 469ms
memory: 3828kb

input:

33
9856
7566 821 5762 1554 8101 9042 432 6381 9463 2815 3571 7995 9773 2193 8067 2819 7267 2467 911 5737 4875 8392 4307 2584 3462 4080 2587 2967 701 8611 4353 6638 9758 1163 4830 7974 171 7301 2183 3044 8725 7318 989 8716 5532 7341 5732 4571 9573 8344 3666 9842 7464 696 5569 6145 7225 5801 7796 4256...

output:

2
4
2
4
1
1
2
2
3
1
4
2
3
1
1
3
1
2
1
2
1
1
1
3
1
1
2
3
2
3
1
1
2

result:

ok 33 numbers

Test #10:

score: 0
Accepted
time: 677ms
memory: 5496kb

input:

6
155123
106491 99516 65958 59315 151234 36554 110949 8864 61761 121755 48512 132793 3382 92819 11147 151672 96972 76359 119950 54177 19251 152364 124264 38277 1045 141461 634 58907 89119 14734 139215 97488 91683 34075 20060 6389 112125 77813 149172 34413 67548 21350 72560 93506 120224 46941 132989 ...

output:

3
1
2
3
1
2

result:

ok 6 numbers

Test #11:

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

input:

1
199222
3425 46445 156584 50078 30853 2422 8714 193754 96677 55786 159316 483 149336 176525 128768 177013 106651 1710 172121 158124 186112 35124 1944 80400 177836 74721 69576 183171 183848 26754 96915 191373 138575 160798 67628 95875 180184 132190 162402 116531 35624 64528 153009 81779 153799 3485 ...

output:

3

result:

ok 1 number(s): "3"

Test #12:

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

input:

129
1525
1493 1286 1393 588 1062 84 1050 1369 132 332 647 644 372 912 1390 909 1430 551 385 14 656 877 161 781 928 310 1221 943 991 146 209 154 94 220 1357 140 1456 884 325 1492 1323 1027 543 1522 410 417 1211 555 12 1015 241 1382 1035 1170 1163 1199 721 11 579 1250 1337 688 366 820 156 713 911 102 ...

output:

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

result:

ok 129 numbers

Test #13:

score: 0
Accepted
time: 20ms
memory: 3680kb

input:

1070
152
33 98 73 38 44 127 7 79 43 134 55 50 111 83 68 89 91 64 88 51 124 138 104 67 15 36 75 26 12 31 72 141 117 110 112 137 152 74 85 120 23 121 41 129 119 18 52 16 87 139 34 146 69 140 115 147 100 114 14 145 1 103 3 86 99 24 130 105 13 30 54 25 92 113 59 56 22 136 58 93 84 29 8 106 28 39 78 57 2...

output:

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

result:

ok 1070 numbers

Test #14:

score: 0
Accepted
time: 612ms
memory: 3904kb

input:

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

output:

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

result:

ok 48 numbers

Test #15:

score: 0
Accepted
time: 711ms
memory: 4060kb

input:

6
20897
16605 6574 6361 18491 19429 1061 16804 11439 10908 18561 11493 11543 7568 1898 4 16020 19984 14632 11046 20373 6914 6474 16312 17112 18822 8903 17488 826 15414 12888 7030 10078 5732 17784 2198 822 20166 17238 7492 12156 2534 15550 15335 12950 20408 18978 15515 20771 1739 7033 20452 2890 1865...

output:

1
1
1
2
3
2

result:

ok 6 numbers

Test #16:

score: 0
Accepted
time: 136ms
memory: 3684kb

input:

135
2622
1182 1033 2308 581 849 2343 1210 1480 1791 708 6 2031 428 557 496 2498 2410 1453 509 1562 102 237 479 953 353 49 1628 110 231 658 1184 2551 1574 1481 84 2262 221 406 1448 804 761 1318 1467 352 1029 657 1862 1301 375 1772 860 405 1637 1279 1604 338 1064 2143 978 46 279 840 408 13 698 829 135...

output:

3
2
1
1
1
3
2
2
2
4
1
1
1
1
1
2
2
2
2
2
2
1
2
1
2
1
2
1
3
2
1
4
3
1
2
2
2
3
3
1
1
3
2
4
1
1
1
2
2
2
1
1
2
2
1
1
2
4
1
4
1
1
1
1
3
1
4
2
1
2
2
2
3
3
3
4
2
2
4
3
4
2
3
1
2
3
2
3
3
2
3
3
3
1
2
3
1
1
2
1
2
2
2
2
2
2
2
1
3
1
1
1
1
3
2
2
1
1
1
2
1
4
2
1
1
3
4
4
1
2
2
4
2
1
1

result:

ok 135 numbers

Test #17:

score: 0
Accepted
time: 150ms
memory: 3764kb

input:

109
1511
1141 55 585 21 1323 190 1 1331 469 317 632 1341 361 1250 492 480 58 1363 1316 828 789 1380 116 169 451 1451 1508 613 936 1478 326 542 579 115 1086 917 3 1378 698 1128 631 1046 1383 696 68 1125 461 617 852 837 591 87 1366 76 675 1490 782 371 385 427 808 1411 1254 94 1247 1087 892 1320 552 79...

output:

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

result:

ok 109 numbers

Test #18:

score: 0
Accepted
time: 140ms
memory: 3704kb

input:

131
2895
1946 164 2546 897 2260 969 112 996 2101 1048 2737 993 2203 76 2372 567 1816 2371 1444 2629 1148 2387 2526 2493 1952 822 412 2584 2813 966 914 2001 2344 1747 1161 1451 10 1007 2678 2599 1056 2312 96 513 1776 1149 2045 2411 900 704 2262 426 838 1049 2374 771 2460 1187 2373 2465 1254 910 2020 ...

output:

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

result:

ok 131 numbers

Test #19:

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

input:

1
200000
129610 189336 153917 96105 183128 138433 112817 151309 104996 79721 177176 14642 86107 179875 52948 119114 40634 35742 16136 181211 174505 140327 99223 98839 104420 68610 177808 178795 159040 96006 84292 105658 138106 36916 110297 114272 105102 8940 148004 147545 105110 76435 28668 49780 17...

output:

2

result:

ok 1 number(s): "2"

Test #20:

score: 0
Accepted
time: 714ms
memory: 4772kb

input:

2
100000
66177 81880 68570 52105 81553 63575 17384 15922 62974 40384 43965 44188 16173 48687 69761 78435 18315 82877 50734 16781 10627 82259 60557 72115 73559 28143 84822 19118 79479 75444 41270 50404 58204 19521 59089 11951 40181 88074 53301 13313 44663 11174 21324 88464 88506 42588 36014 32139 591...

output:

2
2

result:

ok 2 number(s): "2 2"

Test #21:

score: 0
Accepted
time: 692ms
memory: 5652kb

input:

3
175755
62438 73792 97270 48232 116140 175009 35427 100720 84519 136752 78121 146574 85301 33545 160487 174373 5867 120610 134348 58438 130327 33628 140880 86195 3891 80151 143740 155177 145176 16094 54144 65879 23381 36638 158426 32444 36529 46498 97056 43383 152881 38105 97803 18068 169754 172981...

output:

2
4
1

result:

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

Test #22:

score: 0
Accepted
time: 156ms
memory: 3708kb

input:

104
1444
312 414 770 478 494 1090 723 42 247 23 269 504 683 1436 1067 1415 435 316 952 643 894 673 1018 341 1406 731 715 177 988 1313 993 1051 721 1352 1066 1268 1319 493 164 1396 524 771 92 996 225 795 133 1295 1037 657 1189 422 1062 168 679 1418 1148 1211 866 885 566 199 79 114 528 523 769 672 22 ...

output:

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

result:

ok 104 numbers

Test #23:

score: 0
Accepted
time: 123ms
memory: 3604kb

input:

146
1298
628 223 1012 1226 245 269 669 942 1103 616 560 262 391 517 1155 375 1193 521 1222 309 703 452 925 666 138 329 762 1095 1092 1269 460 783 294 140 1082 351 976 131 189 836 906 759 78 844 824 97 152 627 1165 1295 133 1071 393 620 195 1141 1267 784 268 810 358 193 733 1164 954 429 1146 1079 117...

output:

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

result:

ok 146 numbers

Test #24:

score: 0
Accepted
time: 716ms
memory: 6016kb

input:

1
200000
12971 58268 131490 56423 145496 137741 39559 125913 21092 126220 178663 127207 123800 117516 12259 138727 103382 149678 147476 4604 106672 68485 64889 45707 109886 170022 93607 71715 91701 149802 108069 126035 55693 37520 76409 159488 189503 142803 138787 169026 190835 122385 64363 139558 9...

output:

1

result:

ok 1 number(s): "1"

Test #25:

score: 0
Accepted
time: 563ms
memory: 4720kb

input:

2
97148
90482 59550 4025 51051 73951 65808 61694 24172 10222 30478 96158 37824 77658 7665 39397 76453 52660 92486 39514 54468 72786 26415 31835 29713 16739 92630 31948 71246 61134 67059 80048 885 21469 83523 31331 46300 81865 23061 57528 94254 77398 14835 36644 67832 12168 20767 49571 66402 5147 151...

output:

2
2

result:

ok 2 number(s): "2 2"

Test #26:

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

input:

18
170000
104528 85117 55820 103088 64399 66338 146256 59211 108456 130551 60934 18134 142465 51180 61526 40826 116207 37761 58178 81284 92443 150533 136227 157901 81503 150282 55454 86016 43261 142804 140820 139987 119727 96509 25247 147390 99463 32264 3132 168180 122724 90849 154387 135455 106202 ...

output:

2
2
4
3
1
1
2
1
3
4
2
1
3
2
2
2
1
1

result:

ok 18 numbers

Test #27:

score: 0
Accepted
time: 136ms
memory: 3760kb

input:

135
1111
974 606 685 406 690 498 889 586 798 359 55 1013 903 182 902 245 914 1107 703 844 605 431 845 184 14 524 127 513 646 792 468 726 295 343 786 5 805 306 984 764 445 608 624 986 719 96 332 538 296 863 71 817 222 779 595 75 1087 859 973 829 464 596 199 694 1054 289 34 487 363 724 101 43 409 473 ...

output:

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

result:

ok 135 numbers

Test #28:

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

input:

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

output:

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

result:

ok 4893 numbers

Test #29:

score: 0
Accepted
time: 695ms
memory: 5836kb

input:

5
180123
31627 72685 141034 75130 147174 46394 1842 22607 66590 116456 122110 96243 118153 94421 31419 175159 84403 139729 168105 168927 67796 71942 117150 98298 136745 1122 53952 81793 156665 129506 19654 82099 109965 127396 133149 173069 13649 24952 38766 151722 51145 2421 39494 177683 10781 45545...

output:

3
2
4
2
1

result:

ok 5 number(s): "3 2 4 2 1"

Test #30:

score: 0
Accepted
time: 603ms
memory: 4124kb

input:

5
39925
7135 4149 1321 27920 27191 10129 14499 14139 2226 39045 8977 19324 36521 34700 34664 34294 14287 21309 8061 14466 14319 20749 31515 36447 25821 36554 17895 22504 17944 11849 5901 3511 24103 13197 14409 10292 31206 26722 24510 33145 30378 34436 3105 17308 3135 25139 35514 24904 5107 35856 291...

output:

3
1
2
2
1

result:

ok 5 number(s): "3 1 2 2 1"

Test #31:

score: 0
Accepted
time: 130ms
memory: 3704kb

input:

136
1343
539 353 534 620 665 82 14 286 391 705 700 914 783 20 385 1265 191 966 413 1180 338 1011 1051 10 221 1213 920 1010 233 48 859 512 986 238 1101 788 710 266 1214 326 44 432 242 237 439 877 768 570 661 1089 1109 835 750 331 401 3 584 392 1336 779 1061 1312 603 114 875 1095 254 702 581 1002 5 92...

output:

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

result:

ok 136 numbers

Test #32:

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

input:

344
424
202 219 159 30 415 40 290 162 323 29 188 402 130 101 96 193 217 347 7 70 352 160 271 407 240 12 246 320 153 216 173 19 308 6 390 60 362 148 265 137 161 100 283 88 8 395 190 381 103 126 302 178 146 380 355 38 34 182 215 307 391 229 275 165 89 180 57 384 197 252 17 151 31 336 90 68 186 262 273...

output:

1
2
2
1
2
2
1
2
2
3
2
1
4
2
2
3
1
3
1
1
2
4
2
1
1
1
3
3
1
3
1
3
3
1
1
2
1
1
2
1
1
3
1
4
2
3
3
3
1
1
1
4
2
3
1
2
4
2
1
1
1
2
5
2
1
2
2
1
2
2
2
1
1
2
1
2
3
1
1
1
1
2
2
2
2
1
2
4
1
3
1
2
2
2
1
1
1
2
2
1
1
1
2
1
2
1
1
2
3
3
2
3
1
2
1
1
4
7
4
1
3
1
2
2
4
4
2
1
2
1
2
1
1
3
1
4
1
1
3
1
1
3
1
1
2
1
3
3
1
2
...

result:

ok 344 numbers

Test #33:

score: 0
Accepted
time: 135ms
memory: 3684kb

input:

129
1014
700 566 839 935 326 785 865 601 92 397 73 19 639 558 87 905 198 508 491 578 747 33 306 809 922 863 879 740 580 469 82 86 878 755 672 336 490 179 372 55 475 411 296 319 682 788 159 673 842 980 691 109 199 653 213 66 751 796 563 47 263 496 34 338 102 593 68 64 315 587 861 763 182 4 576 257 26...

output:

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

result:

ok 129 numbers

Test #34:

score: 0
Accepted
time: 727ms
memory: 6016kb

input:

1
200000
31725 162139 20657 41459 85431 96325 141872 40130 96349 86842 134028 192559 69092 77353 12591 46118 95530 34127 30424 41460 170340 28819 42352 169413 198865 130635 159952 91699 12426 178866 104701 1799 1526 108846 44096 120872 28874 183784 103760 71370 4924 3659 159405 35371 146756 192811 1...

output:

2

result:

ok 1 number(s): "2"

Test #35:

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

input:

20
190000
155274 141491 5580 125278 34979 145252 24132 162385 47691 81641 135982 7538 174562 59161 37077 187898 10888 8620 38756 26105 67542 126906 18067 77796 12322 122409 73570 174887 57736 159777 155560 145167 120506 181520 147264 54017 163299 172069 87388 83301 35578 153130 98070 164490 53927 29...

output:

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

result:

ok 20 numbers

Test #36:

score: 0
Accepted
time: 584ms
memory: 4336kb

input:

3
51998
49897 36991 12154 23923 44130 44079 18573 13317 18339 31073 39851 10975 20391 37963 28868 47310 21600 9942 3941 50763 28490 2537 19479 37512 45212 47080 6823 41999 43405 33104 17559 26805 2087 38339 51786 30862 10625 33472 18382 18104 28489 1080 41259 7072 25429 48657 41849 38290 23678 21024...

output:

2
1
2

result:

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

Test #37:

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

input:

138
2009
1178 1684 1572 1195 1730 1308 684 25 203 1194 241 1918 1140 1780 1566 587 114 741 184 1252 1032 964 1794 51 1802 1268 1145 1384 1246 1573 1774 899 90 1379 679 1082 388 959 1493 1790 589 582 1085 1281 809 1217 1325 1291 1110 1925 1765 655 1579 1596 477 491 1339 1607 648 686 666 1549 1796 367...

output:

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

result:

ok 138 numbers

Test #38:

score: 0
Accepted
time: 11ms
memory: 3676kb

input:

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

output:

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

result:

ok 55608 numbers

Test #39:

score: 0
Accepted
time: 674ms
memory: 3824kb

input:

13
11590
7004 7450 2829 4581 8744 3858 4079 4952 3313 5927 5973 7608 7873 11420 4612 10765 1550 1227 11337 11521 10603 3639 7082 8039 5916 10743 1451 4184 6658 7104 1053 11270 5281 4806 5760 9441 11095 1859 10191 3506 5467 6228 11287 10664 7866 10962 4856 1735 5220 1479 964 6226 8195 8149 227 6791 3...

output:

2
2
2
1
2
3
1
3
2
2
2
2
2

result:

ok 13 numbers

Test #40:

score: 0
Accepted
time: 349ms
memory: 3696kb

input:

178
339
325 83 105 117 95 300 250 163 235 125 180 47 90 133 279 109 221 141 304 24 158 104 259 20 157 197 222 123 257 286 270 274 218 63 5 241 106 114 287 324 191 134 15 92 255 4 84 67 22 178 328 126 234 303 201 41 143 271 32 72 86 213 177 249 140 81 46 9 179 165 215 139 335 316 294 291 203 326 35 3...

output:

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

result:

ok 178 numbers

Test #41:

score: 0
Accepted
time: 127ms
memory: 3744kb

input:

142
825
134 649 773 444 366 363 50 789 726 811 289 704 670 246 643 760 404 34 516 41 415 758 110 661 688 471 86 154 256 483 79 514 173 806 93 215 119 184 208 626 150 68 770 140 517 382 588 302 457 212 402 88 495 74 803 188 469 710 668 244 168 467 553 115 624 16 611 368 100 725 332 159 91 788 606 238...

output:

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

result:

ok 142 numbers

Test #42:

score: 0
Accepted
time: 136ms
memory: 3684kb

input:

134
825
259 155 27 750 788 515 280 59 728 178 430 528 171 796 28 327 152 711 684 199 715 342 617 556 56 338 88 663 677 646 525 144 202 109 472 458 254 579 792 307 187 52 544 497 182 188 470 713 739 318 687 760 620 193 673 89 700 504 409 626 356 768 349 68 196 251 402 139 33 550 759 37 300 802 4 319 ...

output:

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

result:

ok 134 numbers

Test #43:

score: 0
Accepted
time: 0ms
memory: 3720kb

input:

2
3
2 1 3
5
3 4 2 5 1

output:

2
2

result:

ok 2 number(s): "2 2"

Test #44:

score: 0
Accepted
time: 698ms
memory: 3828kb

input:

14
19655
19446 8256 12117 6838 18188 19284 10586 17622 17080 17056 16252 13650 994 572 3239 10178 18824 13165 12092 8207 677 5790 6621 12995 19058 16257 16114 7470 1863 2262 16606 19168 17137 16753 4215 7335 4828 231 2698 16482 814 8717 14242 17299 3852 9996 16855 4983 14179 14568 18586 800 8095 112...

output:

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

result:

ok 14 numbers

Test #45:

score: 0
Accepted
time: 534ms
memory: 3904kb

input:

62
2969
468 1637 503 859 671 1207 1093 923 2391 1144 1872 493 2685 1554 2197 2275 1235 1170 1992 2769 1696 60 1536 949 2361 842 1680 2805 743 2631 1403 1305 2006 194 946 78 2469 2833 98 1274 1969 2023 2341 1891 398 2405 29 615 1104 1076 1090 1208 290 1421 2931 1245 570 1723 1673 2263 63 2181 543 189...

output:

1
2
1
1
2
2
3
2
3
1
4
1
1
1
1
1
1
3
3
2
2
2
2
2
3
2
3
3
1
1
4
2
3
1
3
4
1
1
2
2
1
2
2
1
1
2
1
1
2
1
3
3
1
2
1
1
3
2
1
2
3
3

result:

ok 62 numbers

Test #46:

score: 0
Accepted
time: 729ms
memory: 6000kb

input:

1
200000
178378 74583 110133 44933 111194 49142 56415 154497 79197 77532 168984 127005 74164 165059 142171 158410 22902 42986 84020 197254 19386 130172 117091 120730 14385 175641 156682 132511 82044 103490 16478 186979 188659 73096 6119 174924 77118 18601 75250 63295 32494 112095 175428 71337 86492 ...

output:

1

result:

ok 1 number(s): "1"

Test #47:

score: 0
Accepted
time: 56ms
memory: 3596kb

input:

333
347
289 245 243 97 122 241 43 342 56 181 203 215 333 299 187 149 302 224 147 305 121 67 70 108 274 281 247 252 253 36 22 112 136 207 2 71 262 65 7 10 8 294 91 20 206 244 58 105 216 14 283 60 83 92 101 78 313 120 53 279 32 113 31 219 166 51 177 190 327 179 298 153 238 5 295 218 48 186 138 119 249...

output:

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

result:

ok 333 numbers

Test #48:

score: 0
Accepted
time: 136ms
memory: 3628kb

input:

134
2041
657 195 1711 861 2013 1148 1035 1277 392 461 78 1062 171 1227 2005 37 144 585 691 229 508 1177 1777 932 711 1480 736 275 190 1560 1008 1876 1866 166 1381 718 977 1897 712 818 1007 765 756 534 177 1352 1764 1691 298 1595 844 1186 959 455 264 828 510 589 1366 1836 26 1956 1745 1112 81 1603 78...

output:

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

result:

ok 134 numbers

Test #49:

score: 0
Accepted
time: 727ms
memory: 5940kb

input:

1
200000
37063 141188 29361 196371 50167 46437 36257 65614 118574 162285 31588 166661 57291 198350 43978 82560 164786 41574 77025 70464 17935 92074 37284 134088 174241 94841 16470 186647 23217 18391 76936 106972 9335 10357 38914 141065 34254 162193 106458 65617 19453 80439 113875 38274 140046 170818...

output:

2

result:

ok 1 number(s): "2"

Test #50:

score: 0
Accepted
time: 478ms
memory: 5120kb

input:

70001
130000
116893 42495 119200 72630 122693 30216 97915 15480 4678 44631 77044 9999 41292 82206 38339 95258 102537 107314 63721 70030 30325 87714 56349 92027 47991 82577 112798 30545 113608 82944 30658 74753 120297 88914 68878 60765 109396 1888 73784 19275 117316 11889 353 42544 21128 116894 10425...

output:

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
1
1
1
1
1
...

result:

ok 70001 numbers

Test #51:

score: 0
Accepted
time: 645ms
memory: 4180kb

input:

4
40243
18315 15796 12950 2884 28758 34408 31813 20647 19080 1319 26366 6490 3498 10268 34154 32084 2739 25236 38898 22961 9392 34116 8890 1431 15932 13503 6861 36453 26833 39005 33757 29994 29613 34133 3537 36194 15664 22081 17535 1547 34692 22345 14379 32241 27337 18222 12743 34584 6854 38984 1973...

output:

4
1
2
1

result:

ok 4 number(s): "4 1 2 1"

Extra Test:

score: 0
Extra Test Passed