QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#208177#3278. 算术1kri37 618ms3856kbC++14309b2023-10-09 08:55:182023-10-09 08:55:18

Judging History

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

  • [2023-10-09 08:55:18]
  • 评测
  • 测评结果:37
  • 用时:618ms
  • 内存:3856kb
  • [2023-10-09 08:55:18]
  • 提交

answer

#include <iostream>
#include <cstdio>
#define int long long
using namespace std;
int t,p,b;
signed main(){
	cin>>t>>p;
	while(t--){
		cin>>b;
		int k=1,v=(__int128)b*b%p;
		while(k<=p&&v!=p-1){
			k++;
			v=(__int128)b*v%p;
		}
		if (k>p)cout<<-1<<endl;
		else cout<<k<<endl;
	}
	return 0;
}

詳細信息

Subtask #1:

score: 5
Accepted

Test #1:

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

input:

10 3
10
7
13
4
17
28
29
13
4
30

output:

-1
-1
-1
-1
2
-1
2
-1
-1
-1

result:

ok 10 numbers

Test #2:

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

input:

10 3
17
21
29
8
25
21
8
14
26
7

output:

2
-1
2
2
-1
-1
2
2
2
-1

result:

ok 10 numbers

Test #3:

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

input:

10 2
14
12
20
12
7
4
6
12
16
13

output:

-1
-1
-1
-1
1
-1
-1
-1
-1
1

result:

ok 10 numbers

Subtask #2:

score: 5
Accepted

Dependency #1:

100%
Accepted

Test #4:

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

input:

10 4
10
10
39
26
20
30
23
13
17
27

output:

-1
-1
2
-1
-1
-1
2
-1
-1
2

result:

ok 10 numbers

Test #5:

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

input:

10 5
13
45
45
36
46
30
47
6
15
16

output:

1
-1
-1
-1
-1
-1
1
-1
-1
-1

result:

ok 10 numbers

Test #6:

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

input:

10 6
8
31
37
22
29
7
44
12
29
32

output:

-1
-1
-1
-1
2
-1
-1
-1
2
-1

result:

ok 10 numbers

Test #7:

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

input:

10 7
27
34
12
18
36
57
21
61
27
25

output:

2
2
2
-1
-1
-1
-1
2
2
-1

result:

ok 10 numbers

Test #8:

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

input:

10 8
36
58
52
78
43
42
51
40
18
27

output:

-1
-1
-1
-1
-1
-1
-1
-1
-1
-1

result:

ok 10 numbers

Test #9:

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

input:

10 9
53
26
68
54
24
81
29
13
71
71

output:

2
2
2
-1
-1
-1
2
-1
2
2

result:

ok 10 numbers

Test #10:

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

input:

10 10
67
43
20
39
55
51
47
62
87
100

output:

1
1
-1
2
-1
-1
1
-1
1
-1

result:

ok 10 numbers

Subtask #3:

score: 5
Accepted

Dependency #1:

100%
Accepted

Dependency #2:

100%
Accepted

Test #11:

score: 5
Accepted
time: 1ms
memory: 3624kb

input:

100 97
180
581
305
712
315
861
922
484
175
519
943
365
547
142
770
114
182
452
746
290
158
583
185
600
609
412
523
397
227
839
604
387
116
621
914
640
324
678
221
938
709
677
876
678
213
653
581
903
299
287
860
765
672
180
399
907
814
969
934
956
820
864
235
848
815
367
241
737
674
417
856
404
291
4...

output:

47
2
47
3
11
7
23
2
15
15
7
47
2
15
5
47
7
3
15
2
-1
-1
11
7
7
11
47
11
3
15
1
2
15
47
47
47
3
2
7
23
15
23
23
2
15
47
2
15
7
11
47
23
47
47
23
15
47
2
-1
47
23
11
47
23
47
47
3
47
47
47
47
5
-1
47
3
15
47
47
15
2
15
23
47
2
11
5
1
47
47
2
15
2
47
47
47
3
47
2
23
15

result:

ok 100 numbers

Test #12:

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

input:

100 91
851
144
363
247
607
696
363
691
883
394
118
371
360
787
879
868
168
103
842
706
414
746
540
702
217
817
497
573
822
395
108
384
551
620
436
374
340
907
855
181
849
661
580
707
726
513
749
636
812
454
874
227
472
315
791
806
752
909
188
690
664
547
657
153
138
171
587
419
430
731
349
512
904
7...

output:

-1
-1
2
-1
-1
-1
2
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
2
-1
2
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
2
-1
-1
-1
-1
2
-1
-1
-1
2
-1
-1
-1
-1
-1
-1
-1
2
-1
2
-1
-1
2
-1
-1
-1
-1
2
-1
-1
-1
-1
-1
2
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
2
-1
2
-1
-1
2
-1
-1
-1
-1
-1
-1
-1
-1
-1
2
-1
-1

result:

ok 100 numbers

Test #13:

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

input:

100 81
85
543
544
188
666
539
270
161
666
323
221
522
512
207
622
762
284
740
143
397
265
774
419
370
344
163
214
214
501
262
436
328
647
754
453
161
416
809
723
229
496
735
357
478
242
161
227
389
188
325
382
134
463
736
325
329
231
102
623
553
728
445
460
636
416
646
637
221
219
436
695
298
161
87...

output:

-1
-1
-1
2
-1
2
-1
2
-1
2
26
-1
2
-1
-1
-1
26
26
8
-1
-1
-1
26
-1
26
-1
-1
-1
-1
-1
-1
-1
2
-1
-1
2
26
2
-1
-1
-1
-1
-1
-1
2
2
26
26
2
-1
-1
2
-1
-1
-1
26
-1
-1
26
-1
2
-1
-1
-1
26
-1
-1
26
-1
-1
26
-1
2
-1
8
2
-1
-1
2
-1
-1
-1
-1
-1
26
-1
2
-1
-1
26
-1
-1
26
-1
26
26
-1
2
-1
-1

result:

ok 100 numbers

Test #14:

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

input:

100 100
738
253
417
420
523
537
778
736
670
839
957
849
419
768
796
772
493
269
631
615
606
484
445
701
324
586
601
690
439
249
221
372
648
999
682
202
889
231
386
179
399
414
487
480
349
436
470
749
549
149
779
707
440
737
467
449
483
803
900
459
549
972
979
949
604
244
553
509
269
784
721
387
427
...

output:

-1
-1
-1
-1
-1
-1
-1
-1
-1
4
-1
-1
4
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
4
-1
-1
-1
-1
2
-1
-1
-1
-1
-1
4
2
-1
-1
-1
-1
-1
-1
-1
-1
-1
4
-1
-1
-1
-1
-1
-1
-1
-1
4
-1
-1
4
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
2
-1
-1
-1
-1
-1
-1
-1
-1
-1
2
-1
-1
-1
-1
4
-1
-1
-1
-1
-1
-1

result:

ok 100 numbers

Test #15:

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

input:

100 71
261
626
313
283
308
396
681
76
354
297
425
355
649
399
166
201
368
671
671
72
227
248
372
641
239
697
567
424
78
238
403
457
129
384
246
357
346
496
581
279
177
503
682
392
338
656
98
564
674
562
364
567
521
304
145
457
669
421
677
694
241
535
354
354
109
511
446
209
285
355
496
645
449
273
3...

output:

-1
-1
-1
2
-1
6
34
-1
2
34
2
-1
-1
34
-1
34
34
-1
-1
-1
4
34
4
-1
6
-1
2
34
34
-1
-1
34
-1
-1
34
-1
34
2
34
4
34
-1
-1
-1
-1
4
-1
34
34
34
-1
2
-1
-1
-1
34
-1
4
-1
34
34
-1
2
2
-1
4
-1
34
-1
-1
2
-1
6
-1
34
-1
-1
-1
34
6
34
34
6
34
-1
6
2
-1
4
-1
6
-1
6
34
4
34
34
-1
4
2

result:

ok 100 numbers

Test #16:

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

input:

100 91
405
173
240
151
729
826
614
533
292
878
272
184
613
170
632
215
836
320
437
240
837
612
243
527
492
762
818
734
139
166
355
228
790
419
808
365
181
254
277
884
683
174
546
870
170
280
818
624
596
701
483
854
421
638
766
885
634
361
634
242
519
902
834
316
558
392
710
791
719
570
465
667
599
8...

output:

-1
2
-1
-1
-1
-1
-1
-1
-1
-1
2
-1
-1
-1
-1
-1
2
-1
-1
-1
-1
-1
-1
-1
-1
-1
2
-1
-1
2
2
-1
2
-1
-1
-1
2
-1
-1
-1
-1
-1
-1
-1
-1
-1
2
-1
-1
-1
-1
-1
-1
-1
2
-1
-1
-1
-1
-1
-1
-1
-1
-1
2
-1
-1
-1
2
-1
2
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
2
-1
-1
-1
-1
-1

result:

ok 100 numbers

Test #17:

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

input:

100 67
329
142
107
81
244
378
571
198
307
141
547
206
488
342
107
639
358
589
127
315
509
551
501
347
388
268
550
131
351
526
102
541
270
669
588
378
195
209
638
228
212
527
231
350
506
178
374
164
320
401
129
413
504
669
155
445
518
659
151
239
126
303
535
102
237
334
566
220
309
633
133
362
200
26...

output:

32
10
-1
-1
10
10
-1
-1
-1
32
32
10
-1
32
-1
-1
-1
10
-1
-1
-1
-1
32
32
10
-1
-1
-1
-1
32
-1
10
32
2
10
10
32
10
-1
10
32
10
2
-1
-1
32
-1
2
10
2
-1
32
-1
2
-1
10
-1
-1
-1
2
-1
-1
2
-1
-1
2
2
-1
32
2
2
10
2
2
32
10
2
-1
32
-1
2
2
10
32
2
10
-1
10
32
-1
-1
10
32
-1
32
2
32
10
32
-1

result:

ok 100 numbers

Test #18:

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

input:

100 50
437
346
112
103
466
381
454
423
206
353
166
74
357
58
479
480
372
303
99
325
180
490
341
56
425
169
359
450
200
99
199
299
432
324
339
328
419
72
322
86
247
51
277
455
71
239
380
438
448
158
293
246
489
58
251
460
109
399
172
350
123
425
456
118
199
246
139
199
221
425
440
475
142
450
257
349...

output:

9
-1
-1
9
-1
-1
-1
9
-1
9
-1
-1
1
-1
4
-1
-1
9
2
-1
-1
-1
-1
-1
-1
4
4
-1
-1
2
2
2
-1
-1
4
-1
4
-1
-1
-1
9
-1
9
-1
-1
4
-1
-1
-1
-1
1
-1
4
-1
-1
-1
4
2
-1
-1
9
-1
-1
-1
2
-1
4
2
-1
-1
-1
-1
-1
-1
1
2
2
4
-1
4
9
-1
2
-1
9
-1
-1
-1
9
-1
9
-1
2
4
-1
-1
9
1
-1
-1

result:

ok 100 numbers

Test #19:

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

input:

100 24
180
159
233
75
236
31
147
81
175
180
119
117
79
175
204
182
137
123
36
127
132
125
175
239
128
188
240
32
139
105
175
183
171
107
56
206
58
125
95
182
33
49
215
135
62
223
77
199
145
65
103
125
214
154
87
47
29
175
52
178
92
150
31
32
209
134
220
92
217
74
35
223
128
215
234
127
239
112
141
6...

output:

-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
2
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
2
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
2
-1
-1
-1
2
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
2
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
2
-1
-1
2
-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 100 numbers

Subtask #4:

score: 11
Accepted

Dependency #1:

100%
Accepted

Dependency #2:

100%
Accepted

Dependency #3:

100%
Accepted

Test #20:

score: 11
Accepted
time: 3ms
memory: 3592kb

input:

100 6007
47209
17765
12070
33936
9456
46389
53980
47081
33569
12604
9471
53986
30034
23277
45832
42538
42048
16651
8020
57713
18099
10847
36498
53379
48899
46111
27949
35995
19980
36681
43053
30147
13279
42048
54141
14304
22364
24027
47979
45448
8046
46884
34366
44206
42127
49959
27880
37359
17772
3...

output:

-1
1000
3002
3002
272
-1
-1
-1
3002
-1
3002
2
2
1000
-1
1000
2
3002
230
1000
2
76
3002
3002
1000
12
-1
3002
76
3002
-1
428
272
2
2
230
90
2
2
32
3002
-1
-1
3002
2
-1
-1
428
1000
2
-1
-1
-1
428
1000
3002
-1
-1
2
-1
3002
1000
-1
-1
1000
3002
1000
-1
3002
-1
-1
3002
-1
-1
3002
76
-1
2
-1
3002
1000
-1
-...

result:

ok 100 numbers

Test #21:

score: 0
Accepted
time: 2ms
memory: 3512kb

input:

100 4051
8389
31611
11594
12817
33649
7172
26030
7466
8694
10490
4761
17984
17340
10129
38474
14225
31740
30259
32111
33089
27227
28415
6946
12349
7420
9073
32082
36458
32201
18875
13076
19473
17013
37823
13577
16711
4649
23061
26207
27875
15180
21335
10917
7084
30956
16203
7707
6450
14670
7951
1721...

output:

-1
2
2024
674
14
2024
-1
44
404
134
-1
2024
674
-1
2024
-1
2024
-1
74
-1
2024
2024
2024
-1
74
404
-1
2
-1
674
-1
-1
674
74
2024
2024
2024
-1
404
2024
4
-1
2024
-1
-1
2
-1
404
2024
-1
674
-1
2024
674
-1
2
2024
2024
-1
-1
80
2
2
2024
-1
-1
2024
2
404
2024
2024
2
-1
224
2024
2024
2024
-1
-1
-1
74
2024
...

result:

ok 100 numbers

Test #22:

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

input:

100 9323
15509
64805
9567
78745
68708
83906
38816
82251
19294
18197
16917
66211
21706
24188
62893
35932
67872
23904
69166
43685
52836
82840
58824
65466
34882
72563
54038
64098
22473
15338
66018
38785
34483
59422
61403
33509
22947
47635
71422
29273
18645
25141
63196
26208
64199
46614
86896
34049
6128...

output:

-1
-1
4660
4660
-1
2
4660
4660
4660
4660
-1
4660
-1
-1
78
4660
78
-1
4660
4660
4660
4660
-1
4660
-1
4660
4660
4660
4660
4660
-1
-1
4660
-1
4660
-1
-1
-1
4660
4660
2
4660
4660
-1
4660
2
58
4660
-1
-1
4660
4660
-1
4660
4660
2
4660
78
-1
-1
4660
-1
-1
-1
-1
4660
4660
-1
-1
4660
2
4660
4660
4660
-1
4660...

result:

ok 100 numbers

Test #23:

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

input:

100 8280
71879
23524
17600
51841
13733
36730
17103
75017
31999
35727
69190
72656
28447
9974
25960
69762
62416
76743
27773
46635
56719
54711
46264
46757
31392
53859
27856
31928
52586
70471
18092
25217
25832
12140
60872
71114
23369
17479
30580
70472
72974
35126
58879
31688
16559
17801
79266
52471
4044...

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
2
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
2
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
32
-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 100 numbers

Test #24:

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

input:

100 8633
60430
10480
80513
83117
67906
46501
32354
26204
49326
41990
50727
62145
81183
29273
55670
78867
75581
17937
81612
69528
83551
42551
50586
29030
61423
10770
26151
20132
55575
77777
66256
23652
69887
25681
36638
74155
26147
61308
50210
17265
46745
83050
11699
38357
80577
47044
44634
66132
705...

output:

2
-1
-1
-1
-1
-1
-1
-1
-1
-1
131
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
131
131
-1
2
-1
-1
-1
-1
-1
-1
-1
21
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
2
-1
-1
-1
-1
-1
-1
131
-1
-1
-1
-1
-1
-1
-1
-1
-1
21
-1
-1
-1
-1
43
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
131
-1
-1
-1
-1

result:

ok 100 numbers

Test #25:

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

input:

100 1875
15679
16586
6272
11545
14154
11282
15493
7847
18568
4598
8478
11768
16436
15352
9091
14374
13265
14897
14270
1920
14276
7011
6582
10208
8432
18251
5856
11275
10003
18124
14074
6642
7945
18271
4581
5518
9117
7164
9810
17960
12619
14093
17756
11327
8702
3496
15221
8502
10143
6183
5729
11911
2...

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
124
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
124
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
2
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
124
-1
-1

result:

ok 100 numbers

Test #26:

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

input:

100 359
443
2987
2153
3063
1307
1588
795
2153
2512
2591
524
2694
1893
2730
3485
1077
2807
3038
2904
2269
1773
1341
1482
717
2477
1831
900
985
1435
1076
3304
1045
1746
1076
1176
3563
2931
899
2084
1038
444
976
3379
1435
572
3234
2750
936
801
2601
2047
716
3270
866
1360
2022
379
3196
1804
963
3230
199...

output:

178
-1
2
-1
-1
178
178
2
2
178
-1
-1
-1
-1
-1
-1
-1
178
-1
-1
178
-1
-1
2
178
-1
-1
178
2
2
-1
178
178
2
-1
178
178
-1
-1
-1
-1
178
-1
2
178
-1
-1
178
178
-1
178
178
178
-1
-1
178
-1
-1
-1
-1
2
-1
2
2
-1
-1
178
2
-1
-1
178
2
-1
178
178
178
178
178
-1
178
-1
-1
-1
178
-1
2
-1
178
178
178
2
-1
178
-1
...

result:

ok 100 numbers

Test #27:

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

input:

100 6973
50532
67580
25240
33029
50583
10822
34495
41837
40773
40179
20901
49720
41837
44264
64287
64960
44010
28573
22717
52205
47391
29408
20424
26758
67060
32920
53581
47349
22979
46108
66098
25603
8976
8686
52270
20003
16149
65989
23187
66906
60114
18119
40683
67021
11027
22187
61716
25430
66530...

output:

-1
-1
2
-1
-1
-1
-1
2
-1
548
-1
-1
2
-1
-1
-1
-1
-1
182
-1
-1
548
182
-1
-1
182
-1
-1
-1
548
-1
548
182
548
-1
548
-1
-1
-1
-1
-1
182
-1
-1
-1
548
-1
-1
-1
-1
548
-1
-1
-1
-1
-1
-1
-1
2
-1
-1
-1
-1
-1
2
-1
-1
-1
-1
-1
182
-1
-1
182
182
60
-1
-1
-1
2
-1
-1
-1
-1
-1
-1
-1
182
-1
-1
-1
-1
-1
548
182
18...

result:

ok 100 numbers

Test #28:

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

input:

100 7489
11286
72696
34199
47402
53224
14096
64001
38566
44544
57454
74889
37269
26930
41362
41230
42424
43515
61221
68174
68262
35058
8030
20659
62087
14962
34368
62824
38218
64126
61521
25171
41679
44197
73007
18633
40348
39008
50920
37797
59911
28408
47024
23582
56987
63187
8393
70496
70084
52775...

output:

1247
143
1247
2
3743
1871
1871
233
1871
1247
2
1871
1247
3743
155
3743
3743
415
3
935
3743
3743
935
623
116
1247
3743
3
3743
103
11
3743
415
3743
3743
935
3743
467
15
2
3743
3743
-1
467
3743
935
935
1247
15
287
935
1247
51
415
3743
1247
2
1247
3743
3743
311
3743
3743
103
3743
935
1871
116
935
287
15...

result:

ok 100 numbers

Test #29:

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

input:

100 3937
10264
30561
27656
9016
17800
9056
36272
23767
32404
26071
18011
22166
24538
16184
26093
7872
30456
28053
4980
4713
13936
36679
31485
38397
10876
7132
4139
12467
33711
4044
22369
15590
11318
31818
33162
19412
19938
14040
27031
30100
8911
28719
9762
15544
19864
8586
36326
11811
12911
38335
30...

output:

-1
-1
-1
2
2
-1
-1
-1
-1
-1
-1
-1
104
-1
314
34
-1
-1
-1
-1
314
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
2
-1
-1
-1
-1
-1
-1
-1
-1
-1
20
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
2
104
2
-1
-1
20
-1
20
104
-1
-1
314
-1
-1
-1
2
62
-1
-1
-1
-1
-1
2
-1
-1
-1
-1
-1
-1
8
-1
-1
-1
-1

result:

ok 100 numbers

Subtask #5:

score: 11
Accepted

Dependency #1:

100%
Accepted

Dependency #2:

100%
Accepted

Dependency #3:

100%
Accepted

Dependency #4:

100%
Accepted

Test #30:

score: 11
Accepted
time: 287ms
memory: 3816kb

input:

100 870871
4340793
1243207
5051375
6213833
4858829
5468093
1895983
4716622
4329188
7326127
7032179
1732301
4515071
3496892
7006275
3559934
4552910
6966967
2034005
6050959
4863305
1122074
2063870
7741800
6492441
6966967
2658328
3291177
6528485
7290647
7692269
3278193
1657513
7526455
6977925
5565770
8...

output:

87086
435434
-1
435434
145144
-1
-1
-1
39584
435434
435434
435434
-1
145144
87086
-1
-1
2
-1
29028
87086
-1
29028
-1
4
2
145144
-1
87086
435434
87086
435434
-1
194
145144
435434
-1
-1
20734
87086
-1
-1
33494
435434
-1
-1
-1
7916
-1
145144
-1
6
435434
5004
-1
435434
-1
145144
-1
435434
145144
62204
-...

result:

ok 100 numbers

Test #31:

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

input:

100 496127
3431032
3472888
3945186
1493043
1496080
2441793
4340777
3969015
3564483
1909667
3969015
811931
947407
540410
1396895
4283602
2976761
3797658
1247618
3081930
580053
1373312
4608769
4696255
4062513
992253
3971185
4754046
4824823
696150
4447444
4554584
2420120
3472888
2394828
4542622
2480634...

output:

-1
2
-1
-1
-1
-1
248062
2
248062
248062
2
248062
-1
-1
248062
248062
2
248062
248062
248062
-1
248062
-1
-1
248062
2
248062
-1
248062
-1
248062
-1
248062
2
-1
-1
2
248062
-1
2
-1
248062
248062
248062
248062
248062
248062
248062
248062
-1
248062
248062
-1
-1
-1
248062
2
248062
2
248062
-1
-1
248062
2...

result:

ok 100 numbers

Test #32:

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

input:

100 425251
1736642
929887
1859381
1195224
3611852
1575702
1050696
1600241
2167711
2470461
3111388
3018847
2099864
2041919
1984318
2699726
3032971
3432337
2861462
446148
2156584
682413
3469229
765854
4183989
3192591
1264854
3623955
440986
2144858
2003321
3062898
2832430
4137778
1923175
630308
3257053...

output:

-1
212624
14174
212624
14174
-1
212624
42524
4724
42524
212624
70874
-1
70874
70874
-1
-1
2
212624
-1
2
-1
23624
30374
-1
-1
212624
4
-1
14174
3374
14174
-1
212624
3374
10124
-1
-1
4
70874
-1
-1
14174
70874
70874
-1
-1
-1
-1
224
-1
2
-1
-1
-1
-1
70874
8504
-1
30374
212624
-1
-1
-1
-1
14
374
212624
2...

result:

ok 100 numbers

Test #33:

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

input:

100 1000000
6597220
5049546
5930742
4317480
9218751
5992493
8915356
5754068
8218751
9546902
9182545
2941655
3951785
6639465
2999999
2253465
1218751
1644989
5864267
2077662
3566443
9176929
2533032
7218751
9066747
1157461
7555220
5200699
2599999
3410828
3888820
1004579
4947717
8284018
4768622
9253205
...

output:

-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
2
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
4
-1
-1
-1
-1
-1
-1
-1
2
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
2
-1
-1
-1
-1
-1
-1
3124
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
624
-1

result:

ok 100 numbers

Test #34:

score: 0
Accepted
time: 548ms
memory: 3788kb

input:

100 988027
1837394
3299469
1545726
9770903
3293092
1029808
2503299
4250480
5446768
1172665
6978730
5894487
9196883
9597179
8032599
1748490
9762707
6119585
7241459
4293190
7804961
3955271
8691374
4212647
9148268
4501023
5162890
2546971
9326753
6175001
9221254
3902797
8427257
8287677
2425264
9760871
2...

output:

-1
-1
-1
-1
-1
41084
-1
-1
-1
41084
41084
-1
-1
-1
-1
-1
41084
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
41084
-1
-1
-1
41084
2
2738
-1
-1
-1
41084
-1
-1
-1
-1
-1
-1
2
-1
41084
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
8216
-1
-1
2
41084
-1
8216
-1
-1
-1
-1
-1
-1
-1
41084
-1
-1
...

result:

ok 100 numbers

Test #35:

score: 0
Accepted
time: 435ms
memory: 3784kb

input:

100 768337
6170303
7683369
3030059
6891269
3261155
7072331
2789839
3073347
3399682
7532266
1947827
7428207
2800663
7642033
4063251
2136377
7273587
5442579
4682564
7528601
1347723
3741381
2064886
5105587
4205261
5035584
2650573
3097112
3867686
1583291
5647819
2011963
5723425
4467023
7372225
6990952
4...

output:

2936
2
-1
-1
-1
-1
-1
2
-1
21
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
3915
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
11747
-1
-1
-1
1067
-1
-1
-1
-1
-1
-1
2
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
3915
355
-1
88
11747
-1
-1
-1
-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 100 numbers

Test #36:

score: 0
Accepted
time: 26ms
memory: 3820kb

input:

100 41127
183500
402403
312225
293309
284980
64387
314722
61050
242933
377694
174978
125779
328862
54850
53065
236129
332135
273974
155158
189016
190589
95962
109704
311075
293405
151808
352098
175493
304394
76107
239147
371109
134874
271076
95986
202326
356435
110332
338524
393994
209517
333738
197...

output:

-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
3426
-1
-1
-1
-1
-1
-1
-1
3426
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
3426
-1
-1
-1
3426
-1
-1
-1
2
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
3426
-1
-1
-1
-1
-1
22
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
342...

result:

ok 100 numbers

Test #37:

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

input:

100 814811
4702891
8148109
7265719
2996892
1878042
5242279
6192048
1720249
3612657
921380
4074054
8138238
6387697
964450
4598391
6143799
6650496
7172748
6233339
1576510
7969074
5712340
4227149
3487165
5242654
3553929
5297156
4829431
4612306
5592093
1206536
1964012
6014474
5350872
7111504
8142765
538...

output:

-1
2
-1
-1
-1
-1
-1
-1
-1
-1
2
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
50306
-1
-1
2
-1
-1
16768
-1
-1
-1
16768
2
-1
-1
-1
-1
-1
-1
50306
-1
-1
50306
-1
-1
-1
-1
-1
-1
16768
-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 100 numbers

Test #38:

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

input:

100 980069
5031257
1623836
5606410
3171158
9198845
1292726
1595200
5160078
6883253
2202438
9206094
7360809
7991006
2839279
7840551
8122593
7457776
8258759
3045416
3721463
6781647
9099024
6897523
997549
2281818
6347842
9538642
1444442
8496247
1430979
1715406
1673856
7527227
8771540
4000844
5451366
74...

output:

245016
-1
245016
490033
490033
-1
490033
490033
88
245016
-1
-1
-1
490033
2
245016
-1
490033
490033
-1
490033
490033
245016
490033
490033
490033
-1
-1
245016
245016
490033
88
245016
-1
245016
-1
490033
490033
490033
245016
490033
490033
245016
245016
490033
490033
490033
2752
245016
245016
245016
55...

result:

ok 100 numbers

Test #39:

score: 0
Accepted
time: 286ms
memory: 3556kb

input:

100 482854
4480398
4711451
3356670
931320
496442
2741124
3260240
4621549
2271194
2626299
2369907
4023932
1923181
1262147
4203788
3106792
4815403
2389176
3807290
3438221
3709689
2659162
3055157
1448561
779444
3374692
3598884
1831598
4686446
2410188
3837985
3110321
2814793
3116595
3619038
3493594
1538...

output:

-1
1994
-1
-1
-1
-1
-1
-1
-1
1994
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
2
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
2
-1
1994
-1
-1
-1
2
-1
-1
-1
-1
-1
-1
-1
20
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
29924
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
299...

result:

ok 100 numbers

Subtask #6:

score: 0
Time Limit Exceeded

Dependency #1:

100%
Accepted

Dependency #2:

100%
Accepted

Dependency #3:

100%
Accepted

Dependency #4:

100%
Accepted

Dependency #5:

100%
Accepted

Test #40:

score: 0
Time Limit Exceeded

input:

1000 14804791
114016904
121184339
75210853
42958826
138955816
68574265
72970819
144709979
77262866
70792973
133638083
137672425
57493003
54397275
105847169
77366725
125834385
94267625
42694999
54812532
119224592
72719688
19168765
78672961
132656140
93972732
68588344
128284760
49714725
124752071
3731...

output:

7402394
7402394
-1
7916
4
2467464
-1
1057484
1057484
-1
224314
-1
1057484
-1
569414
-1
2467464
7402394
1057484
6
1057484
-1
-1
7402394
2467464
1057484
-1
569414
51764
-1
-1
7402394
-1
12
-1
-1
-1
-1
2467464
-1
7402394
2
211496
-1
569414
-1
-1
96134
-1
-1
2467464
224314
-1
-1
-1
-1
-1
1057484
376
464...

result:


Subtask #7:

score: 0
Skipped

Dependency #1:

100%
Accepted

Dependency #2:

100%
Accepted

Dependency #3:

100%
Accepted

Dependency #4:

100%
Accepted

Dependency #5:

100%
Accepted

Dependency #6:

0%

Subtask #8:

score: 0
Skipped

Dependency #1:

100%
Accepted

Dependency #2:

100%
Accepted

Dependency #3:

100%
Accepted

Dependency #4:

100%
Accepted

Dependency #5:

100%
Accepted

Dependency #6:

0%

Subtask #9:

score: 0
Skipped

Dependency #1:

100%
Accepted

Dependency #2:

100%
Accepted

Dependency #3:

100%
Accepted

Dependency #4:

100%
Accepted

Dependency #5:

100%
Accepted

Dependency #6:

0%

Subtask #10:

score: 0
Skipped

Dependency #1:

100%
Accepted

Dependency #2:

100%
Accepted

Dependency #3:

100%
Accepted

Dependency #4:

100%
Accepted

Dependency #5:

100%
Accepted

Dependency #6:

0%