QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#40256#3798. Planning Railroad DiscontinuationMaMengQiAC ✓72ms8640kbC++201.8kb2022-07-19 08:56:212022-07-19 08:56:23

详细

Test #1:

score: 100
Accepted
time: 3ms
memory: 7620kb

input:

2 1
0 1 1
3
10 5
3 4
4 1
1
0

output:

20

result:

ok single line: '20'

Test #2:

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

input:

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

output:

10723

result:

ok single line: '10723'

Test #3:

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

input:

83 1515
65 74 5
49 63 10
44 49 3
34 17 9
48 4 8
22 36 9
73 12 7
36 28 1
39 7 8
53 28 7
22 12 1
69 17 4
44 75 6
63 2 5
7 30 2
4 37 4
11 22 2
53 14 10
8 71 6
35 60 7
37 77 3
76 10 1
60 20 4
20 26 2
76 72 10
60 82 9
19 80 10
30 20 7
6 24 9
31 0 6
16 31 10
26 40 10
77 29 2
32 40 7
37 25 3
39 70 6
17 61 ...

output:

22888

result:

ok single line: '22888'

Test #4:

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

input:

39 543
38 11 4
3 14 5
10 28 8
35 26 6
29 18 7
12 32 1
5 18 9
14 33 8
37 7 7
7 17 5
7 28 10
12 7 4
2 27 9
33 6 6
15 31 6
17 31 6
37 15 6
1 25 6
7 0 2
25 22 4
5 9 6
4 1 3
36 34 1
8 21 4
8 16 7
32 19 4
30 31 9
11 36 2
36 6 5
24 7 3
17 22 10
33 22 1
7 3 3
29 37 5
35 2 6
28 24 4
32 27 7
24 37 2
17 14 7
1...

output:

17296

result:

ok single line: '17296'

Test #5:

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

input:

83 1483
51 34 5
0 61 2
27 51 2
13 0 4
79 2 7
53 80 10
61 9 7
18 17 6
71 25 1
33 32 3
49 15 3
60 82 6
36 25 3
21 67 2
74 31 2
2 9 6
78 74 8
27 72 9
17 46 1
29 6 3
5 59 8
45 19 8
29 77 1
31 68 8
23 78 4
9 8 7
76 26 1
25 37 7
1 34 3
7 59 5
23 24 7
47 53 8
16 45 9
8 28 6
79 24 7
4 55 9
58 9 6
43 76 1
61...

output:

37934

result:

ok single line: '37934'

Test #6:

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

input:

63 783
36 47 6
29 31 7
13 2 8
38 3 8
19 15 7
22 2 6
29 18 9
31 57 7
21 16 6
20 51 9
45 43 1
19 62 7
31 33 2
10 45 5
49 45 10
22 4 1
20 0 7
50 54 7
5 33 6
13 37 4
1 44 3
28 31 3
46 54 6
55 21 3
23 26 3
42 62 6
15 44 10
61 54 8
30 33 7
29 38 6
18 56 3
52 4 4
49 8 7
49 62 1
29 44 2
37 11 8
29 58 1
15 3...

output:

24715

result:

ok single line: '24715'

Test #7:

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

input:

5 8
2 0 5
3 2 7
0 1 5
4 3 1
0 3 2
1 3 5
1 2 6
4 1 5
42
13 7
2 1
13 8
6 2
20 5
18 3
18 6
18 3
14 10
4 1
3 2
10 7
5 3
3 2
2 2
4 10
4 3
7 3
1 7
10 1
2 1
4 4
1 3
9 7
8 8
2 9
7 6
16 6
18 6
20 9
16 5
6 4
11 6
10 4
5 2
12 4
18 3
5 7
12 8
4 5
10 7
4 3
3
0
1
3

output:

1489

result:

ok single line: '1489'

Test #8:

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

input:

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

output:

9724

result:

ok single line: '9724'

Test #9:

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

input:

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

output:

5608

result:

ok single line: '5608'

Test #10:

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

input:

43 874
25 34 10
31 9 3
39 13 7
29 36 9
27 11 8
25 8 3
41 21 10
25 42 10
40 17 3
34 12 4
17 19 5
39 30 4
13 15 3
8 16 7
20 14 1
1 0 3
38 19 3
1 40 2
0 4 4
25 33 6
10 17 3
35 24 4
16 29 8
35 39 5
31 28 1
2 6 4
14 8 7
29 39 3
21 7 9
6 32 4
15 31 5
16 41 5
34 28 2
34 38 5
15 34 4
7 17 2
27 29 8
20 42 1
...

output:

4267

result:

ok single line: '4267'

Test #11:

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

input:

56 1459
15 46 3
36 19 10
44 38 8
20 49 8
2 32 8
18 37 9
27 3 9
3 13 1
33 49 10
23 10 8
30 36 4
0 14 4
13 54 2
22 6 6
7 31 10
18 31 1
14 6 3
50 40 3
8 13 2
15 25 10
2 12 10
36 40 6
0 54 1
32 7 6
36 43 1
23 54 9
36 6 8
43 14 5
49 44 3
3 34 1
30 40 5
23 20 10
26 5 4
0 43 10
36 5 9
33 20 7
5 43 8
13 34 ...

output:

9444

result:

ok single line: '9444'

Test #12:

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

input:

83 1639
68 82 1
31 19 6
15 21 3
30 48 4
53 78 6
68 41 10
9 69 4
38 40 7
22 61 10
29 8 7
7 80 1
63 26 7
1 18 1
31 61 1
16 63 8
62 73 7
5 26 4
52 27 5
5 12 6
34 25 2
15 45 5
28 76 1
8 15 8
65 82 2
1 34 2
4 48 5
18 11 3
80 35 6
47 16 4
13 43 6
37 67 6
61 78 4
72 55 2
60 5 10
26 61 7
10 66 2
3 67 2
65 2...

output:

4788

result:

ok single line: '4788'

Test #13:

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

input:

98 4051
52 25 7
5 20 1
54 72 8
78 87 10
31 8 2
12 14 5
86 27 5
7 33 9
14 34 4
74 87 4
8 45 8
96 61 4
49 70 8
27 40 10
22 36 3
11 89 8
70 64 3
92 11 2
5 41 1
31 35 8
65 49 5
50 43 8
56 42 5
59 21 5
72 24 10
3 11 5
10 87 7
49 83 3
10 62 3
75 94 3
64 38 4
17 77 2
59 64 5
40 10 9
80 59 9
91 72 8
94 74 7...

output:

21639

result:

ok single line: '21639'

Test #14:

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

input:

91 2399
75 5 9
14 4 8
64 14 10
39 60 2
42 76 4
40 90 9
59 60 1
74 0 7
84 72 10
82 76 3
90 67 8
78 55 3
60 83 1
81 28 5
49 25 9
23 58 1
21 42 7
77 7 5
32 63 3
83 76 6
47 76 5
67 65 8
62 37 9
49 21 9
21 57 9
40 71 10
9 20 7
46 3 8
13 84 3
17 28 10
56 52 6
46 88 8
56 19 2
3 33 2
52 60 3
29 72 1
71 30 3...

output:

25680

result:

ok single line: '25680'

Test #15:

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

input:

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

output:

1860

result:

ok single line: '1860'

Test #16:

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

input:

59 694
55 36 3
5 7 5
42 53 8
36 35 10
33 40 7
27 45 6
19 2 1
38 21 8
40 32 3
25 43 5
55 32 7
5 20 8
43 23 7
9 50 8
54 16 7
3 6 7
18 36 9
22 29 2
8 58 2
16 33 4
10 57 4
31 20 5
2 17 7
31 9 1
50 37 8
58 19 1
19 17 8
45 43 2
30 46 3
50 22 6
45 36 1
7 29 8
54 22 5
7 34 4
0 40 10
42 4 5
49 19 1
53 35 6
5...

output:

9294

result:

ok single line: '9294'

Test #17:

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

input:

28 241
24 18 10
7 15 2
8 14 8
21 20 2
10 5 2
2 24 6
26 12 3
21 10 9
24 11 5
27 19 8
1 16 7
19 10 6
3 16 5
5 14 10
19 20 10
5 6 4
13 26 4
27 14 2
12 9 2
2 20 5
13 0 5
2 23 3
22 9 10
16 27 2
3 0 4
14 22 9
6 15 4
16 8 6
0 8 10
23 0 1
14 0 6
17 26 7
25 1 7
27 21 4
18 6 5
22 1 9
1 13 4
12 18 10
26 5 7
22...

output:

10993

result:

ok single line: '10993'

Test #18:

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

input:

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

output:

5899

result:

ok single line: '5899'

Test #19:

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

input:

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

output:

10573

result:

ok single line: '10573'

Test #20:

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

input:

57 926
10 1 1
23 0 1
9 8 5
9 13 5
45 38 5
26 34 4
45 32 10
33 25 8
4 53 6
53 28 4
52 1 6
39 34 5
47 33 5
21 41 7
39 3 10
40 34 3
7 40 9
2 41 5
13 30 9
7 5 2
22 50 1
48 26 10
32 16 3
20 17 10
39 38 1
47 13 3
23 12 10
45 55 1
8 19 6
19 27 4
6 1 3
45 24 8
28 24 4
8 33 6
55 43 7
9 12 7
28 47 5
2 15 7
13...

output:

14561

result:

ok single line: '14561'

Test #21:

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

input:

78 2858
46 59 10
19 2 4
57 74 3
55 20 8
46 7 5
29 48 7
15 68 10
20 71 8
52 41 5
18 1 1
37 55 3
13 35 3
39 76 7
51 15 8
54 19 6
43 28 6
24 33 7
45 12 7
65 68 8
10 6 1
43 48 8
15 64 1
51 77 3
45 76 5
60 10 8
55 46 5
1 16 8
53 61 7
13 4 3
61 5 1
44 24 6
65 26 7
26 7 8
31 30 9
25 42 8
20 77 8
45 9 2
7 3...

output:

24928

result:

ok single line: '24928'

Test #22:

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

input:

1043 3625
210 118 475923268
53 800 475923261
66 609 475923266
384 372 475923263
453 271 475923247
681 885 475923275
407 540 475923259
654 776 475923264
822 598 475923265
659 925 475923250
653 97 475923263
13 346 475923267
953 821 475923250
511 801 475923273
198 514 475923254
553 152 475923248
759 32...

output:

1091059772229685

result:

ok single line: '1091059772229685'

Test #23:

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

input:

1022 6712
967 665 473597082
282 844 473597087
355 401 473597086
579 338 473597083
991 770 473597081
799 404 473597081
897 358 473597087
499 575 473597084
452 611 473597081
906 578 473597087
965 29 473597082
762 997 473597083
878 193 473597083
20 618 473597087
840 634 473597085
704 96 473597084
578 5...

output:

1040633922129705

result:

ok single line: '1040633922129705'

Test #24:

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

input:

1087 6639
1007 280 491039265
76 158 491039244
618 226 491039230
872 813 491039226
80 1075 491039266
937 222 491039280
533 424 491039242
587 592 491039261
1052 303 491039235
140 192 491039274
270 165 491039275
62 927 491039231
156 228 491039283
161 804 491039238
689 870 491039239
267 838 491039236
60...

output:

1164662580596396

result:

ok single line: '1164662580596396'

Test #25:

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

input:

1005 3651
454 408 457974344
375 768 457974358
596 900 457974358
995 338 457974339
297 952 457974335
174 468 457974372
839 181 457974369
92 826 457974370
491 542 457974361
446 210 457974403
459 146 457974338
589 253 457974350
534 474 457974371
258 250 457974401
520 276 457974395
641 165 457974373
143...

output:

1003375075339867

result:

ok single line: '1003375075339867'

Test #26:

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

input:

1077 9290
263 892 476477486
336 980 476477526
221 317 476477482
436 776 476477531
181 975 476477507
829 425 476477493
532 734 476477540
237 197 476477511
984 976 476477503
674 729 476477482
561 880 476477468
862 143 476477472
861 525 476477497
599 107 476477476
20 501 476477516
32 906 476477492
421 ...

output:

1099201150997501

result:

ok single line: '1099201150997501'

Test #27:

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

input:

1018 9870
253 964 471652391
364 879 471652420
745 722 471652417
417 158 471652410
402 206 471652410
590 914 471652404
571 299 471652412
143 777 471652389
775 187 471652397
3 478 471652404
307 966 471652390
450 754 471652406
200 801 471652398
818 161 471652407
305 455 471652425
4 317 471652414
674 48...

output:

967005331629385

result:

ok single line: '967005331629385'

Test #28:

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

input:

1055 3144
251 258 463154195
350 162 463154185
382 75 463154206
520 932 463154210
671 6 463154230
678 154 463154235
484 681 463154207
624 587 463154186
1040 602 463154193
566 719 463154222
946 993 463154186
680 179 463154199
912 425 463154235
885 652 463154229
293 197 463154235
862 18 463154204
168 3...

output:

980186206024091

result:

ok single line: '980186206024091'

Test #29:

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

input:

1027 3708
963 217 452707689
464 591 452707689
684 722 452707687
697 693 452707687
231 1024 452707686
30 969 452707684
514 376 452707689
968 167 452707688
257 194 452707688
675 409 452707685
684 387 452707688
1007 1011 452707688
200 699 452707684
568 296 452707689
716 161 452707684
410 419 452707686
...

output:

977283621094257

result:

ok single line: '977283621094257'

Test #30:

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

input:

1055 2652
14 232 496185254
454 578 496185306
239 157 496185307
316 556 496185329
943 872 496185270
328 520 496185308
466 198 496185301
707 970 496185278
459 363 496185320
1019 1012 496185270
182 130 496185275
1007 105 496185272
255 660 496185261
960 618 496185313
1015 432 496185253
757 424 496185306...

output:

1148504182244582

result:

ok single line: '1148504182244582'

Test #31:

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

input:

1025 3244
53 47 475981900
686 220 475981910
125 857 475981913
735 511 475981908
246 739 475981900
290 340 475981905
325 101 475981911
939 342 475981897
877 173 475981899
771 797 475981910
551 691 475981895
226 634 475981895
867 966 475981910
589 631 475981898
110 655 475981908
338 488 475981898
395 ...

output:

997228726655030

result:

ok single line: '997228726655030'

Test #32:

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

input:

1016 4990
289 491 459671115
523 121 459671111
982 908 459671112
620 296 459671114
965 924 459671113
440 157 459671111
443 141 459671115
708 351 459671115
161 933 459671114
107 896 459671113
257 568 459671114
292 52 459671114
412 499 459671111
802 740 459671112
942 49 459671114
862 482 459671114
712 ...

output:

954599915788531

result:

ok single line: '954599915788531'

Test #33:

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

input:

1047 3534
143 199 498733628
101 559 498733612
162 1008 498733608
922 600 498733616
933 84 498733613
643 555 498733628
256 244 498733615
603 985 498733624
775 681 498733611
236 310 498733622
462 654 498733627
834 964 498733609
734 878 498733616
306 800 498733614
805 64 498733621
769 329 498733625
15 ...

output:

1092387203858641

result:

ok single line: '1092387203858641'

Test #34:

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

input:

1066 4342
385 60 464297273
152 439 464297270
138 203 464297248
137 230 464297291
965 782 464297256
132 546 464297301
734 537 464297259
345 507 464297259
727 391 464297251
179 373 464297247
963 21 464297270
772 570 464297264
995 860 464297259
715 302 464297243
624 1028 464297284
479 1025 464297292
64...

output:

995820103317738

result:

ok single line: '995820103317738'

Test #35:

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

input:

1069 7716
695 451 464468843
391 1049 464468869
875 568 464468829
726 297 464468854
134 237 464468870
764 88 464468872
405 325 464468844
167 266 464468841
569 119 464468837
786 906 464468826
530 373 464468843
775 578 464468871
188 827 464468838
582 704 464468822
953 973 464468872
538 973 464468858
99...

output:

1085385616149200

result:

ok single line: '1085385616149200'

Test #36:

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

input:

1055 5811
78 794 461691852
635 385 461691886
727 142 461691854
583 57 461691880
591 1037 461691883
620 821 461691874
947 283 461691878
908 182 461691877
727 387 461691867
741 55 461691856
532 179 461691886
383 298 461691882
613 131 461691828
287 351 461691893
75 489 461691846
592 705 461691880
36 48...

output:

985858896868905

result:

ok single line: '985858896868905'

Test #37:

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

input:

1087 7402
622 764 477092844
155 200 477092847
421 456 477092857
371 655 477092857
217 336 477092844
38 475 477092853
729 992 477092844
585 1032 477092840
207 9 477092859
280 742 477092853
548 879 477092855
627 810 477092845
1065 809 477092841
544 811 477092844
691 719 477092847
487 606 477092850
914...

output:

1078686884556379

result:

ok single line: '1078686884556379'

Test #38:

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

input:

1053 4125
749 719 489589763
663 642 489589709
355 261 489589698
582 144 489589723
351 688 489589687
842 1017 489589693
939 103 489589750
431 955 489589731
31 707 489589756
926 223 489589692
1042 431 489589701
131 353 489589695
110 35 489589743
661 224 489589738
371 735 489589685
645 437 489589753
50...

output:

1062007216036933

result:

ok single line: '1062007216036933'

Test #39:

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

input:

1050 1320
928 11 453905118
475 446 453905097
980 498 453905109
851 635 453905088
1004 889 453905091
567 139 453905094
805 348 453905113
527 476 453905123
188 175 453905126
528 25 453905105
652 465 453905117
622 144 453905101
442 768 453905108
892 963 453905095
91 664 453905126
181 101 453905110
662 ...

output:

993234238911747

result:

ok single line: '993234238911747'

Test #40:

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

input:

1082 1914
976 479 455935325
463 526 455935332
139 663 455935338
583 260 455935331
765 729 455935337
3 786 455935284
83 486 455935290
1029 701 455935289
137 629 455935325
120 866 455935326
267 974 455935363
507 32 455935322
931 311 455935294
500 528 455935332
33 591 455935292
589 37 455935281
394 712...

output:

1046828384519422

result:

ok single line: '1046828384519422'

Test #41:

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

input:

1032 4658
492 66 489259161
747 10 489259161
312 760 489259160
128 607 489259185
15 248 489259202
23 702 489259150
19 389 489259165
272 50 489259156
478 608 489259190
616 559 489259184
462 147 489259175
922 280 489259179
3 287 489259181
506 452 489259158
885 309 489259145
22 349 489259165
1004 114 48...

output:

1020938066974606

result:

ok single line: '1020938066974606'

Test #42:

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

input:

1066 7025
1057 457 450092842
680 659 450092821
529 742 450092824
1061 563 450092859
626 26 450092857
887 859 450092833
20 74 450092856
1023 681 450092852
500 457 450092777
560 692 450092802
732 158 450092851
812 771 450092857
713 333 450092788
781 529 450092833
550 237 450092832
546 508 450092780
84...

output:

990304070715288

result:

ok single line: '990304070715288'

Test #43:

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

input:

1055 9853
222 347 464417583
283 231 464417590
635 176 464417590
541 374 464417598
216 94 464417588
463 338 464417584
615 912 464417586
630 840 464417586
933 808 464417585
906 1008 464417596
74 395 464417588
959 899 464417583
802 96 464417600
1029 1019 464417581
681 586 464417589
563 125 464417581
44...

output:

1004418204125769

result:

ok single line: '1004418204125769'

Test #44:

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

input:

1062 2234
246 138 480018642
1017 304 480018640
268 1051 480018641
65 744 480018638
649 45 480018639
193 432 480018642
88 943 480018642
29 941 480018641
1039 642 480018641
182 94 480018638
968 695 480018642
920 564 480018638
306 93 480018638
317 862 480018642
680 137 480018641
572 791 480018638
332 4...

output:

1026695546871632

result:

ok single line: '1026695546871632'

Test #45:

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

input:

1053 2473
172 439 499999214
805 20 499999157
784 709 499999194
763 424 499999190
168 679 499999164
790 706 499999192
521 308 499999207
347 358 499999184
950 485 499999173
442 789 499999189
187 2 499999181
245 238 499999155
506 920 499999152
706 1046 499999155
259 920 499999183
628 954 499999206
530 ...

output:

1121442138574750

result:

ok single line: '1121442138574750'

Test #46:

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

input:

1034 4267
342 90 462237629
568 346 462237614
336 841 462237615
793 78 462237605
97 816 462237653
1003 832 462237605
513 671 462237653
501 560 462237608
242 352 462237654
252 358 462237615
935 478 462237606
830 446 462237606
997 133 462237643
973 697 462237628
578 644 462237598
711 27 462237618
72 79...

output:

1030467244660122

result:

ok single line: '1030467244660122'

Test #47:

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

input:

1060 3889
732 10 483198846
859 499 483198899
688 874 483198891
559 859 483198915
540 720 483198846
1014 129 483198869
835 413 483198880
884 171 483198848
141 605 483198833
20 726 483198841
379 168 483198903
1016 278 483198887
599 444 483198851
856 225 483198921
200 83 483198900
244 99 483198880
403 ...

output:

1035648797119924

result:

ok single line: '1035648797119924'

Test #48:

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

input:

1041 6719
771 423 481303330
182 119 481303329
10 768 481303325
630 742 481303326
194 488 481303332
522 1004 481303327
792 557 481303337
315 172 481303325
680 125 481303332
191 233 481303327
19 351 481303336
157 1006 481303326
805 424 481303326
348 390 481303330
631 300 481303329
729 470 481303328
42...

output:

1046163801415342

result:

ok single line: '1046163801415342'

Test #49:

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

input:

1091 7917
252 858 475884348
289 637 475884342
972 844 475884321
0 579 475884307
315 119 475884313
567 417 475884337
946 964 475884346
367 596 475884321
26 864 475884317
167 704 475884325
825 730 475884352
987 487 475884322
540 784 475884355
1047 474 475884323
471 1013 475884301
565 878 475884351
118...

output:

1044608897467508

result:

ok single line: '1044608897467508'

Test #50:

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

input:

1077 6620
890 853 484512803
253 1007 484512854
471 287 484512825
466 737 484512784
350 827 484512817
523 844 484512820
657 614 484512826
875 18 484512853
417 828 484512785
920 1033 484512779
950 636 484512851
638 844 484512803
744 558 484512854
1026 317 484512794
283 928 484512854
289 194 484512788
...

output:

1058250568098893

result:

ok single line: '1058250568098893'

Test #51:

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

input:

1015 3626
418 700 483534488
202 859 483534478
727 805 483534449
36 135 483534471
41 29 483534446
393 195 483534469
305 929 483534491
733 386 483534472
867 213 483534501
152 445 483534469
102 767 483534483
379 659 483534454
124 943 483534484
849 612 483534501
972 308 483534449
277 328 483534456
516 4...

output:

1040468490101492

result:

ok single line: '1040468490101492'

Test #52:

score: 0
Accepted
time: 24ms
memory: 8640kb

input:

9301 56698
2336 4332 53
2367 3275 96
8476 3942 59
6176 2473 55
3442 5231 67
6143 6538 15
3614 4324 65
70 2098 29
9040 6886 77
5065 5827 18
3060 2560 74
6335 771 32
6821 1705 46
8085 3627 7
6897 2949 43
640 8104 37
1255 8225 18
81 3610 60
5395 8710 7
4184 6500 86
7821 6326 27
2702 5264 78
7482 8219 4...

output:

42294489912

result:

ok single line: '42294489912'

Test #53:

score: 0
Accepted
time: 40ms
memory: 7320kb

input:

9827 65588
3674 200 78
7438 13 13
1234 2286 67
4648 4179 23
548 4817 27
218 6424 10
4041 737 40
6186 2275 91
2141 4898 92
3296 6139 1
8371 3422 2
7247 6337 99
4880 5194 48
8965 8568 89
3315 5264 76
584 5558 100
7475 6495 74
5007 3572 97
3400 8130 21
7744 1847 83
6025 4857 80
8313 5330 78
2919 7390 2...

output:

51627117181

result:

ok single line: '51627117181'

Test #54:

score: 0
Accepted
time: 24ms
memory: 7956kb

input:

9610 66181
6459 7686 12
3362 3315 89
5122 7929 64
2652 8878 68
1041 7441 52
5299 1973 62
1812 1769 15
2756 4805 93
4098 3961 62
8842 64 66
8336 7611 77
3194 2421 59
6416 7272 67
6573 1883 74
8132 2567 9
5579 6723 11
4629 8720 6
3648 5996 95
1131 7165 96
7747 6793 29
4849 5584 65
748 901 89
6435 1415...

output:

53516844923

result:

ok single line: '53516844923'

Test #55:

score: 0
Accepted
time: 40ms
memory: 7260kb

input:

9214 51720
1380 6523 59
988 2931 1
6674 6553 30
1364 3316 5
566 4735 7
3957 4842 55
6058 8177 16
4232 6470 77
6560 3844 36
4327 1986 45
9153 532 6
8220 7035 97
8799 8047 7
85 6249 76
7124 1014 68
6462 7774 46
50 4185 35
8382 238 31
6838 5019 95
5531 7142 24
2154 6524 65
3561 203 82
8093 6941 99
7513...

output:

49472840574

result:

ok single line: '49472840574'

Test #56:

score: 0
Accepted
time: 18ms
memory: 6952kb

input:

9567 13532
8405 4739 5
7203 7226 3
2184 1875 88
492 6317 47
789 2056 29
5698 4443 98
6704 3640 45
7437 6853 8
5721 4092 1
33 5920 27
5335 8310 13
2007 2304 49
8040 9123 5
2781 8188 35
3561 1868 75
1849 8142 81
292 0 45
3231 3361 91
1093 6526 88
3866 513 86
5170 9331 62
4842 4119 30
5842 9155 7
6643 ...

output:

64667093324

result:

ok single line: '64667093324'

Test #57:

score: 0
Accepted
time: 72ms
memory: 7976kb

input:

9894 76089
5199 4669 479388152
8576 1445 479387642
4781 2130 479387882
9225 2040 479388222
7031 8383 479388097
685 1734 479387682
2075 817 479387775
7258 2971 479388144
899 6361 479387826
1079 9550 479387851
169 5310 479387875
8702 9491 479388122
3878 7553 479387771
5181 6545 479388087
8825 9251 479...

output:

932040329501807475

result:

ok single line: '932040329501807475'

Test #58:

score: 0
Accepted
time: 40ms
memory: 6920kb

input:

9084 27712
2867 6876 451229585
5111 6638 451229576
1884 7651 451229779
3050 1398 451229397
5542 520 451229599
294 7200 451229314
1150 5962 451229741
2727 4569 451229769
7818 2340 451229382
6753 8060 451229415
8188 4037 451229724
5765 4336 451229413
7219 1117 451229498
4982 1128 451229805
835 3591 45...

output:

742995383633965517

result:

ok single line: '742995383633965517'

Test #59:

score: 0
Accepted
time: 66ms
memory: 8268kb

input:

9077 79262
3255 3510 461478413
7147 5357 461478358
8992 2268 461478515
5735 4810 461478322
3345 5371 461478355
3628 961 461478483
6138 5379 461478421
3480 6608 461478503
381 4420 461478467
455 5014 461478441
4155 2233 461478412
7123 5084 461478414
3389 5145 461478508
8118 3830 461478467
5994 140 461...

output:

832447988938470356

result:

ok single line: '832447988938470356'

Test #60:

score: 0
Accepted
time: 52ms
memory: 7296kb

input:

9122 20728
3280 3546 493168566
610 5376 493168680
1527 8558 493168668
6089 8690 493168795
8744 5132 493168466
1296 2321 493168611
6404 7530 493168677
4282 596 493168451
8588 8364 493168799
3362 4512 493168512
4818 4532 493168860
1923 2830 493168551
5140 7038 493168740
1678 4794 493168436
5186 1259 4...

output:

878286932003221891

result:

ok single line: '878286932003221891'

Test #61:

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

input:

9954 46290
8637 5387 452610992
5070 2714 452611536
241 86 452610989
4627 7528 452610799
8191 3657 452611461
3223 2434 452611544
4774 5367 452610991
7437 1905 452610908
9265 4585 452611432
4581 4343 452611259
3441 8669 452611338
6623 9091 452610791
254 1433 452611612
6580 8300 452611000
905 2836 4526...

output:

816737011412121491

result:

ok single line: '816737011412121491'

Test #62:

score: 0
Accepted
time: 58ms
memory: 8244kb

input:

9816 81731
6572 9667 288193421
727 4013 273274080
8846 4480 331240909
5261 8660 899201843
8509 2825 921974878
5350 5258 165383666
5003 1478 144519600
4399 3966 560784204
6791 5470 5094309
5518 4590 92887886
628 902 231480527
9508 8862 722128886
3739 6233 462501379
28 6301 842843715
6745 1685 4014532...

output:

455284383165878762

result:

ok single line: '455284383165878762'

Test #63:

score: 0
Accepted
time: 31ms
memory: 8588kb

input:

9238 10570
9123 3114 769276486
8692 3350 701455761
4735 5363 304672710
7992 7909 927763700
106 7316 588405074
1371 8973 951768709
3646 4476 352485643
4774 8065 779722036
6865 6610 10040453
7564 690 551338616
2253 2022 948425555
3274 1627 861813345
648 8124 485921439
4172 2445 813902084
3684 4536 314...

output:

661714867237534197

result:

ok single line: '661714867237534197'

Test #64:

score: 0
Accepted
time: 54ms
memory: 8172kb

input:

9103 78438
3986 6792 220080119
1662 4752 356445444
7197 7500 972386174
4690 6960 263235724
3686 2428 677569541
7584 4856 212086253
8625 4161 1986016
5120 5256 620723192
3218 8188 622305901
7430 3666 988064821
1729 3820 450588891
1538 4354 10952140
2136 5175 313345503
3792 7100 563499375
8855 6098 54...

output:

390258348032049239

result:

ok single line: '390258348032049239'

Test #65:

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

input:

10000 100000
5403 113 1000000000
270 1941 1000000000
8946 9229 1000000000
2591 5940 1000000000
9426 1966 1000000000
8864 6470 1000000000
7333 9990 1000000000
5531 6778 1000000000
7026 6394 1000000000
3533 1199 1000000000
5604 1510 1000000000
9903 8161 1000000000
2322 1875 1000000000
4789 9915 100000...

output:

1000009998000000000

result:

ok single line: '1000009998000000000'