QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#312041#5146. Skillsucup-team1137AC ✓379ms4772kbC++172.7kb2024-01-23 11:20:432024-01-23 11:20:43

Details

Tip: Click on the bar to expand more detailed information

Test #1:

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

input:

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

output:

26
41

result:

ok 2 number(s): "26 41"

Test #2:

score: 0
Accepted
time: 39ms
memory: 4636kb

input:

1
200
6219 3608 2383
1139 2158 8611
6721 8216 8887
8736 6707 9755
7210 248 167
3849 276 8050
971 5062 1914
8290 1562 6017
8993 7990 3460
6323 6099 757
7652 4740 6117
6560 4206 180
3705 8906 5752
9619 8939 9696
793 6680 1777
384 3606 8772
9258 3906 709
4396 5083 6614
6057 4410 3132
8596 825 7437
6098...

output:

1505431

result:

ok 1 number(s): "1505431"

Test #3:

score: 0
Accepted
time: 39ms
memory: 4636kb

input:

1
200
7577 2771 7429
8435 7489 1440
1929 8819 818
7849 8462 8761
3344 5938 3673
9434 8897 6486
4668 636 8139
4777 3305 4238
4221 3326 639
3879 7469 1590
6370 9514 4307
6243 3301 8122
4967 184 9327
6142 1710 399
6814 9296 6270
5663 3564 5442
8315 1295 869
2635 7975 4837
9613 9439 4012
6660 1861 368
8...

output:

1497632

result:

ok 1 number(s): "1497632"

Test #4:

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

input:

1
300
0 10000 0
0 10000 0
0 10000 0
10000 0 0
0 0 10000
10000 0 0
0 0 10000
10000 0 0
0 0 10000
10000 0 0
0 0 10000
10000 0 0
0 0 10000
10000 0 0
0 0 10000
10000 0 0
0 0 10000
10000 0 0
0 0 10000
10000 0 0
0 0 10000
10000 0 0
0 0 10000
10000 0 0
0 0 10000
10000 0 0
0 0 10000
10000 0 0
0 0 10000
1000...

output:

2975228

result:

ok 1 number(s): "2975228"

Test #5:

score: 0
Accepted
time: 153ms
memory: 4656kb

input:

1
500
10000 0 0
10000 0 0
10000 0 0
0 10000 0
0 0 10000
0 10000 0
0 0 10000
0 10000 0
0 0 10000
0 10000 0
0 0 10000
0 10000 0
0 0 10000
0 10000 0
0 0 10000
0 10000 0
0 0 10000
0 10000 0
0 0 10000
0 10000 0
0 0 10000
0 10000 0
0 0 10000
0 10000 0
0 0 10000
0 10000 0
0 0 10000
0 10000 0
0 0 10000
0 10...

output:

4955301

result:

ok 1 number(s): "4955301"

Test #6:

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

input:

20
10
6219 3608 2383
1139 2158 8611
6721 8216 8887
8736 6707 9755
7210 248 167
3849 276 8050
971 5062 1914
8290 1562 6017
8993 7990 3460
0 0 0
10
7652 4740 6117
6560 4206 180
3705 8906 5752
9619 8939 9696
793 6680 1777
384 3606 8772
9258 3906 709
4396 5083 6614
6057 4410 3132
1 0 0
10
6098 4958 7691...

output:

71054
70167
68631
74395
65914
65051
62880
65098
62727
71034
64500
71945
54364
66298
74354
70243
65959
78873
58698
72175

result:

ok 20 numbers

Test #7:

score: 0
Accepted
time: 114ms
memory: 4640kb

input:

10
100
6477 7917 2869
3623 818 611
7204 100 8682
4362 969 2510
6908 984 5181
2260 1731 6628
4216 5142 96
2604 5754 1992
2495 6672 7175
2278 7381 2075
1083 8778 9329
7535 4274 7337
8259 7742 6826
2873 2891 7320
2082 1988 6680
3674 1820 6637
2634 2964 5548
9745 2848 1275
2120 8514 4029
4256 692 7567
1...

output:

754578
728471
732747
758719
749241
761073
730494
756306
758915
732583

result:

ok 10 numbers

Test #8:

score: 0
Accepted
time: 317ms
memory: 4768kb

input:

2
500
8487 2637 3423
692 627 5666
87 6242 9920
1603 3997 7168
3038 8194 4174
4170 4094 4270
8111 680 3974
7191 3780 9484
8222 3973 9422
3202 2613 6381
3555 8378 4605
9207 3035 9493
4615 6623 2865
370 5620 2590
1426 1407 2360
6168 1634 6195
7107 2847 9756
9348 2785 1270
1202 8847 7473
9872 4547 4904
...

output:

3783170
3641473

result:

ok 2 number(s): "3783170 3641473"

Test #9:

score: 0
Accepted
time: 358ms
memory: 4580kb

input:

1
1000
2436 2493 6048
2415 2847 3401
4000 8444 8174
286 1596 9946
4482 92 4023
3285 9065 5969
1319 7918 5651
5422 9158 4362
2990 8014 5657
2640 3851 6258
3504 5431 9522
7128 4980 9585
8784 1719 6032
4035 9446 1840
2646 7045 9738
1432 6172 5430
7667 1619 5145
2065 3899 1069
105 1751 8728
3615 8641 12...

output:

7542174

result:

ok 1 number(s): "7542174"

Test #10:

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

input:

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

output:

75
67
70
62
68
72
61
58
66
59
65
61
77
65
63
84
71
72
79
74
67
57
81
72
51
63
66
71
80
73
73
72
79
68
71
61
62
71
60
64
67
60
73
69
60
58
62
72
62
69
65
59
59
70
61
70
55
66
83
76
79
74
58
62
75
67
68
61
56
68
70
69
52
71
66
69
72
65
66
69
67
71
70
73
62
83
77
68
68
72
64
66
71
68
66
67
64
68
70
57

result:

ok 100 numbers

Test #11:

score: 0
Accepted
time: 87ms
memory: 4660kb

input:

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

output:

585
625
580
595
574
577
628
591
584
553

result:

ok 10 numbers

Test #12:

score: 0
Accepted
time: 111ms
memory: 4716kb

input:

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

output:

5684

result:

ok 1 number(s): "5684"

Test #13:

score: 0
Accepted
time: 115ms
memory: 4680kb

input:

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

output:

5679

result:

ok 1 number(s): "5679"

Test #14:

score: 0
Accepted
time: 85ms
memory: 4768kb

input:

100
10
49 100 47
38 56 2
98 94 98
7 94 61
32 13 28
5 52 55
48 37 32
88 47 60
92 65 78
84 52 43
10
16 98 73
24 68 67
90 34 77
99 77 2
57 67 44
62 32 27
48 23 92
96 41 1
8 94 100
77 99 67
10
2 18 84
41 64 67
29 10 53
86 4 86
63 14 98
41 97 30
43 17 59
34 55 54
51 8 91
62 12 12
10
38 94 36
28 70 76
69 ...

output:

730
851
745
780
782
842
618
683
708
577
722
593
750
728
754
755
742
750
786
763
679
817
782
693
698
743
793
690
666
667
729
750
742
823
771
582
698
776
750
693
702
709
823
760
758
763
703
726
752
726
775
692
738
763
671
675
808
714
660
882
574
767
633
712
629
770
580
868
741
722
698
610
827
831
764
...

result:

ok 100 numbers

Test #15:

score: 0
Accepted
time: 110ms
memory: 4696kb

input:

10
100
56 5 3
53 50 67
9 87 91
62 16 99
4 23 37
100 53 3
26 65 45
54 50 45
96 32 12
75 36 87
84 90 82
11 26 82
85 30 34
18 61 16
78 37 63
25 48 100
29 9 1
70 78 63
96 17 17
21 8 31
32 80 37
19 43 94
1 72 91
41 29 88
36 9 92
62 26 53
7 31 51
45 31 30
26 56 3
79 29 81
24 78 83
75 20 26
33 89 88
74 49 ...

output:

7048
6895
6967
7456
7139
6832
7073
7103
7061
7320

result:

ok 10 numbers

Test #16:

score: 0
Accepted
time: 329ms
memory: 4724kb

input:

1
1000
31 65 22
86 22 84
74 56 61
13 39 66
44 28 26
51 12 94
10 97 96
77 56 88
55 99 90
14 54 22
48 4 50
68 57 58
3 92 67
97 64 66
47 82 79
5 33 99
1 6 75
11 53 85
33 27 21
19 34 45
15 91 68
19 96 43
63 28 9
60 64 2
36 65 49
34 21 10
76 13 21
81 5 61
36 67 50
79 75 29
83 71 43
43 14 84
99 24 31
24 1...

output:

70671

result:

ok 1 number(s): "70671"

Test #17:

score: 0
Accepted
time: 330ms
memory: 4728kb

input:

1
1000
1 8 60
87 41 26
82 7 50
30 78 59
50 95 45
95 43 17
25 22 39
79 74 72
52 66 60
4 42 26
7 6 51
60 63 23
18 4 45
77 8 38
12 48 33
38 41 76
75 64 70
22 6 39
47 81 4
51 26 17
49 98 9
81 30 58
34 64 6
12 63 50
17 98 60
35 70 47
25 9 25
46 40 55
35 82 86
7 82 90
4 42 16
64 91 55
9 73 37
91 15 18
15 ...

output:

70464

result:

ok 1 number(s): "70464"

Test #18:

score: 0
Accepted
time: 84ms
memory: 4604kb

input:

100
10
567 549 180
378 304 404
713 155 146
626 973 550
260 267 809
969 790 465
282 894 166
183 190 825
333 707 89
529 774 109
10
582 307 157
483 991 426
798 608 331
218 722 705
581 310 658
758 663 403
259 761 803
951 779 914
380 31 355
550 974 387
10
104 296 744
869 837 242
427 917 665
675 532 677
7...

output:

7608
7588
8034
8041
6447
7253
6284
7236
7289
8331
8289
8479
8159
7235
6640
7954
7070
6180
6525
7743
8260
7605
6882
8383
8108
7737
7509
7886
7025
7771
7642
7537
8014
7161
7253
7542
6950
6369
7881
8610
7600
6969
7597
7439
8353
8119
7864
7201
7242
6632
8465
7988
7214
7127
7878
6494
7166
8021
7396
7089
...

result:

ok 100 numbers

Test #19:

score: 0
Accepted
time: 111ms
memory: 4728kb

input:

10
100
414 507 470
599 542 465
48 703 663
967 925 69
584 905 953
798 121 737
757 639 194
410 626 410
643 29 717
126 999 429
354 512 458
358 867 973
988 26 644
309 485 911
746 271 904
5 533 756
758 144 130
831 276 565
496 911 67
685 684 908
258 379 841
814 538 361
413 837 294
680 136 154
257 202 189
...

output:

72994
75836
76140
77142
76839
76806
72450
76183
74222
73746

result:

ok 10 numbers

Test #20:

score: 0
Accepted
time: 359ms
memory: 4660kb

input:

1
1000
958 541 691
873 997 300
776 109 218
118 500 271
10 29 653
16 132 34
175 916 517
145 880 526
429 373 893
97 152 459
71 199 696
336 106 482
991 539 421
317 928 578
11 943 216
990 218 802
566 818 28
649 807 223
433 256 615
883 407 359
58 143 597
696 611 37
4 521 976
907 976 279
240 275 111
552 6...

output:

741081

result:

ok 1 number(s): "741081"

Test #21:

score: 0
Accepted
time: 352ms
memory: 4588kb

input:

1
1000
126 711 113
600 592 58
831 960 968
541 820 508
76 543 290
294 67 80
864 311 98
178 607 366
573 890 923
832 265 519
52 301 173
289 483 893
69 565 785
595 315 124
446 538 399
764 769 319
703 411 260
990 820 311
446 659 528
358 921 433
511 180 584
402 516 694
303 994 488
410 435 720
91 834 556
1...

output:

744223

result:

ok 1 number(s): "744223"

Test #22:

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

input:

100
10
9613 3797 2993
5578 414 5474
3820 9378 8685
1289 7564 8993
4415 9303 991
719 7165 6296
3664 1302 5516
6538 65 18
9741 9802 2005
8149 9615 4051
10
9044 3968 9941
1720 2448 1208
4124 1290 8863
3780 2861 9860
4464 8144 5911
1262 7062 7496
2081 3687 1263
2249 3668 5266
7372 1815 997
5544 3649 516...

output:

81470
68605
80543
84150
67125
84786
85120
63520
76529
80550
71316
84052
71768
77182
75116
78969
72897
76548
79876
86532
72469
68216
81266
75454
77307
83704
80954
75846
82438
83123
72235
81120
72866
72480
72987
72366
68188
84559
70159
76839
80985
71624
75875
74750
80814
78118
70839
75389
64647
78698
...

result:

ok 100 numbers

Test #23:

score: 0
Accepted
time: 109ms
memory: 4712kb

input:

10
100
1321 9879 4086
4171 5921 8393
9438 1198 6420
1697 3885 9398
2952 5048 127
3988 6648 436
4966 9580 8381
6130 8169 2080
523 6713 1686
9005 1001 4627
4695 9888 1591
2687 6518 2847
4692 8710 4136
1678 7196 920
7317 9768 2033
3026 4689 3749
5932 5631 3304
5555 1808 5448
5643 4502 830
584 4040 4988...

output:

758232
739812
759783
722057
749350
721629
722132
729991
737011
763275

result:

ok 10 numbers

Test #24:

score: 0
Accepted
time: 351ms
memory: 4568kb

input:

1
1000
6037 9103 5255
5629 88 9276
2645 230 3032
3281 5672 6842
2398 154 6999
2231 5258 2467
9966 1431 744
621 3112 1661
3542 8205 3383
2446 9197 2856
3885 2286 8250
9484 8626 5591
8578 4071 4901
2926 8796 7280
904 2317 815
2922 7603 9153
6333 8185 1733
3316 4485 8291
2155 1847 1454
3304 8684 5635
6...

output:

7469684

result:

ok 1 number(s): "7469684"

Test #25:

score: 0
Accepted
time: 359ms
memory: 4696kb

input:

1
1000
7807 5799 943
8940 5825 5011
9152 3194 4035
3002 6369 3351
2203 306 3444
7495 6758 6356
6790 6159 3652
8530 1285 5462
7035 2228 9030
1815 2796 9677
7220 4641 647
2851 9981 4923
6966 8367 8812
4297 5479 6478
2763 5646 974
9061 5430 5486
4995 9131 5506
9375 717 6713
8508 3348 1645
6259 2177 481...

output:

7534003

result:

ok 1 number(s): "7534003"

Test #26:

score: 0
Accepted
time: 374ms
memory: 4716kb

input:

1
1000
6874 7088 6232
8058 4666 3851
7147 8863 8142
1508 171 4452
3496 4649 8400
55 5554 246
6717 3990 9664
2248 9458 1968
7825 6250 1972
1183 2203 3395
4748 8484 3444
411 5527 7358
8057 2664 2723
5668 674 2971
1918 3166 5324
1008 153 4923
3657 3180 3471
5433 8436 9327
5261 2146 7244
9214 5670 7097
...

output:

7474892

result:

ok 1 number(s): "7474892"

Test #27:

score: 0
Accepted
time: 356ms
memory: 4712kb

input:

1
1000
133 3785 1921
1368 3508 9586
3654 3315 4953
5422 869 8257
597 4801 652
1128 8541 1432
9349 8718 8380
5965 734 8474
1318 273 723
3256 8506 7112
2276 3542 5841
6482 8370 6689
2252 4257 5146
7039 461 9465
3777 7983 8187
4442 2171 1256
3807 4126 7244
1492 8860 5046
4718 3647 140
7978 4971 9380
33...

output:

7381154

result:

ok 1 number(s): "7381154"

Test #28:

score: 0
Accepted
time: 365ms
memory: 4532kb

input:

1
1000
8079 3850 2671
8861 1913 5117
252 3319 6396
6036 1889 5792
1124 6703 7523
6874 3789 2267
29 933 1901
8736 3128 5188
8230 4165 9193
1865 2908 4204
3045 497 7644
1448 3858 3392
1829 3964 9350
2197 6949 3118
9358 5556 2453
9633 5816 3352
5365 9700 8302
4172 6682 3406
3686 6057 378
915 503 6472
6...

output:

7389246

result:

ok 1 number(s): "7389246"

Test #29:

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

input:

1
1000
5586 9900 4025
3300 4219 1319
6362 1051 776
5576 2600 3085
1167 9292 8315
1196 5911 9518
202 6721 4465
119 6612 9369
9491 5974 422
5335 4094 6429
4027 7267 684
3579 2435 2743
7149 4596 8346
8158 1020 7854
8805 3767 390
6549 8459 3947
3281 3558 2206
2396 1668 6621
4598 2470 1036
812 9320 7277
...

output:

7489963

result:

ok 1 number(s): "7489963"

Test #30:

score: 0
Accepted
time: 379ms
memory: 4600kb

input:

1
1000
4653 3892 5122
6610 3060 7054
2869 4015 4883
9490 6401 6890
2460 9444 3271
6460 2002 3408
2834 4552 477
8028 592 3171
2984 9996 1876
4704 7693 5955
1555 9621 8889
8434 3789 9371
8240 8892 4961
9529 808 7051
664 8583 4740
8496 478 3385
3431 312 171
8454 7899 5044
4055 1268 6635
3768 2813 6856
...

output:

7509088

result:

ok 1 number(s): "7509088"

Test #31:

score: 0
Accepted
time: 360ms
memory: 4696kb

input:

1
1000
616 7885 811
9920 1901 8597
6672 6979 5886
7995 9803 695
2265 6491 9715
1724 3502 7298
2761 6576 6489
1746 8765 9677
3774 6722 7522
6777 9804 4264
4890 6168 5879
4505 9336 4510
2436 485 8872
900 6003 6249
9819 1912 7603
4635 5201 5526
2093 1257 6648
4513 8323 4954
3512 2770 9531
2531 4818 603...

output:

7477028

result:

ok 1 number(s): "7477028"

Test #32:

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

input:

1
1000
9683 1878 6499
3231 3447 4333
7371 9944 5401
1909 3605 4500
6262 6643 4672
6989 5001 1188
2689 7112 7908
8167 4233 6182
8755 745 7761
3441 9211 7982
5122 8523 8276
4769 4882 3841
3527 2077 2783
2271 8494 2743
1678 9433 4657
3878 5731 1859
755 2203 1909
7867 6042 6080
265 1567 2426
894 5607 83...

output:

7516293

result:

ok 1 number(s): "7516293"

Test #33:

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

input:

1
1000
56 745 605
571 153 474
518 708 362
480 460 283
917 195 883
922 255 963
106 101 129
810 222 96
111 949 106
770 254 881
39 664 788
877 504 670
530 194 90
30 991 934
645 139 181
711 719 178
453 613 708
290 17 906
821 873 326
677 300 334
318 876 726
529 581 352
263 851 377
259 666 223
773 6 741
1...

output:

747032

result:

ok 1 number(s): "747032"

Test #34:

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

input:

1
1000
743 818 667
458 308 758
608 451 801
397 783 717
639 458 797
699 4 204
963 676 934
671 739 8
233 627 122
906 649 960
473 264 793
388 742 745
311 309 190
113 884 389
263 383 696
250 833 541
646 434 697
615 608 844
525 382 181
954 931 951
295 433 462
663 372 772
86 742 926
689 541 735
130 293 38...

output:

742180

result:

ok 1 number(s): "742180"

Test #35:

score: 0
Accepted
time: 360ms
memory: 4600kb

input:

1
1000
214 787 920
936 463 450
211 491 241
314 298 254
362 208 224
477 457 661
820 356 955
724 960 216
460 497 539
339 236 934
499 672 902
499 979 116
796 527 483
197 73 35
177 923 804
6 51 303
246 62 982
236 198 887
36 186 932
232 970 864
80 798 685
501 971 599
101 232 770
823 121 247
783 580 549
5...

output:

744814

result:

ok 1 number(s): "744814"

Test #36:

score: 0
Accepted
time: 330ms
memory: 4696kb

input:

1
1000
18 91 8
75 79 84
58 99 68
92 44 37
100 59 30
70 32 8
85 26 65
42 88 62
74 19 98
5 65 1
58 91 18
72 54 49
77 46 34
93 11 56
74 87 67
49 31 89
56 52 8
99 38 39
41 72 86
53 78 78
89 82 99
66 60 10
17 2 65
35 50 19
67 11 29
81 39 28
9 45 10
18 8 79
31 83 84
79 81 20
73 95 34
47 64 2
89 16 30
33 9...

output:

70212

result:

ok 1 number(s): "70212"

Test #37:

score: 0
Accepted
time: 331ms
memory: 4600kb

input:

1
1000
7 80 72
17 23 43
19 2 74
98 53 44
48 11 40
62 26 13
13 42 37
15 94 93
1 66 8
16 82 95
12 88 91
14 85 81
70 61 2
84 1 51
95 37 38
80 68 44
10 17 55
19 64 1
43 63 40
50 65 35
70 55 54
37 58 43
2 89 32
8 34 44
69 83 5
28 80 4
37 14 46
24 76 35
19 44 85
96 76 44
95 57 42
25 94 60
25 89 21
78 19 8...

output:

70735

result:

ok 1 number(s): "70735"

Test #38:

score: 0
Accepted
time: 331ms
memory: 4660kb

input:

1
1000
100 73 33
62 66 13
83 17 85
91 54 39
96 59 50
54 12 6
45 53 98
95 96 17
23 20 25
15 96 84
59 86 59
73 20 17
66 68 65
67 91 42
24 96 9
3 2 3
51 90 90
50 83 55
41 59 99
51 40 92
34 39 18
5 68 80
74 80 99
92 26 69
71 55 90
71 21 89
66 79 90
29 51 90
3 4 79
9 74 67
29 18 54
99 16 23
60 61 7
31 33...

output:

71150

result:

ok 1 number(s): "71150"

Test #39:

score: 0
Accepted
time: 107ms
memory: 4596kb

input:

10
100
47 82 45
38 5 67
9 37 55
93 3 34
1 32 43
36 26 19
82 29 12
40 34 60
12 82 99
25 77 89
5 89 94
57 1 39
50 78 87
51 71 3
92 3 90
6 4 41
85 48 79
59 29 12
53 77 65
51 34 5
56 25 59
93 24 40
92 64 12
72 56 63
71 16 26
39 47 34
27 50 66
2 87 80
10 58 39
56 22 27
40 98 91
84 17 9
34 8 29
52 59 46
7...

output:

6873
7329
7205
7026
7207
7304
6946
7439
6933
7187

result:

ok 10 numbers

Test #40:

score: 0
Accepted
time: 107ms
memory: 4664kb

input:

10
100
24 35 14
93 93 55
49 85 37
20 40 24
51 50 52
89 67 37
53 35 94
65 42 21
83 94 56
12 44 15
14 93 34
95 72 65
73 83 98
39 29 84
32 11 77
20 67 67
17 41 31
50 67 16
57 28 90
82 52 20
22 56 33
84 48 29
74 21 38
52 68 78
58 72 52
94 51 79
51 77 18
70 59 15
32 8 89
67 34 65
34 7 56
18 68 25
8 81 53...

output:

7116
6846
7222
6922
7227
6912
7024
7033
6785
6673

result:

ok 10 numbers

Test #41:

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

input:

10
100
89 89 92
53 81 34
93 24 15
39 77 18
10 73 69
37 11 63
36 52 72
82 54 70
53 10 21
3 22 33
10 2 71
33 46 99
83 76 12
32 84 68
76 22 53
34 30 81
37 26 79
37 2 8
69 75 3
22 61 23
83 91 15
83 72 6
64 65 72
27 72 93
45 32 86
37 67 32
79 7 70
34 31 50
51 58 32
70 55 91
28 24 17
64 27 33
70 54 70
89 ...

output:

6772
7284
7100
6726
7181
7152
7350
7271
7280
7187

result:

ok 10 numbers

Test #42:

score: 0
Accepted
time: 107ms
memory: 4692kb

input:

10
100
66 50 74
8 69 13
36 68 2
58 11 9
60 87 86
86 64 81
15 61 57
3 67 27
23 27 74
90 93 60
22 15 3
70 17 29
98 77 23
29 38 57
20 34 36
56 92 99
58 12 27
20 40 4
78 35 24
57 74 34
48 14 93
74 91 91
47 14 6
94 87 13
28 88 17
91 75 89
3 37 26
5 95 89
74 7 78
77 67 29
22 33 82
11 75 42
44 19 90
8 24 4...

output:

7188
7216
7433
7059
6710
7065
7452
7038
7280
7067

result:

ok 10 numbers

Test #43:

score: 0
Accepted
time: 84ms
memory: 4716kb

input:

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

output:

59
74
60
57
75
65
65
62
68
60
68
71
61
66
69
59
58
71
62
68
61
67
61
68
83
61
73
69
85
68
61
71
60
71
64
68
62
70
76
64
58
73
75
72
72
60
64
67
77
58
74
75
61
70
69
56
58
71
71
56
55
73
62
75
62
65
65
58
69
67
63
69
80
73
56
65
68
53
66
51
65
66
59
62
67
64
59
67
68
64
75
64
76
65
72
58
77
74
64
63

result:

ok 100 numbers

Test #44:

score: 0
Accepted
time: 85ms
memory: 4716kb

input:

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

output:

73
55
78
72
68
63
76
64
70
74
71
63
65
68
64
73
58
67
66
57
83
72
72
76
67
68
62
72
55
71
64
62
64
63
71
70
57
64
62
66
71
71
70
73
75
66
75
71
63
64
49
71
71
57
64
74
73
69
71
66
70
60
69
64
62
53
68
81
60
66
70
72
72
65
61
69
76
64
60
69
64
58
75
65
62
63
70
73
73
67
73
69
60
64
68
75
59
72
64
77

result:

ok 100 numbers

Test #45:

score: 0
Accepted
time: 77ms
memory: 4640kb

input:

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

output:

63
80
83
67
69
59
56
64
79
73
67
55
62
71
53
68
62
76
61
59
64
67
68
73
59
68
66
72
63
75
72
73
64
65
75
66
59
69
74
51
66
64
67
69
70
58
67
64
72
66
58
75
65
62
71
70
67
55
67
70
65
61
76
71
72
61
83
70
76
69
39
65
78
70
75
60
66
64
68
65
67
66
63
59
88
76
85
76
76
72
61
70
60
70
67
74
72
73
68
82

result:

ok 100 numbers

Test #46:

score: 0
Accepted
time: 87ms
memory: 4600kb

input:

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

output:

16
18
14
23
17
17
13
20
17
20
15
19
19
19
15
16
19
18
24
19
19
16
17
18
21
21
20
19
20
17
18
21
21
21
16
19
19
16
18
16
17
21
16
20
18
22
20
19
17
20
20
16
15
17
20
15
23
19
19
20
19
19
19
15
17
20
20
18
16
20
19
14
17
20
22
16
16
18
22
19
23
19
19
19
17
18
19
21
19
17
19
16
18
13
15
18
18
20
18
16
...

result:

ok 200 numbers

Test #47:

score: 0
Accepted
time: 84ms
memory: 4604kb

input:

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

output:

38
43
33
31
35
39
34
33
42
32
35
38
39
36
34
29
41
37
37
29
27
35
40
38
37
38
37
31
34
42
41
40
37
39
39
26
38
42
45
37
39
47
23
36
36
34
28
29
39
40
42
44
34
29
36
30
39
33
41
36
31
38
32
46
31
31
34
32
30
31
40
46
30
40
34
41
40
43
32
38
36
28
31
39
29
35
35
34
43
36
36
40
33
36
33
44
40
28
34
46
...

result:

ok 200 numbers

Test #48:

score: 0
Accepted
time: 91ms
memory: 4568kb

input:

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

output:

14
13
13
13
12
12
12
12
13
10
14
11
12
10
13
11
13
9
13
10
14
10
12
13
12
9
11
12
11
12
15
11
12
10
11
13
11
10
12
12
14
13
15
11
13
11
11
14
13
12
11
10
12
10
10
8
10
11
13
12
11
11
10
13
12
8
14
12
14
10
14
13
12
15
13
12
11
13
11
8
7
12
11
11
11
11
12
14
11
15
12
11
10
12
10
14
14
10
8
9
13
8
13
...

result:

ok 333 numbers

Test #49:

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

input:

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

output:

22
17
19
27
23
23
22
25
14
26
15
23
25
21
23
14
26
18
22
18
29
18
22
26
20
24
19
24
13
24
27
21
20
16
22
24
21
25
26
26
28
19
19
24
23
19
23
23
24
21
20
26
25
19
18
20
15
24
19
22
20
22
24
22
19
21
19
25
21
21
20
12
17
27
26
17
23
24
24
19
21
22
17
21
17
17
20
21
21
18
21
23
26
26
25
16
24
24
20
22
...

result:

ok 333 numbers

Test #50:

score: 0
Accepted
time: 94ms
memory: 4640kb

input:

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

output:

9
8
7
7
8
8
8
9
8
10
7
10
8
5
7
8
9
8
9
9
8
10
10
6
7
7
5
9
7
9
5
9
6
7
10
9
9
8
6
9
6
9
8
9
9
10
7
7
6
10
9
7
7
9
5
8
6
10
9
9
7
6
10
8
9
5
9
7
8
9
7
8
9
8
7
9
7
8
8
9
5
6
9
10
5
8
9
8
8
8
8
10
10
6
9
9
10
6
9
6
8
10
7
8
6
8
10
8
6
9
7
6
8
8
7
9
9
9
10
8
6
9
9
8
8
8
8
8
6
6
8
10
5
9
8
8
8
8
8
10
8
...

result:

ok 500 numbers

Test #51:

score: 0
Accepted
time: 92ms
memory: 4712kb

input:

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

output:

18
16
12
15
14
10
13
19
16
10
17
16
14
14
16
18
14
14
14
16
13
19
16
12
15
15
17
17
16
17
16
18
14
14
19
14
10
10
17
18
13
18
17
16
11
18
14
16
13
13
12
13
12
14
16
18
18
15
11
11
18
16
6
19
17
16
13
13
18
15
12
13
14
12
17
11
16
17
17
18
15
18
17
17
14
15
16
20
15
17
19
16
14
15
17
14
16
16
19
16
1...

result:

ok 500 numbers

Test #52:

score: 0
Accepted
time: 111ms
memory: 4728kb

input:

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

output:

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

result:

ok 1000 numbers

Test #53:

score: 0
Accepted
time: 106ms
memory: 4728kb

input:

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

output:

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

result:

ok 1000 numbers

Test #54:

score: 0
Accepted
time: 85ms
memory: 4684kb

input:

100
10
10000 1 1
10000 1 1
10000 1 1
10000 1 1
10000 1 1
10000 1 1
10000 1 1
10000 1 1
10000 1 1
10000 1 1
10
1 1 1
1 1 1
1 1 1
1 1 1
1 1 1
1 1 1
1 1 1
1 1 1
1 1 1
1 1 1
10
10000 1 1
10000 1 1
10000 1 1
10000 1 1
10000 1 1
10000 1 1
10000 1 1
10000 1 1
10000 1 1
10000 1 1
10
10000 1 10000
10000 1 10...

output:

100000
10
100000
100000
10
100000
100000
100000
100000
100000
10
100000
100000
100000
10
100000
10
10
100000
100000
100000
100000
100000
100000
100000
100000
100000
100000
100000
10
10
100000
100000
100000
100000
100000
10
100000
100000
100000
100000
100000
100000
10
100000
100000
100000
100000
1000...

result:

ok 100 numbers

Test #55:

score: 0
Accepted
time: 104ms
memory: 4656kb

input:

10
100
1 10000 10000
1 10000 10000
1 10000 10000
1 10000 10000
1 10000 10000
1 10000 10000
1 10000 10000
1 10000 10000
1 10000 10000
1 10000 10000
1 10000 10000
1 10000 10000
1 10000 10000
1 10000 10000
1 10000 10000
1 10000 10000
1 10000 10000
1 10000 10000
1 10000 10000
1 10000 10000
1 10000 10000...

output:

1000000
100
1000000
1000000
1000000
1000000
1000000
1000000
1000000
100

result:

ok 10 numbers

Test #56:

score: 0
Accepted
time: 359ms
memory: 4680kb

input:

1
1000
10000 10000 1
10000 10000 1
10000 10000 1
10000 10000 1
10000 10000 1
10000 10000 1
10000 10000 1
10000 10000 1
10000 10000 1
10000 10000 1
10000 10000 1
10000 10000 1
10000 10000 1
10000 10000 1
10000 10000 1
10000 10000 1
10000 10000 1
10000 10000 1
10000 10000 1
10000 10000 1
10000 10000 1...

output:

10000000

result:

ok 1 number(s): "10000000"

Test #57:

score: 0
Accepted
time: 356ms
memory: 4660kb

input:

1
1000
1 1 10000
1 1 10000
1 1 10000
1 1 10000
1 1 10000
1 1 10000
1 1 10000
1 1 10000
1 1 10000
1 1 10000
1 1 10000
1 1 10000
1 1 10000
1 1 10000
1 1 10000
1 1 10000
1 1 10000
1 1 10000
1 1 10000
1 1 10000
1 1 10000
1 1 10000
1 1 10000
1 1 10000
1 1 10000
1 1 10000
1 1 10000
1 1 10000
1 1 10000
1 1...

output:

10000000

result:

ok 1 number(s): "10000000"

Test #58:

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

input:

100
10
1 1 1
1 1 1
1 1 1
1 1 1
1 1 1
1 1 1
1 1 1
1 1 1
1 1 1
1 1 1
10
1 1 184
1 1 5341
1 1 9096
1 1 4777
1 1 326
1 1 5228
1 1 8586
1 1 3140
1 1 4268
1 1 839
10
7025 2678 2325
7330 8800 2700
2987 6887 8345
2975 1604 1228
2377 4154 3750
6969 4113 6864
5819 5688 357
8727 1842 1866
478 9944 9710
3475 65...

output:

10
41785
69282
60990
59254
58721
53123
54792
57167
57224
10
73799
10
78925
78727
44200
80736
57403
65175
56983
67238
77088
64870
52783
10
57931
67646
10
10
57971
59640
60896
77035
66562
44776
10
10
67021
10
72325
53469
73371
42059
70613
60213
71983
40213
10
67659
74863
44300
70341
72685
68860
53736
...

result:

ok 100 numbers

Test #59:

score: 0
Accepted
time: 105ms
memory: 4676kb

input:

10
100
1 6686 3313
1 9566 8587
1 1735 4781
1 7015 7393
1 5040 9112
1 1743 4845
1 7821 9517
1 8773 4646
1 9158 5374
1 7977 7382
1 6758 9375
1 7234 4396
1 2172 5961
1 5545 7563
1 4669 9480
1 1788 4377
1 6272 606
1 3324 9537
1 8576 4062
1 5471 2337
1 9854 7585
1 8590 9197
1 6893 644
1 4744 9818
1 2084 ...

output:

679662
499453
508152
665067
488551
100
667282
667527
100
724361

result:

ok 10 numbers

Test #60:

score: 0
Accepted
time: 356ms
memory: 4728kb

input:

1
1000
1 7607 1
1 6769 1
1 499 1
1 9854 1
1 7504 1
1 5950 1
1 8981 1
1 2512 1
1 195 1
1 3293 1
1 5752 1
1 7277 1
1 3108 1
1 8684 1
1 1724 1
1 989 1
1 3390 1
1 366 1
1 9620 1
1 700 1
1 9485 1
1 9657 1
1 5001 1
1 5867 1
1 8195 1
1 8983 1
1 9284 1
1 6319 1
1 6182 1
1 345 1
1 3560 1
1 10000 1
1 6832 1
1...

output:

5166861

result:

ok 1 number(s): "5166861"

Test #61:

score: 0
Accepted
time: 358ms
memory: 4600kb

input:

1
1000
1 1 2849
1 1 5004
1 1 6200
1 1 5858
1 1 4755
1 1 5954
1 1 2875
1 1 3151
1 1 5808
1 1 9716
1 1 9919
1 1 1883
1 1 5124
1 1 9519
1 1 6972
1 1 6735
1 1 2719
1 1 9477
1 1 6109
1 1 7414
1 1 9174
1 1 2427
1 1 8063
1 1 7056
1 1 915
1 1 8779
1 1 8279
1 1 1824
1 1 688
1 1 3
1 1 5817
1 1 5215
1 1 9616
1...

output:

5091641

result:

ok 1 number(s): "5091641"

Test #62:

score: 0
Accepted
time: 81ms
memory: 4584kb

input:

100
10
1 143 541
1 286 312
1 147 844
1 314 486
1 703 273
1 599 398
1 830 142
1 51 156
1 449 207
1 376 247
10
418 281 851
120 743 897
165 477 568
326 160 490
539 959 516
398 35 274
750 552 150
436 38 274
736 387 513
481 174 317
10
1 1 1
1 1 1
1 1 1
1 1 1
1 1 1
1 1 1
1 1 1
1 1 1
1 1 1
1 1 1
10
150 1 5...

output:

5286
6530
10
6024
5323
10
4735
6910
10
6897
6325
5421
7753
5265
7329
7479
7120
4496
6084
10
5559
7565
7957
3815
6469
5573
6876
6680
10
4754
5771
10
6351
4783
7609
5538
10
6223
5313
6260
2832
10
5968
3152
4153
7409
7563
6577
6682
7526
7066
5945
6545
3656
5624
7297
4832
3560
6118
10
10
4042
7504
5215
...

result:

ok 100 numbers

Test #63:

score: 0
Accepted
time: 108ms
memory: 4600kb

input:

10
100
1 1 991
1 1 898
1 1 333
1 1 725
1 1 176
1 1 393
1 1 649
1 1 5
1 1 142
1 1 614
1 1 934
1 1 229
1 1 450
1 1 6
1 1 381
1 1 578
1 1 582
1 1 248
1 1 851
1 1 640
1 1 329
1 1 280
1 1 385
1 1 931
1 1 374
1 1 808
1 1 317
1 1 903
1 1 804
1 1 546
1 1 279
1 1 457
1 1 375
1 1 583
1 1 277
1 1 100
1 1 245
1...

output:

47573
61312
64115
67616
49876
66828
51754
62700
64972
65390

result:

ok 10 numbers

Test #64:

score: 0
Accepted
time: 353ms
memory: 4716kb

input:

1
1000
1 1 535
1 1 244
1 1 684
1 1 703
1 1 627
1 1 799
1 1 377
1 1 16
1 1 525
1 1 469
1 1 443
1 1 864
1 1 580
1 1 303
1 1 201
1 1 500
1 1 904
1 1 229
1 1 270
1 1 244
1 1 286
1 1 527
1 1 561
1 1 275
1 1 56
1 1 30
1 1 878
1 1 283
1 1 338
1 1 937
1 1 484
1 1 70
1 1 318
1 1 968
1 1 350
1 1 22
1 1 441
1 ...

output:

501317

result:

ok 1 number(s): "501317"

Test #65:

score: 0
Accepted
time: 353ms
memory: 4600kb

input:

1
1000
1 703 1
1 3 1
1 575 1
1 726 1
1 184 1
1 546 1
1 135 1
1 252 1
1 845 1
1 891 1
1 79 1
1 571 1
1 942 1
1 53 1
1 327 1
1 73 1
1 486 1
1 624 1
1 151 1
1 84 1
1 205 1
1 857 1
1 591 1
1 792 1
1 600 1
1 601 1
1 287 1
1 122 1
1 520 1
1 39 1
1 273 1
1 377 1
1 991 1
1 921 1
1 714 1
1 343 1
1 326 1
1 27...

output:

485617

result:

ok 1 number(s): "485617"

Test #66:

score: 0
Accepted
time: 85ms
memory: 4700kb

input:

100
10
1 1 1
1 1 1
1 1 1
1 1 1
1 1 1
1 1 1
1 1 1
1 1 1
1 1 1
1 1 1
10
84 1 1
93 1 1
37 1 1
48 1 1
45 1 1
30 1 1
84 1 1
55 1 1
44 1 1
2 1 1
10
33 97 57
91 66 32
41 77 25
69 24 27
80 28 8
74 52 49
83 64 90
34 20 38
72 76 62
50 46 74
10
33 23 1
9 30 1
8 75 1
4 22 1
82 31 1
48 3 1
8 6 1
52 46 1
55 34 1
...

output:

10
522
737
486
10
611
778
687
389
431
549
610
698
651
344
10
635
676
624
616
700
739
10
494
526
10
513
740
660
650
345
472
496
710
485
823
592
454
10
678
537
451
681
470
720
479
489
717
427
628
494
544
429
620
583
506
764
388
667
504
635
717
10
591
10
385
695
485
750
446
10
766
679
622
680
750
10
10...

result:

ok 100 numbers

Test #67:

score: 0
Accepted
time: 109ms
memory: 4728kb

input:

10
100
1 10 84
1 43 65
1 9 96
1 99 54
1 40 93
1 49 26
1 48 70
1 25 48
1 63 31
1 3 44
1 56 20
1 57 9
1 39 62
1 5 94
1 34 98
1 73 41
1 98 52
1 8 93
1 58 49
1 24 94
1 43 69
1 99 79
1 87 30
1 48 27
1 70 50
1 52 85
1 20 97
1 87 71
1 81 34
1 11 72
1 71 81
1 64 14
1 28 75
1 63 33
1 89 58
1 94 49
1 44 96
1 ...

output:

6960
5021
6746
6573
5107
6600
5092
6666
6672
6739

result:

ok 10 numbers

Test #68:

score: 0
Accepted
time: 330ms
memory: 4676kb

input:

1
1000
29 8 26
39 75 8
31 61 91
76 40 99
58 12 67
58 2 85
53 48 28
68 52 3
27 81 29
90 71 61
74 31 47
68 5 58
19 27 92
97 91 47
55 78 78
52 41 61
16 67 95
67 77 25
27 91 20
78 22 16
12 14 83
81 70 79
46 89 53
9 85 73
60 33 15
40 64 27
36 34 20
68 18 65
3 17 31
58 85 90
41 70 50
55 76 11
6 82 84
18 1...

output:

70225

result:

ok 1 number(s): "70225"

Test #69:

score: 0
Accepted
time: 291ms
memory: 4680kb

input:

1
1000
3 1 1
50 1 1
53 1 1
36 1 1
64 1 1
50 1 1
47 1 1
58 1 1
26 1 1
96 1 1
63 1 1
70 1 1
60 1 1
39 1 1
6 1 1
98 1 1
48 1 1
15 1 1
64 1 1
36 1 1
42 1 1
58 1 1
22 1 1
66 1 1
24 1 1
89 1 1
25 1 1
88 1 1
76 1 1
63 1 1
25 1 1
93 1 1
53 1 1
52 1 1
87 1 1
70 1 1
34 1 1
99 1 1
44 1 1
77 1 1
50 1 1
17 1 1
2...

output:

50308

result:

ok 1 number(s): "50308"

Test #70:

score: 0
Accepted
time: 86ms
memory: 4696kb

input:

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

output:

10
61
10
39
49
74
59
45
78
71
66
60
66
55
68
10
62
61
60
58
69
51
62
10
63
42
62
39
67
63
57
75
63
75
62
10
66
63
58
63
10
53
54
62
60
43
74
55
58
69
71
57
53
57
57
59
38
50
50
50
52
35
10
64
71
69
61
31
53
54
48
37
57
57
70
62
60
62
75
56
10
59
77
10
67
42
45
75
59
64
75
65
56
52
66
54
57
65
58
55

result:

ok 100 numbers

Test #71:

score: 0
Accepted
time: 83ms
memory: 4652kb

input:

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

output:

575
100
566
617
574
534
603
513
564
602

result:

ok 10 numbers

Test #72:

score: 0
Accepted
time: 90ms
memory: 4640kb

input:

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

1000

result:

ok 1 number(s): "1000"

Test #73:

score: 0
Accepted
time: 107ms
memory: 4640kb

input:

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

output:

5525

result:

ok 1 number(s): "5525"