QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#378086#5058. Prof. Pang Earning AusInfinityNSAC ✓246ms3952kbC++171.3kb2024-04-06 00:35:392024-04-06 00:35:39

Judging History

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

  • [2024-04-06 00:35:39]
  • 评测
  • 测评结果:AC
  • 用时:246ms
  • 内存:3952kb
  • [2024-04-06 00:35:39]
  • 提交

answer

#include<bits/stdc++.h>

#define f first
#define s second
#define ll long long
#define pb push_back
#define sz(x) (int)(x).size()
#define all(x) (x).begin(),(x).end()

using namespace std;

vector<ll> x(6);
vector<int> n(2),k(6);
ll ans;
void pok(){
    x[0]=(n[0]-x[5]*k[5])/k[0];
    if(x[0]<0)return;
    x[1]=x[0]*k[0]+x[5]*k[5]-x[4];
    if(x[1]<0)return;
    x[2]=(n[1]-x[4]*k[4])/k[2];
    if(x[2]<0)return;
    x[3]=x[2]*k[2]+x[4]*k[4]-x[5];
    if(x[3]<0)return;
    if(x[0]==0&&x[2]==0)return;
    if(x[1]+x[4]>n[0])return;
    if(x[3]+x[5]>n[1])return;
    ans=max(ans,x[1]*k[1]+x[3]*k[3]-x[0]-x[2]);
}
vector<int> x4,x5;
void test(){
    for(int i=0;i<2;i++){
        scanf("%i",&n[i]);
    }
    for(int i=0;i<6;i++){
        scanf("%i",&k[i]);
    }
    ans=0;
    const int L=100;
    x4.clear();
    x5.clear();
    for(x[4]=0;x[4]<=L;x[4]++)x4.pb(x[4]);
    for(x[5]=0;x[5]<=L;x[5]++)x5.pb(x[5]);
    int mx4=min(n[1]/k[4],n[0]),mx5=min(n[0]/k[5],n[1]);
    for(x[4]=mx4;x[4]>=0&&mx4-x[4]<=L;x[4]--)x4.pb(x[4]);
    for(x[5]=mx5;x[5]>=0&&mx5-x[5]<=L;x[5]--)x5.pb(x[5]);
    for(auto p:x4)for(auto q:x5){
        x[4]=p;
        x[5]=q;
        pok();
    }
    printf("%lld\n",ans+1);
}

int main(){
    int t;
    scanf("%i",&t);
    while(t--){
        test();
    }
}

Details

Tip: Click on the bar to expand more detailed information

Test #1:

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

input:

6
2 2 2 2 2 2 2 2
78 74 5 3 10 2 4 7
31 75 3 6 6 1 8 4
91 86 4 2 9 5 8 5
48 89 3 9 2 3 5 7
13 25 5 7 6 1 2 4

output:

7
355
239
571
637
109

result:

ok 6 numbers

Test #2:

score: 0
Accepted
time: 32ms
memory: 3948kb

input:

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

output:

111
46
64
90
66
37
1
1
63
101
30
17
50
22
54
40
1
29
1
21
38
50
1
9
55
21
11
1
104
61
4
81
1
119
74
6
17
16
13
20
56
46
33
20
42
1
96
21
40
46
39
47
4
61
5
81
111
27
18
1
1
32
4
1
30
133
1
89
51
34
29
1
53
15
34
45
1
32
1
25
55
120
23
22
20
57
19
108
24
1
20
1
52
40
41
15
9
1
1
15
35
104
1
43
84
15
...

result:

ok 1000 numbers

Test #3:

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

input:

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

output:

87
20
79
1
31
78
41
40
36
18
61
68
16
83
56
41
63
48
26
57
1
1
16
105
99
70
40
55
53
22
1
30
71
50
49
1
1
1
45
59
55
123
22
1
58
16
1
37
23
54
50
41
68
61
47
108
24
54
40
70
24
42
6
64
13
17
21
1
91
28
59
61
1
52
103
66
54
1
114
58
1
49
10
61
1
66
1
1
29
60
1
32
21
5
55
121
87
99
1
128
1
5
1
1
5
81
...

result:

ok 1000 numbers

Test #4:

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

input:

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

output:

18
17
1
48
87
32
1
47
15
36
1
52
61
40
16
60
1
1
1
50
1
58
1
35
35
25
130
17
44
96
1
41
1
14
12
24
8
23
1
40
1
70
16
37
43
35
37
28
71
67
25
1
22
76
32
106
41
90
1
30
1
1
16
74
60
1
30
45
14
19
63
12
50
16
29
75
84
15
40
54
13
25
10
1
59
63
16
51
87
1
40
58
26
14
7
16
70
13
1
109
1
32
1
84
58
80
45
...

result:

ok 1000 numbers

Test #5:

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

input:

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

output:

31
6
3
41
60
12
1
55
80
69
11
81
96
48
18
49
13
48
39
62
53
24
1
40
3
21
74
52
8
104
1
1
29
13
99
1
92
1
31
1
1
74
5
85
49
74
1
16
16
20
32
63
50
1
44
56
86
1
1
60
14
96
32
25
16
74
1
44
13
24
1
12
47
55
5
3
45
111
89
8
41
16
18
81
77
35
5
98
1
10
5
1
90
1
56
5
1
1
78
110
23
1
19
69
1
1
44
51
15
23
...

result:

ok 1000 numbers

Test #6:

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

input:

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

output:

1
32
52
91
41
96
25
1
75
45
40
1
16
5
32
47
8
55
90
45
62
16
58
1
94
33
16
49
52
12
75
16
45
48
76
19
1
57
15
11
1
56
1
36
15
26
1
73
1
1
1
32
28
40
21
24
51
28
56
56
30
46
24
1
27
42
1
77
3
5
1
91
1
21
105
1
1
72
35
1
26
55
24
80
15
53
85
11
82
42
1
30
1
76
34
13
11
64
72
25
1
1
50
84
1
81
1
63
80
...

result:

ok 1000 numbers

Test #7:

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

input:

1000
69 13 3 9 1 9 9 9
68 27 3 8 9 3 10 9
9 6 2 7 2 2 9 3
99 70 3 9 8 5 6 4
50 49 1 2 4 1 2 9
4 7 8 5 9 1 9 9
72 78 7 2 5 8 7 5
13 3 5 9 1 9 4 4
19 62 10 6 2 1 6 7
56 17 9 2 5 10 10 1
52 5 3 7 9 5 4 5
16 26 9 6 2 10 8 10
65 58 2 9 9 7 4 5
68 86 8 4 1 3 8 2
67 94 10 10 2 3 9 8
42 92 7 3 9 10 5 1
63 8...

output:

703
585
68
1192
127
1
737
123
132
250
354
301
940
471
885
1021
630
706
435
288
144
169
179
340
433
1122
810
533
1001
294
29
334
149
457
433
205
846
469
372
356
730
121
177
469
879
38
866
800
823
910
1225
1050
172
411
123
989
452
104
892
49
502
186
662
427
392
403
963
751
1201
822
553
286
120
40
686
...

result:

ok 1000 numbers

Test #8:

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

input:

1000
14 41 7 9 5 7 4 3
50 83 5 2 7 1 3 6
63 32 4 6 1 4 6 2
7 27 4 10 4 6 4 4
83 52 9 4 8 6 4 7
18 12 3 3 6 8 10 9
39 92 10 4 8 9 9 9
26 90 10 7 2 6 9 6
77 93 9 6 3 7 5 7
60 36 6 2 1 7 7 5
8 51 1 6 2 3 6 6
30 76 9 5 3 5 7 4
12 74 6 7 4 1 5 8
34 100 1 10 8 5 3 6
18 62 8 4 4 6 10 7
20 97 1 7 5 10 3 6
7...

output:

397
160
450
178
618
143
950
670
1062
352
169
486
137
785
418
1052
600
588
693
47
689
1196
988
246
769
487
569
725
192
67
183
587
859
296
1413
137
420
835
997
185
779
547
479
357
601
819
649
279
1231
581
435
282
1095
600
441
250
95
580
163
280
653
350
556
391
550
493
177
743
1408
246
1001
223
308
443...

result:

ok 1000 numbers

Test #9:

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

input:

1000
62 61 5 10 6 4 7 5
28 38 5 6 8 4 8 9
26 50 2 1 1 2 5 5
24 84 5 7 10 6 6 9
27 39 2 10 4 10 7 4
37 1 8 8 4 2 8 3
98 10 4 7 3 7 5 8
47 80 3 6 5 9 8 8
42 29 6 10 6 5 3 10
75 59 6 2 1 10 10 1
60 2 8 10 7 10 10 8
53 25 7 1 4 10 6 9
64 83 2 1 8 6 6 3
4 22 10 3 2 6 7 5
81 34 2 5 3 4 4 1
5 3 5 7 1 1 9 6...

output:

819
283
106
632
620
253
709
965
535
704
554
279
514
122
483
35
1526
403
515
213
784
174
388
482
453
134
180
400
243
354
667
641
433
1008
395
456
637
181
743
597
447
62
306
594
760
52
1126
676
848
584
866
168
233
413
306
345
566
135
978
1018
807
27
539
529
191
825
121
427
463
38
726
100
103
61
310
22...

result:

ok 1000 numbers

Test #10:

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

input:

1000
2 89 10 8 6 7 7 3
10 93 4 5 2 5 1 6
72 73 5 10 10 9 1 4
32 45 2 3 1 2 2 9
59 26 7 8 8 1 5 5
51 93 5 6 1 9 2 3
60 28 8 3 2 7 1 2
72 71 8 10 5 2 3 1
7 60 1 7 4 9 6 6
87 74 1 2 7 7 9 9
20 57 4 10 8 2 1 5
80 75 5 8 1 5 6 5
15 91 6 8 1 4 1 10
66 37 1 2 9 1 6 10
43 6 10 6 5 1 3 7
91 8 3 10 8 5 3 4
21...

output:

575
459
1310
131
485
1035
344
838
568
612
301
925
368
153
246
916
684
466
848
937
1217
739
822
648
299
120
386
427
155
778
276
337
469
547
581
842
484
407
784
769
776
1257
434
733
326
545
51
80
891
821
337
665
386
610
96
941
276
470
381
682
526
403
212
556
229
181
760
323
1234
504
604
856
406
405
33...

result:

ok 1000 numbers

Test #11:

score: 0
Accepted
time: 46ms
memory: 3948kb

input:

1000
55 13 4 10 7 6 6 1
97 53 8 7 2 8 6 3
34 87 3 4 9 1 10 10
48 2 4 4 9 1 10 1
96 17 6 8 7 8 6 3
62 98 8 1 4 9 9 7
23 42 5 1 2 6 7 6
93 58 5 6 8 5 8 3
61 83 6 7 5 3 5 2
95 90 7 6 9 4 2 5
68 99 4 4 1 6 3 5
98 33 5 10 5 8 3 7
66 7 8 2 2 4 2 1
36 51 9 9 3 3 10 1
94 70 6 1 8 1 9 2
84 1 6 10 8 9 3 9
44 ...

output:

587
1051
201
181
863
920
263
809
635
895
751
1193
142
457
140
827
1063
407
518
1272
519
357
147
187
372
441
246
578
45
244
805
619
408
277
922
607
306
382
867
822
1113
313
729
368
575
239
90
397
339
1142
142
346
856
443
153
756
106
276
1444
680
417
330
636
655
251
210
68
1012
747
639
197
465
566
460...

result:

ok 1000 numbers

Test #12:

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

input:

1000
39 23 85 46 97 72 41 70
18 37 8 40 33 61 12 79
78 51 61 66 85 97 78 14
47 70 100 40 15 40 61 52
30 19 14 91 82 56 10 6
24 68 97 61 31 78 18 45
6 88 37 38 51 86 37 42
30 58 79 56 50 14 61 18
20 13 57 3 93 15 24 74
21 32 71 93 2 66 25 75
10 75 86 82 30 31 6 49
33 15 100 35 1 96 87 83
21 29 41 22 ...

output:

1
2715
4026
2397
3016
4835
4386
1694
1
2097
1859
1426
1
7041
1505
1
4590
1546
1401
820
5550
5859
4620
3697
6800
3630
1847
6268
1509
2824
6437
475
5579
1990
5975
1
4231
3261
5602
945
6738
4917
1664
4797
8042
8001
2935
4344
6903
2413
11118
5980
2400
5695
12269
4401
5551
2515
3795
1110
2077
1
9290
704
...

result:

ok 1000 numbers

Test #13:

score: 0
Accepted
time: 34ms
memory: 3884kb

input:

1000
79 47 39 24 51 37 29 54
100 96 48 80 32 98 27 88
36 73 79 11 33 78 87 94
55 27 21 1 24 6 83 27
66 7 27 91 12 35 43 17
46 57 78 19 20 61 29 89
73 6 51 82 48 14 33 81
51 37 34 64 57 19 1 96
81 49 34 27 84 49 72 56
37 47 50 23 58 53 78 82
66 25 13 10 61 3 73 96
59 64 38 48 12 61 96 81
80 37 83 39 ...

output:

2920
17084
5147
186
4913
2439
4182
2176
1835
1
646
5479
2209
1
7830
4800
1262
918
5449
3438
5406
1
5049
5161
1
1
1
2109
2807
594
1
1
1
1
1
910
8737
4127
4008
1870
2944
1
2631
1980
1
1
1922
6072
5624
2806
1
1
1062
6557
1285
2296
5640
944
996
5572
3076
1
1
5289
1291
3451
1
4487
9088
1562
3680
1
10031
...

result:

ok 1000 numbers

Test #14:

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

input:

1000
23 71 84 98 8 14 4 42
83 56 87 28 22 32 50 5
90 96 1 59 74 56 96 77
71 88 38 62 36 85 1 97
98 98 32 99 42 6 81 20
57 49 71 66 9 45 41 29
32 28 68 38 29 35 29 19
76 27 85 68 68 41 32 78
38 72 19 55 83 83 25 46
48 62 26 53 14 39 31 94
22 84 39 34 96 63 37 42
78 6 76 64 16 26 6 79
24 53 29 63 87 8...

output:

889
3135
10559
8842
10004
3890
1
1
6129
3690
1
4956
1
6654
3050
2888
949
1
1
1
1
5541
6972
1
1
2523
4179
8533
2204
1
1
1
1
4783
955
1
5925
1
6731
4800
2431
8418
266
716
7354
4343
2867
296
11799
767
4890
1
6541
1
10699
3129
1
4866
1293
1972
180
5581
1
5549
5346
1
12387
2254
269
2112
7567
3239
7896
62...

result:

ok 1000 numbers

Test #15:

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

input:

1000
72 95 38 75 62 87 87 30
65 11 35 75 16 73 65 23
48 18 19 4 22 42 14 60
83 49 59 15 60 51 27 80
35 97 37 100 64 81 22 38
71 54 52 20 5 20 52 73
98 42 78 86 26 55 25 57
97 14 36 81 71 54 71 51
4 3 8 74 82 21 74 29
52 81 1 87 75 22 76 2
79 27 73 61 39 39 9 89
1 60 14 77 27 87 11 70
75 61 63 75 64 ...

output:

12507
2625
735
2247
5184
2060
8137
5831
1
6122
5323
4697
8143
4094
1
2457
81
2508
1
1
893
1
478
3873
4921
2373
8787
4782
4439
2843
4444
2120
2775
3255
9463
1
1
1
940
1
1961
4836
1
912
1
5607
1240
1
3118
2960
1
1474
4951
1
2306
4066
1175
1
1
1
5536
5951
6389
1618
1
3588
3590
394
8463
6623
2677
400
13...

result:

ok 1000 numbers

Test #16:

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

input:

1000
20 23 87 49 15 59 70 18
47 67 79 19 7 6 88 40
7 33 37 45 75 16 19 43
96 6 77 79 69 21 54 46
67 84 49 4 97 52 60 45
90 47 33 79 94 4 64 13
57 56 96 33 7 83 17 92
18 5 83 93 87 63 10 33
65 38 85 98 73 47 19 15
64 92 72 18 23 9 33 18
35 81 100 85 70 7 85 35
19 9 44 89 34 48 20 64
26 70 5 95 33 30 ...

output:

1708
1124
1
6083
3312
5213
4641
1
1
1770
3458
1
4349
2650
2937
4368
5500
2280
1709
1
1
11976
1
4782
1
6802
5569
8975
1749
5685
2069
8048
1
6257
4174
5641
660
575
3188
2269
1
3331
1
2517
7998
560
419
6958
2007
480
4140
7487
6064
1
5836
1
1
2069
4879
768
1
1
6881
2272
4759
3837
4176
1
4494
946
11293
8...

result:

ok 1000 numbers

Test #17:

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

input:

1000
861134582 257942979 13 18 40 71 22 17
66130593 958022679 33 31 85 57 22 20
39736426 996932957 81 50 77 49 43 66
148797691 302372310 47 77 20 69 93 12
483105085 237881347 90 24 67 18 34 15
107634264 767520421 53 58 4 46 11 17
616215478 270289085 16 26 23 4 16 38
62831871 515949964 60 22 33 62 99...

output:

33741683780
56644065827
50823097612
32302826354
15867467272
41354815171
17052493569
33354515580
71094661108
53806190395
73940098129
65883252209
8017507053
58334986219
34534952947
6940773139
83181773918
23827149676
6619300902
46216983836
42736835603
70648509216
43831989775
81512172522
22365137194
436...

result:

ok 1000 numbers

Test #18:

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

input:

1000
434683426 436026403 62 100 98 36 97 5
348434775 178956835 76 70 80 98 45 37
44240881 425404872 99 91 22 27 52 41
724140604 29718871 68 42 28 39 19 94
145048517 787223639 99 21 89 93 72 26
101219675 228993418 38 8 5 33 18 57
917968136 543755511 30 74 12 28 16 76
698878492 756291555 19 26 41 79 3...

output:

59153832801
41921381056
15492067634
31561230400
76247506672
8318077752
83078884112
77862644089
27834534225
110565082647
37658694450
23625578730
14085847094
31376377518
22573750423
36673754337
5172257720
34774079756
48529945044
39953323064
7171098662
26953079779
43835958974
41104073066
17206750074
61...

result:

ok 1000 numbers

Test #19:

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

input:

1000
8232270 319142531 16 78 59 13 80 93
335771661 104923694 16 22 70 27 68 46
198488439 708652594 17 43 70 16 61 24
594450812 52032728 85 95 49 10 37 61
512024654 486309034 100 29 19 60 5 37
799837789 840209519 23 63 93 9 34 1
74496603 257413425 43 22 97 44 12 19
334925113 996633145 70 42 52 88 70 ...

output:

4785046067
10197431509
19851644714
56985098493
43996541047
57907855989
12960729368
101746620155
81320565219
34499206766
51214279631
27884410899
57625527566
19140816912
32990827160
21850363076
80280690204
15436789147
57769857232
36467502472
68639672006
17409939480
50374438953
2162912483
39717409884
8...

result:

ok 1000 numbers

Test #20:

score: 0
Accepted
time: 245ms
memory: 3772kb

input:

1000
581781115 497225955 62 59 9 90 56 81
913043140 30890554 52 62 56 68 83 63
202992893 137124509 39 84 19 94 79 3
169793724 74346585 6 56 65 76 64 39
173968086 330618621 13 29 48 35 47 47
648199008 891617108 8 17 90 96 41 41
376249262 676104043 57 73 91 77 8 53
970971734 677166224 17 51 55 6 9 37
...

output:

79010790374
58691121563
29928683191
15129344882
16596455972
96523693481
79512174981
53513127623
152933326885
6384202532
22620579645
59872519353
63962882259
40357609065
28936662653
54949915936
112843507119
8654736734
55803317636
29450660750
125253594579
106044165057
101258812896
59632530115
272515700...

result:

ok 1000 numbers

Test #21:

score: 0
Accepted
time: 245ms
memory: 3880kb

input:

1000
10105767 675309379 19 29 63 55 43 69
195347322 251824709 3 9 59 2 2 80
357240451 420372231 58 37 59 68 88 87
599912444 96660442 27 8 81 42 94 10
540944222 584993616 25 37 82 10 84 62
346817122 207865912 85 76 79 76 53 85
532777729 94794661 75 25 76 93 4 91
312051059 917507815 72 55 59 11 44 10
...

output:

37423831455
2252623358
41789923594
8835625590
25836100093
42149195902
22126995430
27235508717
9332852363
37497660439
56939681463
35539830184
132789012880
37734327046
43776398382
113013554683
65451337447
11811871196
60559250919
45072898478
14773588150
14428793546
16203758507
15538012070
52137043378
5...

result:

ok 1000 numbers

Test #22:

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

input:

1000
878621908 853392803 69 11 24 32 14 57
182684208 472758865 43 49 49 43 21 97
656712201 258909554 80 82 8 46 97 66
470222653 824007003 44 69 94 13 8 88
202887655 284079011 22 33 8 81 22 73
45435237 964306205 78 30 67 60 65 25
834530387 663228383 93 69 69 25 97 22
948097680 157849406 27 67 74 32 8...

output:

36925118821
29266260049
65719666897
43137998967
29660960194
59206454041
74144720373
68536477341
62584344177
90641634668
68519558782
42218906529
66168712836
3088873227
12927578598
96912967787
61919940041
78900483658
105734251143
57032029434
48841065138
34992124072
24250995740
127152540772
35361318446...

result:

ok 1000 numbers

Test #23:

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

input:

1000
452170752 736508931 23 88 78 8 2 45
464988390 398725724 86 93 39 72 40 18
810959760 542157276 2 22 60 31 7 41
340532861 846320860 70 30 6 91 34 58
864831087 128388598 35 45 42 56 60 83
893796455 720746498 63 84 68 47 84 65
286026150 81919001 10 25 54 42 93 60
584144301 693158293 74 75 77 37 14 ...

output:

45653995473
71936539262
34233474302
87085265505
46079393298
108929200201
10561131903
69440778122
78842217740
124317363588
21912192159
30508868050
28381225629
63681935732
132064440018
142507526182
59977079077
16048212877
26288747144
79002801759
12689457536
60880587341
10866400194
71271835700
58072745...

result:

ok 1000 numbers

Test #24:

score: 0
Accepted
time: 242ms
memory: 3880kb

input:

1000
25719596 914592355 76 62 39 73 85 37
42259869 619659879 26 40 33 13 59 27
815464214 825404999 20 75 1 13 24 24
65618877 573667421 87 87 26 61 52 37
381550327 677730889 44 41 75 31 97 94
592414570 36995303 44 43 57 23 96 9
292811513 795576915 24 73 44 74 89 94
220190922 933499883 29 79 89 50 53 ...

output:

68336066043
9725570018
71023902643
40679734760
36635512321
26310605126
80217648401
64051994424
34240251494
36855527588
16418699521
48567931674
5733165670
81607425402
20142333441
61888811982
11652042184
66643908464
36769280929
137899614926
15490712046
13504444252
38579852122
32321570210
11184074132
7...

result:

ok 1000 numbers

Test #25:

score: 0
Accepted
time: 245ms
memory: 3756kb

input:

1000
599268441 92675779 26 43 89 54 60 21
29596755 695369843 66 84 24 43 78 45
674744476 253876913 42 16 49 91 33 7
640961789 301013982 8 44 39 27 78 3
748526464 376816284 57 50 1 6 35 5
440775788 88402892 33 89 46 10 7 49
744307275 214267533 34 20 33 94 81 29
856237543 173841474 76 92 92 71 92 30
6...

output:

30748943660
32357608153
33877463478
36241857343
39297272495
40097795231
34998908782
91103440654
51924005197
39467695738
45331302629
23609017413
92707536190
112578572347
14889349398
72777197985
8754869686
46669711470
65297536520
48479090825
85191855893
75238176950
70766621137
18249204429
24179113311
...

result:

ok 1000 numbers

Test #26:

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

input:

1000
97551525 2768727 10 99 41 87 89 34
304851948 784414356 34 41 44 68 96 75
940317363 665014056 23 38 1 2 53 76
304629550 767013120 68 17 24 27 98 16
953288402 42792778 60 70 14 12 100 78
776815701 645168241 12 80 57 42 44 33
941316011 498027043 31 32 10 29 43 56
974462984 434679629 44 80 69 43 33...

output:

9888656615
65812311842
36560540155
25851617736
67224756570
89166268613
44484728781
96619815238
32715443587
7499177773
65755288781
72896613055
105053556546
90456041298
59148945658
37673985768
22842484663
7915035135
18836035941
72404821725
4546594314
108702352665
77661639040
67155495586
25175759546
62...

result:

ok 1000 numbers