QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#745578#5309. Guess Cycle LengthSkyMathsAC ✓19ms4088kbC++142.2kb2024-11-14 10:39:072024-12-15 15:47:24

Judging History

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

  • [2024-12-15 15:47:24]
  • 管理员手动重测本题所有获得100分的提交记录
  • 测评结果:AC
  • 用时:19ms
  • 内存:4088kb
  • [2024-11-14 10:39:07]
  • 评测
  • 测评结果:100
  • 用时:25ms
  • 内存:4092kb
  • [2024-11-14 10:39:07]
  • 提交

answer

#include<bits/stdc++.h>
#define rep(i,l,r) for (int i(l), i##end(r); i <= i##end; ++i)
#define per(i,r,l) for (int i(r), i##end(l); i >= i##end; --i)
#define ll long long
#define pii pair <int, int>
#define fi first
#define se second
#define eb emplace_back
#define File(filename) freopen(filename".in", "r", stdin), freopen(filename".out", "w", stdout)
#define clr(arr) memset(arr, 0, sizeof(arr))
using namespace std;
template <typename Tx> inline void read(Tx &x) {x = 0; bool f = 0; char ch = getchar(); while (ch < '0' || ch > '9') f ^= ch == '-', ch = getchar(); while (ch <= '9' && ch >= '0') x = x * 10 + ch - '0', ch = getchar(); if (f) x = -x;}
template <typename Tx, typename ...Ty> inline void read(Tx &x, Ty &...y) {read(x); read(y...);}
template <typename Tx> inline void O_write(Tx x) {if (x > 9) O_write(x / 10); putchar('0' + x % 10);}
template <typename Tx> inline void write(Tx x, char ch = '\n') {O_write(x < 0 ? (putchar('-'), -x) : x); putchar(ch);}
template <typename T> inline void cmax(T &x, T y) {if (x < y) x = y;}
template <typename T> inline void cmin(T &x, T y) {if (x > y) x = y;}
namespace Main {

int walk(int x) {
    printf("walk %d\n", x); fflush(stdout);
    read(x); return x;
}
void answer(int x) {
    printf("guess %d\n", x); fflush(stdout);
    exit(0);
}

mt19937 mtrnd(chrono::system_clock::now().time_since_epoch().count());
const int inf = 1000000000;
int mx, A, t;

map <int, int> pos;

void skymaths() {
    mx = 1;
    rep (_, 1, 3000) {
        cmax(mx, t = walk(mtrnd() % inf + 1));
    }
    A = 3000;
    int now = 1;
    pos[t] = now;
    rep (i, 2, A) {
        int x = walk(1);
        cmax(mx, x);
        if (pos.count(x)) {
            assert(pos[x] == 1);
            answer(now);
        }
        else {
            pos[x] = ++now;
        }
    }
    // now = A
    walk(mx - now); now = mx;
    for (int x = 1; ; ++x) {
        now += A;
        t = walk(A);
        if (pos.count(t)) {
            answer(now - pos[t]);
        }
    }
}

signed main() {
    // freopen("a.in", "r", stdin);
    int T = 1;
    // read(T);
    for (int Tid = 1; Tid <= T; ++Tid) {
        skymaths();
    }
    return 0;
} } signed main() { Main::main(); return 0;}

Details

Tip: Click on the bar to expand more detailed information

Test #1:

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

input:

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

output:

walk 175106743
walk 646395316
walk 237347754
walk 62653854
walk 425132677
walk 176786228
walk 173659196
walk 39356760
walk 908474798
walk 481101393
walk 108745150
walk 782107701
walk 237570317
walk 676869467
walk 741723458
walk 183881460
walk 144263339
walk 496066251
walk 215547163
walk 943461245
wa...

result:

ok n=10

Test #2:

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

input:

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

output:

walk 879052801
walk 802912744
walk 134807622
walk 824077421
walk 37953450
walk 690415662
walk 93240848
walk 179890862
walk 177743587
walk 459829320
walk 339591699
walk 131379082
walk 292189046
walk 212404699
walk 75003549
walk 34119395
walk 445767512
walk 731191686
walk 415496041
walk 560511744
walk...

result:

ok n=20

Test #3:

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

input:

3728
9561
8592
7644
8004
6509
6423
9739
2682
3989
7895
4254
3640
5884
1707
4912
4798
6392
4677
4149
6522
9849
2696
2041
7597
6064
7246
6457
6092
3515
9336
9259
2409
1457
5888
8270
8689
9480
5457
9637
7610
1276
396
4987
3195
6408
831
2202
6665
9229
3967
6208
6491
9986
4504
5914
4391
841
8368
2314
974...

output:

walk 772533727
walk 967235833
walk 739539031
walk 874069052
walk 872690360
walk 233158505
walk 621529914
walk 677813316
walk 51462943
walk 650451307
walk 678093906
walk 454076359
walk 465409386
walk 703332244
walk 137995823
walk 374753205
walk 968559886
walk 470711594
walk 238228285
walk 258209472
w...

result:

ok n=10000

Test #4:

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

input:

457887812
907703345
495443178
747021745
169860371
124771827
613326553
84187964
478469827
880134182
612241078
777174736
167110405
752916258
207936210
303302751
233049777
459541315
244984496
76081102
87376561
433140153
126885572
324769967
418995710
877637514
381463432
85412024
346035925
944857791
2527...

output:

walk 457887811
walk 449815533
walk 587739833
walk 251578567
walk 422838626
walk 954911456
walk 488554726
walk 470861411
walk 394281863
walk 401664355
walk 732106896
walk 164933658
walk 389935669
walk 585805853
walk 455019952
walk 95366541
walk 929747026
walk 226491538
walk 785443181
walk 831096606
w...

result:

ok n=1000000000

Test #5:

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

input:

539875431
151757094
520471185
30421603
653900709
433791300
559264611
48910903
370252940
176245417
170976421
571990377
707168840
516028544
562238484
688385336
461303467
528418532
193954245
266520069
385376013
385482711
984833009
925294627
759439010
290361151
165953864
224649931
275196607
402969822
56...

output:

walk 537955620
walk 611881663
walk 368714091
walk 509950418
walk 623479106
walk 779890591
walk 125473311
walk 489646292
walk 321342037
walk 805992477
walk 994731004
walk 401013956
walk 135178463
walk 808859704
walk 46209940
walk 126146852
walk 772918131
walk 67115065
walk 665535713
walk 72565824
wal...

result:

ok n=1000000000

Test #6:

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

input:

536159801
34915966
941215362
660850463
461674984
519885321
725778044
856355210
106139997
34624552
153772689
377162721
819555153
671129249
686728950
578402559
33550683
191185573
408658545
434271453
205933118
499891282
55641503
298267903
103961737
930612571
167920618
516695609
520683803
937872183
7857...

output:

walk 380657400
walk 879901645
walk 105123748
walk 684093413
walk 564837873
walk 468067081
walk 414198699
walk 500301758
walk 946129931
walk 369739715
walk 954638481
walk 417137616
walk 469208816
walk 58064848
walk 132293213
walk 424960817
walk 973486012
walk 618772570
walk 331889836
walk 143574604
w...

result:

ok n=1000000000

Test #7:

score: 0
Accepted
time: 6ms
memory: 3956kb

input:

377023242
380360388
94923702
992289785
65142571
10335330
425021300
895343652
547634829
449389023
130476986
285192256
806198867
39261316
922508900
42639466
272956716
678594494
894408779
552094085
599268576
786684475
18220248
313421675
954174382
602331828
869619958
935216940
302922587
79350854
5336669...

output:

walk 13144760
walk 992859710
walk 318534414
walk 667750900
walk 361192671
walk 20727481
walk 888271542
walk 632862173
walk 652291177
walk 661644159
walk 83704317
walk 810828138
walk 702387424
walk 540313828
walk 575996205
walk 425280821
walk 768910566
walk 561894207
walk 215814285
walk 657685306
wal...

result:

ok n=1000000000

Test #8:

score: 0
Accepted
time: 9ms
memory: 3960kb

input:

453601456
646417013
338283462
409272825
526974569
432606065
122041278
474939563
224429627
650516905
987367642
622303416
241392884
615216009
854368672
943708796
632413329
758673319
452746115
350244403
344242411
818390731
764959037
805008901
954919907
675979258
679087623
834550977
668330594
555839630
...

output:

walk 44312987
walk 235452288
walk 530778106
walk 249412712
walk 96470091
walk 186314237
walk 121288506
walk 664499085
walk 339648040
walk 907154992
walk 737485140
walk 316811794
walk 520634908
walk 757739090
walk 673074038
walk 698371286
walk 387880209
walk 8604406
walk 966981264
walk 644887621
walk...

result:

ok n=998244353

Test #9:

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

input:

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

walk 121172091
walk 487152211
walk 85902952
walk 575437674
walk 216781941
walk 544858750
walk 162269015
walk 970520958
walk 790580241
walk 950683445
walk 818477500
walk 68573722
walk 785184850
walk 621573894
walk 265911581
walk 300865477
walk 767734856
walk 319857839
walk 134892529
walk 175829942
wa...

result:

ok n=1

Test #10:

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

input:

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

output:

walk 272916506
walk 239352590
walk 70274463
walk 519430097
walk 825849101
walk 696159280
walk 458247565
walk 189975128
walk 751509375
walk 618002966
walk 499311477
walk 145390283
walk 7633292
walk 147937230
walk 238373353
walk 97579894
walk 412253488
walk 6289025
walk 107016326
walk 710515318
walk 3...

result:

ok n=10

Test #11:

score: 0
Accepted
time: 9ms
memory: 3796kb

input:

848
798
23
622
708
931
408
790
185
192
629
986
556
559
189
901
34
338
202
34
76
594
785
291
213
353
226
92
547
461
573
451
339
249
877
895
185
647
838
215
671
101
388
596
515
639
398
964
395
943
363
743
464
207
841
200
413
535
832
339
192
785
591
356
142
904
653
146
91
788
955
509
114
223
428
148
55...

output:

walk 25125105
walk 162065141
walk 924840706
walk 831314716
walk 189192757
walk 374423177
walk 99633500
walk 354951452
walk 921517823
walk 366433840
walk 985283680
walk 860511140
walk 179436893
walk 237205855
walk 183066067
walk 595294115
walk 820503616
walk 363911230
walk 346637999
walk 288155771
wa...

result:

ok n=1000

Test #12:

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

input:

1335
1568
7234
252
989
4203
5751
2476
1965
244
3427
1868
3969
1832
875
340
2281
968
8514
8674
8145
2338
6951
5972
132
3702
3264
293
4195
6
9561
6132
1630
6096
2230
5586
5911
3323
1915
6316
9286
8592
4502
8518
4198
1144
7686
6868
9198
7946
8126
3110
5710
8132
2076
7897
9708
449
7003
2938
4094
871
676...

output:

walk 138458589
walk 849287104
walk 321589553
walk 158049862
walk 170605546
walk 662787581
walk 964117996
walk 779202361
walk 518692328
walk 165536681
walk 868146993
walk 975311259
walk 351847605
walk 228561411
walk 21133080
walk 613404332
walk 11425334
walk 692506841
walk 32086684
walk 897795189
wal...

result:

ok n=10000

Test #13:

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

input:

57191
23780
14979
87413
32748
41525
35487
50547
45034
28729
29485
38037
90055
36314
47447
74043
10723
79342
65860
78735
11339
5802
61536
14135
17657
15643
46611
54364
50443
91582
23841
18297
33377
88988
25898
53183
55025
9285
24512
11506
38321
35505
39240
22956
7909
60955
91110
74770
23779
21870
545...

output:

walk 607056072
walk 54041417
walk 557856364
walk 60813171
walk 49914369
walk 204839770
walk 995241069
walk 342319795
walk 249230688
walk 353007771
walk 711703104
walk 978151840
walk 321484232
walk 946235395
walk 964558203
walk 476173742
walk 352359176
walk 27309344
walk 956147278
walk 427254296
walk...

result:

ok n=100000

Test #14:

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

input:

685447
76572
530878
91074
246549
689148
99741
390709
191071
322810
679221
412599
847438
337970
556154
321885
335952
385073
429295
452215
544143
484598
138459
648058
609867
357529
501657
501211
76651
256915
81897
290018
890186
139534
244106
554303
394824
752275
369338
945600
835867
855192
559022
6678...

output:

walk 773493932
walk 770782752
walk 178521944
walk 236410549
walk 415381296
walk 448013384
walk 409897981
walk 314406968
walk 250227565
walk 122789973
walk 159629383
walk 999741113
walk 808110385
walk 229553336
walk 681812338
walk 645715534
walk 839171015
walk 268363892
walk 335862189
walk 798859946
...

result:

ok n=1000000

Test #15:

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

input:

1016974
3587990
8410531
8766475
1524957
4535509
5507732
7546356
1724728
5817444
5566371
8346921
6622061
8953103
6913858
213266
4808994
153190
983351
9305314
1033668
3950885
9780528
3982880
7712330
507332
6855839
9186427
4374313
5559473
6725379
7842891
4813798
3979390
9675602
7818109
1122605
11090
77...

output:

walk 43132526
walk 382951137
walk 735780047
walk 342122247
walk 965091276
walk 269984128
walk 130268031
walk 303709393
walk 27310106
walk 964081730
walk 880743121
walk 192967098
walk 94047290
walk 96804211
walk 130075128
walk 837467364
walk 776671385
walk 255977737
walk 489092612
walk 117875476
walk...

result:

ok n=10000000

Test #16:

score: 0
Accepted
time: 5ms
memory: 4020kb

input:

34961915
29923863
65832253
85059500
72899626
59602417
2440505
44711401
31276012
22694494
27931340
47868331
31101231
18293834
93394239
4534013
5792155
63062614
65197457
21530543
51846670
8741310
22847605
82450207
83079555
38311629
65046188
11334632
11928320
51723625
70829945
71510400
24562220
3503758...

output:

walk 997068377
walk 458106210
walk 220356097
walk 345678225
walk 156163888
walk 265094096
walk 213143189
walk 374200106
walk 482862645
walk 49316469
walk 188493545
walk 617799458
walk 842257346
walk 851342989
walk 164916041
walk 185794243
walk 807904468
walk 516687200
walk 972619500
walk 35052442
wa...

result:

ok n=100000000

Test #17:

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

input:

164793953
372653846
382258334
706321648
797806019
252586730
114075336
60891969
341617890
711994059
382363676
571299083
758013967
600621347
35123343
854537648
413937278
183316642
901706494
789184655
407525847
801552682
793347972
3238765
135033180
594107771
889932123
168991742
984836720
895815940
2983...

output:

walk 658560953
walk 569396132
walk 215956146
walk 200183584
walk 159558158
walk 369812633
walk 280140883
walk 344052600
walk 976400166
walk 204215956
walk 102621421
walk 297905591
walk 762521564
walk 645121011
walk 387000276
walk 575491101
walk 579024659
walk 335806961
walk 799665514
walk 332212902
...

result:

ok n=1000000000

Test #18:

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

input:

260170472
2326944
157256329
664806666
488041388
135906841
433763220
426235398
90473637
761892225
214878274
806779664
642925044
329652437
7621434
58968573
4141648
911627651
259498822
365323971
325922431
354323903
215615380
278427596
51565746
245978287
57874609
11267831
241229664
192383205
610453291
8...

output:

walk 804883173
walk 671481733
walk 973228755
walk 32904330
walk 359290470
walk 905569067
walk 789439933
walk 8785934
walk 392696643
walk 129471967
walk 828831200
walk 904208815
walk 211221445
walk 687000117
walk 638005119
walk 380924848
walk 816233450
walk 849202903
walk 166669703
walk 948876886
wal...

result:

ok n=923579837

Test #19:

score: 0
Accepted
time: 6ms
memory: 3964kb

input:

230003473
17705838
108374286
272745289
17295648
263699621
202257392
4975767
176155013
114210029
197521019
228953796
199577231
224169649
235339317
217434486
21522135
159524009
49466229
44439151
180878878
144798996
80741770
268016993
246312039
210445968
172186624
144479816
35678733
200582725
141106905...

output:

walk 436288476
walk 856575449
walk 433530328
walk 701067110
walk 539578908
walk 149424324
walk 182641628
walk 637597353
walk 531769057
walk 684047651
walk 80592026
walk 288551463
walk 101541581
walk 938424861
walk 32651122
walk 223793433
walk 927392748
walk 647930898
walk 794836809
walk 785346342
wa...

result:

ok n=273583259

Test #20:

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

input:

354883784
266239409
377364060
50383338
225282591
4822423
16981905
320043309
326983145
307661425
309162979
143134909
345610287
11889870
123108034
328525829
10932394
29546782
251160429
192878569
140007678
150210136
126596465
379350778
166369692
216145235
112544312
212747719
1513611
116137621
174102719...

output:

walk 958918769
walk 302471437
walk 796632534
walk 813078101
walk 716789627
walk 379925912
walk 296064140
walk 827489706
walk 132594695
walk 175117330
walk 505972414
walk 281302249
walk 164437613
walk 547680559
walk 617644473
walk 16442885
walk 162662351
walk 711953797
walk 108621723
walk 970280591
w...

result:

ok n=398532958

Test #21:

score: 0
Accepted
time: 6ms
memory: 4028kb

input:

76499497
41200157
8088275
24872849
28142291
128930920
45613181
91556965
14784840
72479322
99983093
141230502
123278180
9411869
32418349
67172134
53934971
61359745
22688354
127661137
122119874
115137800
76177500
29614070
62926569
123074379
18767712
136640939
137502414
134476310
14701316
64737688
5780...

output:

walk 23433647
walk 861183468
walk 569982946
walk 676813404
walk 414389297
walk 188316830
walk 35857132
walk 997651761
walk 381201928
walk 814517071
walk 740969745
walk 7942440
walk 947575559
walk 541560577
walk 755604375
walk 444899948
walk 235495850
walk 119839928
walk 113189726
walk 226698254
walk...

result:

ok n=150182058

Test #22:

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

input:

287328685
238397841
243122844
256109471
305146798
128788015
205684157
283627487
215710284
107657622
307435606
69327751
214392546
150021314
168750575
239960470
181426568
244188666
266812016
80361248
294065455
139789574
204999652
165630764
121056120
183941921
240564656
130150123
201041395
82481562
279...

output:

walk 213865097
walk 278799058
walk 629332198
walk 695468818
walk 769541745
walk 34586805
walk 290237619
walk 8552056
walk 98013661
walk 653606573
walk 472100029
walk 895554971
walk 618994239
walk 996355079
walk 117279708
walk 25323780
walk 838519420
walk 206056449
walk 322381377
walk 843436038
walk ...

result:

ok n=328535824

Test #23:

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

input:

659557626
662195512
905963324
235844880
787514714
300758189
909096277
347613205
416043926
298761848
302895661
549671204
897249958
316912867
431911720
721199751
686531441
159226441
371667501
947180773
795826561
573390754
884188344
103114664
343566630
813492516
25205861
951806420
835181527
707612792
8...

output:

walk 849362889
walk 984800900
walk 525395541
walk 254920193
walk 740554420
walk 340018422
walk 830249980
walk 496799250
walk 402610284
walk 662705691
walk 599434776
walk 171408248
walk 644293969
walk 397387454
walk 40771007
walk 27650573
walk 67936717
walk 820297972
walk 303715747
walk 587056666
wal...

result:

ok n=998244353

Test #24:

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

input:

710968862
407883226
313140810
286495768
600586195
287509158
846319877
352853411
43162050
562620572
903326769
939072401
521504558
814594078
716678597
391320725
562247557
829005979
665979489
17396543
957535862
955878627
200200642
152053809
374672493
698432917
340979872
654833359
385719953
377774783
24...

output:

walk 949911049
walk 215989184
walk 298567552
walk 951309365
walk 731724939
walk 613170750
walk 509947508
walk 375914544
walk 509010484
walk 544113661
walk 117220266
walk 942591910
walk 738387592
walk 476494137
walk 479306881
walk 357838041
walk 467851991
walk 885553456
walk 43569175
walk 187740204
w...

result:

ok n=993244853

Test #25:

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

input:

167980702
728670534
143269582
485740770
234733706
9142328
101856705
428240326
386922630
14657435
444593670
595631635
548569680
195548956
518009923
490602789
400310932
320968061
47467863
344319754
271223389
244524760
668929449
40930682
103714145
59749522
502223516
200904952
700964297
509304563
440140...

output:

walk 98410426
walk 171363260
walk 423907193
walk 583129747
walk 698163050
walk 701354889
walk 551752667
walk 598968608
walk 312789544
walk 388716924
walk 573114976
walk 127359984
walk 421093475
walk 708678964
walk 639294483
walk 663173614
walk 953703480
walk 343280217
walk 503520145
walk 381323887
w...

result:

ok n=759738543

Test #26:

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

input:

29783805
83566164
103398507
8855936
14231780
87988475
108198721
89575530
16787476
47056809
34499672
38269525
66067303
7222610
9751636
4794557
74069529
10847628
7824366
45367747
10737436
79560682
6515877
93404353
106460348
11324491
58753295
29990846
22730284
10648428
61261649
108004251
9650542
108016...

output:

walk 327603245
walk 429661533
walk 494815565
walk 928403887
walk 880291658
walk 499439341
walk 861549373
walk 987829666
walk 949203705
walk 148577793
walk 377664023
walk 167930042
walk 56033609
walk 93408319
walk 194529748
walk 194137831
walk 355359403
walk 815697318
walk 362359216
walk 436789784
wa...

result:

ok n=124834753

Test #27:

score: 0
Accepted
time: 9ms
memory: 4008kb

input:

732444289
630779019
728632715
556580554
926042153
488581218
59452200
14089615
331682373
56355610
34997888
855537075
176956578
133567460
87215501
639259837
669867544
887889527
730780471
637500991
3830863
427502810
799937606
393218026
692414442
307380042
556031901
719445856
812468752
545559302
9382583...

output:

walk 620691254
walk 119706335
walk 741486476
walk 396949699
walk 634857604
walk 776686195
walk 106975537
walk 525968455
walk 780206133
walk 490654222
walk 228805023
walk 190787407
walk 773321423
walk 74581602
walk 926416901
walk 177302801
walk 5025017
walk 692431058
walk 157510844
walk 151504185
wal...

result:

ok n=949952395

Test #28:

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

input:

436188864
94260497
261912958
796032319
817739123
350811333
29881539
802832370
332366887
201278889
464401295
51610892
778027113
174696584
44638059
385428832
554463744
542579401
571404512
241804564
248753509
660389107
346974811
222189844
819508215
252383172
687935738
551616848
713690906
416492735
4191...

output:

walk 838760339
walk 622377262
walk 513567463
walk 436182209
walk 873299349
walk 998048693
walk 514248239
walk 59375261
walk 625542321
walk 45701974
walk 187023853
walk 586563375
walk 297169538
walk 350398439
walk 187495480
walk 181233631
walk 535881128
walk 167817336
walk 382782194
walk 422459588
wa...

result:

ok n=835823588

Test #29:

score: 0
Accepted
time: 19ms
memory: 4020kb

input:

788116689
512111856
198727532
88118471
367929704
319243339
44069871
227990121
386956861
113548343
764409572
511603521
452652477
579789586
846004548
423773446
725209459
151536418
499329843
615046203
332017672
597932062
855623681
181652719
968970079
236326960
364961283
234518649
155311626
365344627
32...

output:

walk 982518962
walk 51301574
walk 213383413
walk 298784508
walk 713625505
walk 956191394
walk 826229040
walk 529831926
walk 529628206
walk 448903480
walk 787675992
walk 503361096
walk 446225770
walk 295403715
walk 68004342
walk 428786675
walk 261442087
walk 970632339
walk 302240204
walk 442303124
wa...

result:

ok n=996832654

Test #30:

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

input:

481171406
131919902
729563389
246825673
597013074
353394112
115033094
89903013
263256849
464888947
157676043
31409881
811037450
305453427
13132329
290230793
195483253
657484001
783630472
390293762
772125214
69777295
149330982
306450785
628656167
722058171
452732058
446804303
202893172
61907117
71969...

output:

walk 272887638
walk 478804002
walk 974750100
walk 629412800
walk 467204541
walk 886024955
walk 105398883
walk 674524890
walk 391958565
walk 322129190
walk 654313882
walk 91408105
walk 148815125
walk 994101532
walk 142625812
walk 201910224
walk 367508245
walk 241913475
walk 704018400
walk 866426830
w...

result:

ok n=835884359

Test #31:

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

input:

461410280
565822943
559227699
646222867
43848269
840243175
300255944
7611907
111295910
178108904
67554881
173253380
805207318
822756131
331604992
370698196
648615408
463170544
95760555
488257109
556023861
354356138
130684312
584508966
388232838
850451328
161193843
525655333
624407153
379363876
37084...

output:

walk 175439314
walk 963651357
walk 852643450
walk 86995168
walk 256864096
walk 796394906
walk 319251463
walk 566594657
walk 103684003
walk 66812994
walk 748684671
walk 964937193
walk 631953938
walk 17548813
walk 368087555
walk 39093204
walk 277917212
walk 673793830
walk 491828705
walk 392496554
walk...

result:

ok n=859238694

Test #32:

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

input:

922427740
779612149
581774444
785345631
791291505
709863990
379432794
320703858
851678634
178589514
209934206
444518943
588961097
812753490
792753762
715611155
734437402
639987816
705838876
174667829
793080877
588799417
470695927
408847381
483003655
342109572
455357421
2139604
966639519
878442264
94...

output:

walk 368355720
walk 363927354
walk 700139791
walk 117943402
walk 175953483
walk 737443647
walk 796516740
walk 145731777
walk 306938148
walk 340145784
walk 220114649
walk 799902715
walk 721217003
walk 17674471
walk 756267696
walk 308828288
walk 134666060
walk 550476284
walk 551867746
walk 846399934
w...

result:

ok n=984359463

Test #33:

score: 0
Accepted
time: 9ms
memory: 3944kb

input:

860922926
231225048
499085253
241474150
671976357
262600636
682246490
86615464
858963375
650548987
321034047
695651605
733596745
323127043
299548670
633134137
668480605
467785758
805278838
141577014
119611074
686503387
578583576
313636343
55278180
146585104
786987605
387109913
716707059
648699062
64...

output:

walk 860922925
walk 318660447
walk 267860205
walk 690747222
walk 430502207
walk 538982604
walk 419645854
walk 352727299
walk 772347911
walk 739943937
walk 618843385
walk 374617558
walk 986303465
walk 537888623
walk 924779952
walk 333585467
walk 35346468
walk 747663478
walk 337493080
walk 284656501
w...

result:

ok n=948358325

Test #34:

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

input:

2
2
2
1
2
2
2
2
1
2
2
1
1
2
1
2
1
2
1
1
1
2
1
1
2
1
1
1
2
2
2
2
1
2
1
2
2
1
1
2
2
2
2
2
2
2
1
1
2
1
2
2
1
2
2
2
1
1
1
1
1
2
2
1
1
2
1
1
1
1
1
1
1
1
2
1
2
1
2
2
2
1
2
1
1
1
1
2
1
1
2
1
2
1
1
2
2
2
1
2
1
2
1
1
2
1
2
2
1
2
2
2
1
2
1
1
2
1
1
2
2
1
2
2
1
1
1
1
1
2
1
1
2
2
2
1
1
1
1
2
1
2
2
1
2
1
2
2
1
2
...

output:

walk 673702627
walk 578248502
walk 835568126
walk 217250207
walk 710575
walk 522703432
walk 654207850
walk 757168912
walk 200138475
walk 723169469
walk 814653062
walk 169535653
walk 589256300
walk 17322141
walk 444844699
walk 98896041
walk 57311059
walk 613203141
walk 543837803
walk 227544104
walk 9...

result:

ok n=2

Test #35:

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

input:

1
3
1
3
2
1
3
3
3
2
3
1
3
3
1
1
2
3
1
1
3
1
3
2
1
3
2
2
3
1
3
3
3
1
1
3
1
3
1
2
3
3
2
2
2
1
2
2
1
1
3
1
3
3
1
2
3
2
2
2
2
2
3
2
2
3
3
3
3
3
1
3
2
1
2
2
2
3
3
3
2
1
3
2
1
2
3
1
2
2
1
1
3
3
2
3
1
1
3
3
1
2
2
3
3
3
1
3
1
3
3
3
3
1
3
2
2
2
2
3
2
3
1
1
1
3
3
1
2
3
2
1
3
1
3
3
1
2
2
3
2
1
1
3
1
3
1
2
1
2
...

output:

walk 521136484
walk 698584984
walk 683234285
walk 477457828
walk 687809314
walk 286273639
walk 155328823
walk 787837863
walk 986593758
walk 23814682
walk 457821392
walk 8168666
walk 957464125
walk 526972035
walk 791805662
walk 103829745
walk 74111453
walk 370883384
walk 812275295
walk 709347579
walk...

result:

ok n=3

Test #36:

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

input:

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

output:

walk 97342068
walk 12131167
walk 754270432
walk 104328533
walk 805936654
walk 832055420
walk 102746154
walk 99381493
walk 559697198
walk 778064304
walk 186774620
walk 587629861
walk 501981831
walk 116147487
walk 63851397
walk 27608426
walk 243046774
walk 818995874
walk 201171534
walk 839582120
walk ...

result:

ok n=4

Test #37:

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

input:

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

output:

walk 447798228
walk 831040369
walk 761565969
walk 241571403
walk 359991037
walk 112932891
walk 685305223
walk 755360944
walk 112023945
walk 369676176
walk 984019473
walk 314460046
walk 712140714
walk 272307061
walk 632493419
walk 187106175
walk 938448632
walk 73664974
walk 795843489
walk 772903209
w...

result:

ok n=5

Test #38:

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

input:

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

output:

walk 787877036
walk 586496313
walk 13051612
walk 392515426
walk 587660405
walk 568396813
walk 271506070
walk 140830615
walk 512362006
walk 292113119
walk 562839075
walk 776749369
walk 224646880
walk 757370695
walk 479782619
walk 511605769
walk 276082324
walk 379748501
walk 144886202
walk 821719565
w...

result:

ok n=6

Test #39:

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

input:

1703
2074
1787
1255
2507
499
2826
853
2767
1353
516
1961
335
2791
2781
2768
847
2039
352
1757
1301
1055
774
286
2564
1179
914
2335
2800
1663
122
2225
45
1441
1937
2046
2335
2033
282
2945
2854
431
1621
2023
2694
515
2875
1744
1230
230
198
49
746
410
1542
1636
380
2575
948
2138
325
786
2558
2864
2757
...

output:

walk 667794478
walk 117791787
walk 645622293
walk 946820709
walk 577223564
walk 829350949
walk 64572893
walk 421546267
walk 483743411
walk 177061118
walk 117238362
walk 430167488
walk 186852850
walk 144407128
walk 252599945
walk 340779334
walk 311715507
walk 872063556
walk 645439837
walk 472580340
w...

result:

ok n=3000

Test #40:

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

input:

915
827
1962
1823
1275
1292
1402
54
1827
1254
1733
1447
192
1108
649
156
66
1032
1106
1250
1215
916
379
458
764
850
1574
697
1998
859
1
199
1138
711
1074
542
1774
824
702
1381
892
975
838
624
697
656
73
1130
705
1497
514
23
1615
820
1860
760
438
864
120
1309
725
497
154
419
1683
1519
1869
1101
1491
...

output:

walk 746071905
walk 726913425
walk 29813473
walk 842829352
walk 872188476
walk 7778369
walk 603231359
walk 27249219
walk 575180804
walk 368147677
walk 887250820
walk 953938870
walk 746551569
walk 646623126
walk 724780162
walk 351869637
walk 185765402
walk 269968072
walk 247199853
walk 421982967
walk...

result:

ok n=2000

Test #41:

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

input:

190
2229
1467
1767
1466
2575
237
2221
3555
2857
3875
1354
2840
1640
2876
610
38
1969
3613
3411
2244
2397
1608
3506
2476
3921
2809
3648
1838
159
2303
3461
422
1286
3033
194
2726
3210
2264
3412
3117
581
551
2117
1598
1059
3599
1505
1403
3504
1692
3678
2167
104
2515
3479
2668
527
2114
3142
2338
2731
44...

output:

walk 396169734
walk 870558023
walk 708427551
walk 794273128
walk 196099065
walk 30056330
walk 591051468
walk 229237832
walk 557606891
walk 385596747
walk 15263086
walk 368956508
walk 117060145
walk 711288314
walk 191314595
walk 374749523
walk 436463703
walk 748602130
walk 473986550
walk 836362930
wa...

result:

ok n=4000

Test #42:

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

input:

6214
6085
2934
877
5435
1941
5994
1330
686
2495
3995
5603
1801
6384
607
3442
2232
5452
994
5007
5009
3660
2866
3638
4273
1693
676
2192
5518
3387
2907
5623
1425
6119
918
5929
3436
1777
5601
64
116
292
2953
1646
2548
5630
4735
2741
2859
4886
5496
5906
4294
4938
5271
2522
3609
6016
1548
173
3223
2833
5...

output:

walk 485885007
walk 561697988
walk 253468258
walk 810920171
walk 303133505
walk 166554705
walk 199173448
walk 557250257
walk 866168001
walk 46858386
walk 903523215
walk 423857874
walk 211051177
walk 451894229
walk 295315110
walk 189125490
walk 353114160
walk 884440319
walk 469366722
walk 154609240
w...

result:

ok n=6666

Test #43:

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

input:

2479
2154
6617
6387
485
2742
4147
3225
2020
432
817
2409
6566
3035
4506
6309
6612
2140
4774
783
125
16
5699
3629
1125
4013
4076
6398
2467
864
1395
4195
5068
3361
3235
306
3758
4125
4564
4068
2258
1789
6574
460
317
4947
632
4401
2787
760
1739
2269
2587
6184
1030
6320
1823
2875
846
1357
3785
1218
3178...

output:

walk 341883081
walk 989091392
walk 835284055
walk 988567100
walk 747827552
walk 187625623
walk 356675971
walk 635252010
walk 816329766
walk 16373366
walk 797124268
walk 168096136
walk 119216726
walk 387048708
walk 145197237
walk 185542075
walk 155971442
walk 704034554
walk 844224470
walk 530737184
w...

result:

ok n=6667

Test #44:

score: 0
Accepted
time: 5ms
memory: 4028kb

input:

336945
7899195
7299114
7138591
7686333
4163603
7792322
8940201
7310429
1673561
8722185
5334085
3359080
8771273
8858782
7339950
4946333
4297702
8789418
713990
5209391
2236928
5715976
3585305
413526
5892386
4016100
1636575
2986183
942280
5161306
3373522
3746063
2049325
4792495
8714108
2085213
718908
2...

output:

walk 213284734
walk 476750369
walk 113017299
walk 188330033
walk 955916469
walk 298289172
walk 396309395
walk 758671023
walk 470471040
walk 309553064
walk 791671953
walk 216992722
walk 869544070
walk 211222576
walk 165785531
walk 308090917
walk 416925047
walk 167565783
walk 278929232
walk 688917128
...

result:

ok n=9000000

Test #45:

score: 0
Accepted
time: 9ms
memory: 3896kb

input:

9640947
5367495
6102699
10770722
10810166
9812275
7205843
4448371
4555183
6997466
5356302
5656066
5877650
9625255
7982796
8125065
1680426
3525422
7940636
2934858
2168511
7722518
7130534
3311601
9304835
1373520
4775431
1351493
7232240
9319741
10490732
3847902
8333455
769964
5701393
3898357
4694465
32...

output:

walk 625373864
walk 189107222
walk 303942415
walk 154161830
walk 836410487
walk 128557224
walk 57617818
walk 879004473
walk 690456360
walk 87166270
walk 745550987
walk 386220912
walk 258042598
walk 613012994
walk 314484255
walk 313126319
walk 910898722
walk 34139767
walk 178900851
walk 449112800
wal...

result:

ok n=11108889

Test #46:

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

input:

17561950
14251471
1619958
9339204
14346313
3687237
3004619
3373255
12336893
3843628
646739
14423351
15380884
3620973
1951337
9048515
15232505
4741067
16544924
17077714
18943475
15256805
8731894
431606
11480964
10322475
9104770
18687508
16626473
19149082
11644625
16452855
10668067
9462216
296163
2517...

output:

walk 842445824
walk 620786056
walk 675453728
walk 253965130
walk 422426393
walk 200533775
walk 711682822
walk 664442872
walk 973266309
walk 878420756
walk 258777521
walk 3517957
walk 376180619
walk 195754467
walk 456575443
walk 686023669
walk 487941711
walk 467925937
walk 587662905
walk 78642865
wal...

result:

ok n=19260817

Test #47:

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

input:

467702
65803
32048
386352
74250
391530
18112
198979
83472
370663
165420
231981
642349
663928
491654
301102
216297
100647
657551
50923
433063
360725
82780
811207
41210
244652
390507
283997
127344
480828
28650
293193
123253
524015
512185
651529
693390
399875
753816
130848
168078
467576
726505
688332
2...

output:

walk 417520407
walk 250736700
walk 107181622
walk 309048242
walk 377733589
walk 751544599
walk 619491505
walk 752878898
walk 143533855
walk 972943470
walk 987039634
walk 908958573
walk 522657632
walk 183797676
walk 946364918
walk 365199625
walk 813614213
walk 340902627
walk 854364972
walk 4332922
wa...

result:

ok n=832478

Test #48:

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

input:

8894563
16424528
45392028
33730743
23866863
41049059
7652250
3216714
58461849
5660540
18902394
15275273
17538723
55204712
48810235
19960970
11662923
25840574
13667905
15845801
52737792
17235606
56372307
19650559
40945263
30430996
20885035
43912156
57710292
12268775
58471929
7731195
22499271
31050087...

output:

walk 84750799
walk 379378292
walk 792409044
walk 342627437
walk 640423151
walk 64602666
walk 911063144
walk 227963592
walk 920004728
walk 12702774
walk 763622698
walk 176600083
walk 226345552
walk 755091237
walk 471266152
walk 455141947
walk 720715560
walk 65829827
walk 553032923
walk 385205632
walk...

result:

ok n=58737529

Test #49:

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

input:

110610988
92382989
95413929
232782048
124047768
35900783
211908179
226697538
166844520
182948932
199584968
215979319
223064930
187610404
131680919
175317346
67111786
19083490
185612726
143279062
57126189
190361166
31149729
110514229
24325728
93362591
93056821
8758619
179548532
114055865
198048648
15...

output:

walk 685116327
walk 617646422
walk 67763864
walk 603336351
walk 456461919
walk 399260366
walk 534594958
walk 760172342
walk 733270762
walk 18127883
walk 468615472
walk 569650007
walk 312667694
walk 200493583
walk 223393605
walk 718480270
walk 343896374
walk 572053169
walk 737737855
walk 698823494
wa...

result:

ok n=238532958

Test #50:

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

input:

363850210
203042240
134272575
171009129
138571964
230789452
395342649
440713956
195194809
297841886
317834886
185266974
503625776
16634326
469625499
432882796
253172137
307433212
441471885
356080906
257117788
141308600
36639322
274979679
393348089
96952973
111748590
201741837
271686764
373755980
755...

output:

walk 138679324
walk 974689787
walk 666554517
walk 281014184
walk 336140941
walk 563262419
walk 964264302
walk 964154786
walk 715799370
walk 114719480
walk 311210020
walk 275234616
walk 928403189
walk 750961602
walk 914726617
walk 550714026
walk 10846983
walk 965010276
walk 35221978
walk 825177730
wa...

result:

ok n=513204503

Test #51:

score: 0
Accepted
time: 5ms
memory: 4056kb

input:

370622256
330162970
672808475
197332132
523079875
566048215
379467418
20852186
83409830
841352497
468973973
267456221
798361472
866003856
463778623
718146738
509434087
459911832
76461018
702243049
732450865
233325643
528859066
790387446
53383042
124120014
153234533
692661859
584955465
459269067
8715...

output:

walk 370622255
walk 883118949
walk 342645505
walk 448101892
walk 325747743
walk 966546575
walk 736997438
walk 564963003
walk 62557644
walk 757942667
walk 551199711
walk 722060483
walk 530905251
walk 991220619
walk 521353002
walk 254368115
walk 714865584
walk 874055980
walk 540127421
walk 625782031
w...

result:

ok n=923578235

Test #52:

score: 0
Accepted
time: 5ms
memory: 4004kb

input:

5688913
126857558
170538499
2776743
150187969
115213008
123155512
162647665
113543247
146641112
167919127
5516699
43796202
14694905
145591585
84493306
122898335
24418883
76028444
35256516
4656427
87353515
42055322
100932299
99846644
32940278
25098650
35479231
94483180
126558787
9009246
184605779
989...

output:

walk 89646488
walk 700943524
walk 430197527
walk 25496537
walk 340669519
walk 544799918
walk 7942504
walk 619267032
walk 144153875
walk 33097865
walk 601052894
walk 417372451
walk 38279503
walk 164156996
walk 324154973
walk 325418307
walk 811438201
walk 674553720
walk 244867854
walk 152486365
walk 3...

result:

ok n=193258293

Test #53:

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

input:

197455268
113060041
224229596
138907090
86543919
14413747
165784388
134228391
200700471
65236329
97002430
78911720
66877228
205963893
170633757
157809273
8067926
77377171
10511593
122020667
216397337
38364886
199297175
119258201
23111690
131993849
75232226
64412432
210940317
149164638
217128804
1099...

output:

walk 51324829
walk 556728489
walk 708015949
walk 341384136
walk 646577646
walk 596940768
walk 940974054
walk 518321711
walk 557805850
walk 502108345
walk 44260338
walk 653377744
walk 399428916
walk 382021001
walk 490827275
walk 96274216
walk 910345597
walk 134538475
walk 626984470
walk 476111547
wal...

result:

ok n=238728439