QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#31648#504. Chessboardrepoman100 ✓664ms12524kbC++1.7kb2022-05-10 23:15:152022-05-10 23:15:17

Details

Tip: Click on the bar to expand more detailed information

Subtask #1:

score: 8
Accepted

Test #1:

score: 8
Accepted
time: 5ms
memory: 8348kb

input:

100 0

output:

4800

result:

ok single line: '4800'

Test #2:

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

input:

99 0

output:

4356

result:

ok single line: '4356'

Test #3:

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

input:

98 0

output:

4704

result:

ok single line: '4704'

Test #4:

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

input:

97 0

output:

4704

result:

ok single line: '4704'

Test #5:

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

input:

96 0

output:

4096

result:

ok single line: '4096'

Test #6:

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

input:

95 0

output:

4332

result:

ok single line: '4332'

Test #7:

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

input:

94 0

output:

4416

result:

ok single line: '4416'

Subtask #2:

score: 8
Accepted

Test #8:

score: 8
Accepted
time: 35ms
memory: 10992kb

input:

62119 62603
12553 17025 12553 17025
6889 49271 6889 49271
22523 10778 22523 10778
27058 28538 27058 28538
39696 26638 39696 26638
59348 52344 59348 52344
53272 14810 53272 14810
29522 5148 29522 5148
52527 55935 52527 55935
43346 19863 43346 19863
49934 33407 49934 33407
57492 27016 57492 27016
7355...

output:

1929384918

result:

ok single line: '1929384918'

Test #9:

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

input:

13553 16567
10214 777 10214 777
1372 7931 1372 7931
2222 8015 2222 8015
12573 8712 12573 8712
11772 7517 11772 7517
13462 5796 13462 5796
11421 3259 11421 3259
259 7736 259 7736
7391 3520 7391 3520
9568 7552 9568 7552
10914 2655 10914 2655
915 11734 915 11734
7211 10475 7211 10475
2350 9168 2350 916...

output:

91841677

result:

ok single line: '91841677'

Test #10:

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

input:

83311 39346
17169 55690 17169 55690
44097 70844 44097 70844
21463 68879 21463 68879
65027 22685 65027 22685
24591 56773 24591 56773
47003 22668 47003 22668
43456 35367 43456 35367
38682 41848 38682 41848
22547 25019 22547 25019
32120 57672 32120 57672
35244 51896 35244 51896
27588 18334 27588 18334
...

output:

3470361291

result:

ok single line: '3470361291'

Test #11:

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

input:

2593 45808
734 225 734 225
2097 527 2097 527
1970 1389 1970 1389
1595 164 1595 164
535 2519 535 2519
945 1570 945 1570
1155 1379 1155 1379
1805 1711 1805 1711
1722 1785 1722 1785
1875 2530 1875 2530
1258 665 1258 665
1671 2481 1671 2481
702 2358 702 2358
2207 127 2207 127
2420 1000 2420 1000
703 91 ...

output:

3361728

result:

ok single line: '3361728'

Test #12:

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

input:

56393 54508
31316 8221 31316 8221
28261 551 28261 551
56373 14562 56373 14562
30770 1992 30770 1992
26181 47974 26181 47974
20906 48883 20906 48883
30498 40114 30498 40114
42754 10090 42754 10090
17359 14718 17359 14718
39687 20578 39687 20578
38086 21607 38086 21607
46774 54122 46774 54122
15651 11...

output:

1590085022

result:

ok single line: '1590085022'

Test #13:

score: 0
Accepted
time: 22ms
memory: 9760kb

input:

48313 34790
25246 25140 25246 25140
27687 40566 27687 40566
29723 14480 29723 14480
8105 11104 8105 11104
26980 34212 26980 34212
24319 34779 24319 34779
28496 2921 28496 2921
41606 19546 41606 19546
4871 1373 4871 1373
38836 24241 38836 24241
7112 32587 7112 32587
40232 32604 40232 32604
31909 4077...

output:

1167072972

result:

ok single line: '1167072972'

Test #14:

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

input:

22369 7369
8903 15030 8903 15030
21789 2148 21789 2148
20232 1605 20232 1605
18493 16645 18493 16645
7899 17751 7899 17751
20641 6627 20641 6627
8533 4787 8533 4787
17994 79 17994 79
3380 10157 3380 10157
3032 3571 3032 3571
13692 13531 13692 13531
13475 10046 13475 10046
5445 17435 5445 17435
6393 ...

output:

250186080

result:

ok single line: '250186080'

Test #15:

score: 0
Accepted
time: 21ms
memory: 9888kb

input:

49177 34976
20242 3416 20242 3416
29831 41358 29831 41358
44096 23812 44096 23812
38772 41358 38772 41358
15408 24508 15408 24508
12918 43262 12918 43262
14923 13241 14923 13241
24245 1273 24245 1273
15496 17569 15496 17569
18827 48604 18827 48604
24179 10086 24179 10086
39151 33628 39151 33628
3046...

output:

1209188651

result:

ok single line: '1209188651'

Test #16:

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

input:

30517 90160
1148 29295 1148 29295
4742 14556 4742 14556
13369 19072 13369 19072
3570 26309 3570 26309
27652 20912 27652 20912
23698 22199 23698 22199
23527 10525 23527 10525
25304 2904 25304 2904
28108 27338 28108 27338
6120 14668 6120 14668
15168 15380 15168 15380
19202 13390 19202 13390
24498 1460...

output:

465643354

result:

ok single line: '465643354'

Test #17:

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

input:

37853 50195
37739 14089 37739 14089
13677 29088 13677 29088
21276 27518 21276 27518
14263 24397 14263 24397
19814 30961 19814 30961
6565 8097 6565 8097
3121 28314 3121 28314
21858 19175 21858 19175
17886 27128 17886 27128
19921 26743 19921 26743
20268 5870 20268 5870
18988 19478 18988 19478
12130 25...

output:

716424803

result:

ok single line: '716424803'

Subtask #3:

score: 15
Accepted

Test #18:

score: 15
Accepted
time: 5ms
memory: 8440kb

input:

78 280
55 71 55 71
22 73 22 73
60 30 60 30
28 11 28 11
51 39 51 39
21 33 21 33
25 32 25 32
42 54 42 54
62 71 62 71
23 31 23 31
75 1 75 1
56 76 56 76
33 9 33 9
9 76 9 76
77 67 77 67
68 21 68 21
62 24 62 24
32 70 32 70
41 2 41 2
58 58 58 58
65 14 65 14
66 72 66 72
72 21 72 21
71 63 71 63
13 18 13 18
6...

output:

2732

result:

ok single line: '2732'

Test #19:

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

input:

66 47
28 26 28 26
40 19 40 19
6 14 6 14
32 53 32 53
20 1 20 1
26 52 26 52
65 63 65 63
53 65 53 65
16 36 16 36
1 44 1 44
50 24 50 24
54 61 54 61
24 15 24 15
41 30 41 30
31 42 31 42
3 21 3 21
48 4 48 4
7 44 7 44
20 9 20 9
9 40 9 40
53 20 53 20
27 50 27 50
14 39 14 39
48 37 48 37
48 1 48 1
22 63 22 63
...

output:

1941

result:

ok single line: '1941'

Test #20:

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

input:

80 192
6 44 6 44
5 11 5 11
60 63 60 63
13 7 13 7
38 49 38 49
75 48 75 48
21 18 21 18
57 1 57 1
12 9 12 9
22 58 22 58
38 62 38 62
53 62 53 62
62 49 62 49
28 37 28 37
20 50 20 50
22 27 22 27
63 38 63 38
33 63 33 63
22 57 22 57
1 5 1 5
22 22 22 22
43 5 43 5
79 1 79 1
75 41 75 41
71 46 71 46
30 51 30 51...

output:

3096

result:

ok single line: '3096'

Test #21:

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

input:

78 980
6 3 6 3
26 55 26 55
56 50 56 50
74 1 74 1
63 32 63 32
27 49 27 49
7 37 7 37
43 42 43 42
60 37 60 37
14 53 14 53
41 27 41 27
62 49 62 49
67 7 67 7
21 44 21 44
74 60 74 60
69 51 69 51
17 41 17 41
15 7 15 7
49 20 49 20
13 64 13 64
78 8 78 8
75 47 75 47
38 31 38 31
32 23 32 23
47 51 47 51
39 33 3...

output:

2820

result:

ok single line: '2820'

Test #22:

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

input:

77 854
21 27 21 27
51 59 51 59
24 42 24 42
31 31 31 31
45 17 45 17
28 47 28 47
58 68 58 68
11 17 11 17
76 58 76 58
75 11 75 11
61 17 61 17
50 5 50 5
49 37 49 37
77 55 77 55
38 60 38 60
1 26 1 26
60 9 60 9
38 3 38 3
45 20 45 20
1 65 1 65
16 36 16 36
64 74 64 74
39 47 39 47
43 2 43 2
65 28 65 28
45 45...

output:

2926

result:

ok single line: '2926'

Test #23:

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

input:

76 376
36 4 36 4
71 16 71 16
44 55 44 55
9 38 9 38
57 45 57 45
49 53 49 53
72 18 72 18
8 33 8 33
10 59 10 59
41 64 41 64
26 46 26 46
27 76 27 76
29 57 29 57
55 5 55 5
65 19 65 19
28 13 28 13
34 52 34 52
57 2 57 2
76 36 76 36
58 15 58 15
3 20 3 20
59 23 59 23
65 37 65 37
55 41 55 41
31 14 31 14
35 2 ...

output:

2862

result:

ok single line: '2862'

Test #24:

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

input:

87 898
30 50 30 50
9 39 9 39
26 12 26 12
6 62 6 62
85 51 85 51
72 15 72 15
8 78 8 78
29 36 29 36
68 24 68 24
13 56 13 56
1 39 1 39
4 51 4 51
79 14 79 14
14 85 14 85
59 54 59 54
57 86 57 86
26 54 26 54
14 22 14 22
86 46 86 46
47 34 47 34
75 42 75 42
15 22 15 22
87 79 87 79
7 61 7 61
84 76 84 76
28 85...

output:

3468

result:

ok single line: '3468'

Test #25:

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

input:

63 680
36 4 36 4
62 16 62 16
17 62 17 62
55 58 55 58
38 50 38 50
30 25 30 25
57 38 57 38
38 62 38 62
8 3 8 3
7 38 7 38
9 51 9 51
33 5 33 5
6 6 6 6
22 28 22 28
62 14 62 14
55 29 55 29
17 40 17 40
54 38 54 38
50 30 50 30
2 58 2 58
58 13 58 13
48 27 48 27
12 24 12 24
24 54 24 54
10 37 10 37
46 11 46 11...

output:

1854

result:

ok single line: '1854'

Test #26:

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

input:

94 392
10 77 10 77
77 51 77 51
44 52 44 52
52 51 52 51
65 90 65 90
80 9 80 9
50 27 50 27
26 57 26 57
90 49 90 49
94 14 94 14
24 6 24 6
19 80 19 80
13 77 13 77
33 73 33 73
45 83 45 83
48 73 48 73
67 12 67 12
36 28 36 28
82 18 82 18
10 80 10 80
66 33 66 33
16 34 16 34
88 13 88 13
7 29 7 29
41 65 41 65...

output:

4388

result:

ok single line: '4388'

Test #27:

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

input:

67 130
38 38 38 38
12 6 12 6
55 13 55 13
24 29 24 29
21 38 21 38
65 6 65 6
36 58 36 58
61 47 61 47
56 7 56 7
43 67 43 67
10 1 10 1
7 50 7 50
57 60 57 60
23 42 23 42
51 27 51 27
20 26 20 26
33 29 33 29
8 48 8 48
58 15 58 15
62 1 62 1
55 28 55 28
24 5 24 5
46 66 46 66
24 28 24 28
58 25 58 25
8 46 8 46...

output:

2238

result:

ok single line: '2238'

Test #28:

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

input:

65 620
19 61 19 61
52 63 52 63
46 11 46 11
17 11 17 11
32 9 32 9
21 55 21 55
14 44 14 44
53 51 53 51
28 25 28 25
27 59 27 59
14 34 14 34
62 23 62 23
24 56 24 56
64 51 64 51
42 43 42 43
48 46 48 46
51 46 51 46
45 22 45 22
23 36 23 36
33 1 33 1
4 36 4 36
27 1 27 1
57 19 57 19
49 1 49 1
61 2 61 2
63 50...

output:

2030

result:

ok single line: '2030'

Test #29:

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

input:

53 538
30 25 30 25
17 23 17 23
42 10 42 10
32 19 32 19
42 6 42 6
7 9 7 9
5 30 5 30
10 51 10 51
22 9 22 9
36 45 36 45
5 39 5 39
40 33 40 33
21 8 21 8
22 40 22 40
20 17 20 17
43 4 43 4
14 30 14 30
14 3 14 3
43 23 43 23
43 36 43 36
22 46 22 46
51 16 51 16
46 6 46 6
33 19 33 19
31 24 31 24
36 20 36 20
2...

output:

1402

result:

ok single line: '1402'

Test #30:

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

input:

66 833
54 9 54 9
9 58 9 58
40 38 40 38
66 40 66 40
56 2 56 2
49 9 49 9
49 32 49 32
18 23 18 23
5 51 5 51
58 48 58 48
39 27 39 27
50 62 50 62
22 32 22 32
49 48 49 48
35 31 35 31
26 15 26 15
62 52 62 52
33 14 33 14
3 17 3 17
1 22 1 22
29 57 29 57
60 19 60 19
35 25 35 25
36 15 36 15
58 39 58 39
29 10 2...

output:

2031

result:

ok single line: '2031'

Test #31:

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

input:

76 942
8 17 8 17
45 67 45 67
49 7 49 7
63 31 63 31
8 47 8 47
68 3 68 3
66 26 66 26
31 47 31 47
42 43 42 43
54 51 54 51
54 50 54 50
30 30 30 30
58 22 58 22
51 3 51 3
47 16 47 16
9 15 9 15
21 2 21 2
50 41 50 41
30 29 30 29
5 69 5 69
13 47 13 47
40 33 40 33
71 17 71 17
18 19 18 19
37 14 37 14
31 49 31 ...

output:

2818

result:

ok single line: '2818'

Test #32:

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

input:

51 996
39 14 39 14
15 41 15 41
7 26 7 26
47 28 47 28
38 12 38 12
13 49 13 49
7 38 7 38
48 29 48 29
28 33 28 33
16 16 16 16
17 49 17 49
16 35 16 35
13 30 13 30
41 26 41 26
1 4 1 4
27 40 27 40
40 11 40 11
37 48 37 48
12 9 12 9
14 1 14 1
1 37 1 37
36 7 36 7
47 12 47 12
28 2 28 2
12 8 12 8
23 12 23 12
2...

output:

1234

result:

ok single line: '1234'

Subtask #4:

score: 16
Accepted

Dependency #2:

100%
Accepted

Test #33:

score: 16
Accepted
time: 9ms
memory: 8992kb

input:

951 27387
498 551 498 551
473 607 473 607
34 412 34 412
235 309 235 309
669 533 669 533
326 206 326 206
820 566 820 566
708 684 708 684
765 192 765 192
437 719 437 719
640 241 640 241
752 327 752 327
677 433 677 433
227 769 227 769
561 182 561 182
813 480 813 480
486 108 486 108
930 705 930 705
473 ...

output:

404957

result:

ok single line: '404957'

Test #34:

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

input:

997 84199
816 858 816 858
867 339 867 339
48 144 48 144
602 605 602 605
246 432 246 432
461 795 461 795
767 478 767 478
606 851 606 851
88 169 88 169
660 484 660 484
186 907 186 907
16 846 16 846
739 919 739 919
756 464 756 464
525 34 525 34
161 508 161 508
161 135 161 135
290 878 290 878
139 823 13...

output:

496614

result:

ok single line: '496614'

Test #35:

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

input:

995 98903
812 180 812 180
208 3 208 3
989 882 989 882
752 405 752 405
928 344 928 344
407 923 407 923
45 545 45 545
732 51 732 51
659 674 659 674
144 526 144 526
901 713 901 713
354 159 354 159
926 345 926 345
338 759 338 759
786 907 786 907
380 127 380 127
56 136 56 136
836 864 836 864
772 44 772 4...

output:

479313

result:

ok single line: '479313'

Test #36:

score: 0
Accepted
time: 80ms
memory: 10368kb

input:

960 88310
3 682 3 682
1 188 1 188
822 937 822 937
159 619 159 619
944 633 944 633
750 439 750 439
702 431 702 431
504 513 504 513
384 344 384 344
215 798 215 798
366 113 366 113
956 278 956 278
144 109 144 109
809 806 809 806
69 947 69 947
119 63 119 63
957 798 957 798
529 325 529 325
767 59 767 59
...

output:

419856

result:

ok single line: '419856'

Test #37:

score: 0
Accepted
time: 98ms
memory: 10244kb

input:

960 98688
527 620 527 620
684 89 684 89
819 261 819 261
489 334 489 334
380 364 380 364
883 902 883 902
359 64 359 64
49 792 49 792
868 50 868 50
893 944 893 944
921 7 921 7
550 271 550 271
93 217 93 217
175 198 175 198
382 278 382 278
206 127 206 127
764 703 764 703
302 948 302 948
395 235 395 235
...

output:

420968

result:

ok single line: '420968'

Test #38:

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

input:

997 80944
838 518 838 518
68 710 68 710
270 343 270 343
766 3 766 3
915 519 915 519
512 235 512 235
669 304 669 304
292 869 292 869
490 142 490 142
441 313 441 313
289 649 289 649
264 391 264 391
796 438 796 438
47 850 47 850
155 597 155 597
938 106 938 106
827 160 827 160
423 933 423 933
700 226 70...

output:

496902

result:

ok single line: '496902'

Test #39:

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

input:

1000 452
536 100 536 100
315 886 315 886
900 842 900 842
249 135 249 135
696 2 696 2
675 140 675 140
739 975 739 975
358 255 358 255
972 143 972 143
30 18 30 18
313 820 313 820
947 209 947 209
628 4 628 4
271 659 271 659
528 522 528 522
457 709 457 709
832 994 832 994
180 583 180 583
241 576 241 576...

output:

479998

result:

ok single line: '479998'

Test #40:

score: 0
Accepted
time: 21ms
memory: 9340kb

input:

970 42341
130 398 130 398
43 267 43 267
152 807 152 807
362 376 362 376
793 156 793 156
666 260 666 260
891 399 891 399
709 333 709 333
722 236 722 236
405 480 405 480
700 166 700 166
150 864 150 864
627 657 627 657
611 539 611 539
17 747 17 747
20 524 20 524
448 929 448 929
470 850 470 850
235 258 ...

output:

453319

result:

ok single line: '453319'

Test #41:

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

input:

995 90058
511 885 511 885
527 974 527 974
410 866 410 866
904 157 904 157
250 697 250 697
63 988 63 988
274 600 274 600
732 47 732 47
584 58 584 58
440 349 440 349
384 743 384 743
334 146 334 146
33 394 33 394
266 349 266 349
456 459 456 459
828 672 828 672
615 5 615 5
608 49 608 49
450 781 450 781
...

output:

478912

result:

ok single line: '478912'

Test #42:

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

input:

969 8460
864 658 864 658
488 287 488 287
899 142 899 142
619 510 619 510
408 44 408 44
781 345 781 345
588 528 588 528
745 314 745 314
813 545 813 545
255 957 255 957
211 665 211 665
771 331 771 331
884 734 884 734
51 616 51 616
226 171 226 171
109 493 109 493
880 157 880 157
459 1 459 1
568 880 568...

output:

418466

result:

ok single line: '418466'

Test #43:

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

input:

955 56519
839 109 839 109
193 929 193 929
855 553 855 553
217 753 217 753
525 382 525 382
396 505 396 505
297 109 297 109
120 15 120 15
879 160 879 160
891 466 891 466
608 90 608 90
724 499 724 499
100 481 100 481
500 88 500 88
194 97 194 97
798 775 798 775
103 285 103 285
829 215 829 215
63 190 63 ...

output:

439975

result:

ok single line: '439975'

Test #44:

score: 0
Accepted
time: 22ms
memory: 10168kb

input:

964 67886
426 661 426 661
518 368 518 368
88 520 88 520
723 173 723 173
390 635 390 635
655 637 655 637
254 939 254 939
285 33 285 33
243 460 243 460
117 715 117 715
569 665 569 665
194 231 194 231
193 467 193 467
662 10 662 10
387 266 387 266
852 425 852 425
727 615 727 615
797 343 797 343
609 196 ...

output:

464330

result:

ok single line: '464330'

Test #45:

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

input:

958 95428
850 365 850 365
724 136 724 136
680 956 680 956
557 423 557 423
335 832 335 832
413 272 413 272
587 757 587 757
890 307 890 307
756 424 756 424
221 303 221 303
647 731 647 731
2 606 2 606
877 890 877 890
278 632 278 632
411 837 411 837
679 507 679 507
638 93 638 93
249 404 249 404
230 609 ...

output:

458568

result:

ok single line: '458568'

Test #46:

score: 0
Accepted
time: 16ms
memory: 9208kb

input:

971 33239
281 301 281 301
332 762 332 762
880 766 880 766
394 44 394 44
170 729 170 729
647 241 647 241
689 296 689 296
729 240 729 240
365 521 365 521
351 283 351 283
303 479 303 479
565 891 565 891
820 705 820 705
546 683 546 683
657 464 657 464
10 532 10 532
642 406 642 406
88 266 88 266
549 517 ...

output:

471397

result:

ok single line: '471397'

Test #47:

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

input:

982 2680
707 794 707 794
924 976 924 976
771 496 771 496
757 224 757 224
572 397 572 397
324 319 324 319
325 55 325 55
530 912 530 912
4 388 4 388
799 303 799 303
502 150 502 150
833 19 833 19
159 676 159 676
505 331 505 331
564 134 564 134
335 295 335 295
476 300 476 300
889 553 889 553
643 569 643...

output:

482066

result:

ok single line: '482066'

Subtask #5:

score: 23
Accepted

Test #48:

score: 23
Accepted
time: 162ms
memory: 11920kb

input:

99774 82706
29912 70150 29912 70150
93471 873 93471 873
64978 14740 64978 14740
57016 16856 57016 16856
93392 19170 93392 19170
28713 63187 28713 63187
65553 40025 65553 40025
97816 38346 97816 38346
4184 36771 4184 36771
63515 21172 63515 21172
39860 95092 39860 95092
62818 96699 62818 96699
74942 ...

output:

4424387268

result:

ok single line: '4424387268'

Test #49:

score: 0
Accepted
time: 64ms
memory: 12360kb

input:

99977 93922
21409 34520 21409 34520
86353 53283 86353 53283
63290 57739 63290 57739
29449 23631 29449 23631
61783 79678 61783 79678
67827 84598 67827 84598
8089 36213 8089 36213
55853 38651 55853 38651
31913 29808 31913 29808
64350 59529 64350 59529
83870 62529 83870 62529
13404 87928 13404 87928
34...

output:

4980407190

result:

ok single line: '4980407190'

Test #50:

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

input:

99891 83172
90303 85558 90303 85558
33844 73421 33844 73421
88863 39217 88863 39217
72109 49051 72109 49051
25659 79842 25659 79842
88028 57170 88028 57170
47005 41021 47005 41021
71160 95622 71160 95622
82507 28307 82507 28307
69704 36555 69704 36555
38845 55126 38845 55126
33823 6085 33823 6085
11...

output:

4434769828

result:

ok single line: '4434769828'

Test #51:

score: 0
Accepted
time: 60ms
memory: 12208kb

input:

99993 90989
79270 14288 79270 14288
85646 79349 85646 79349
52895 28799 52895 28799
89240 68108 89240 68108
47521 63032 47521 63032
91833 65207 91833 65207
56215 81968 56215 81968
54407 91291 54407 91291
87242 34284 87242 34284
64307 56530 64307 56530
91507 78113 91507 78113
12306 64739 12306 64739
...

output:

4443832367

result:

ok single line: '4443832367'

Test #52:

score: 0
Accepted
time: 53ms
memory: 12524kb

input:

99833 97797
91728 33605 91728 33605
56240 1921 56240 1921
52574 2978 52574 2978
66080 84364 66080 84364
96774 46832 96774 46832
90534 78850 90534 78850
37084 57175 37084 57175
96960 74901 96960 74901
1279 85780 1279 85780
67037 80864 67037 80864
63532 14457 63532 14457
91656 16250 91656 16250
35743 ...

output:

4983313553

result:

ok single line: '4983313553'

Test #53:

score: 0
Accepted
time: 158ms
memory: 12252kb

input:

99788 92629
6234 39317 6234 39317
65115 28113 65115 28113
47733 59631 47733 59631
99682 1524 99682 1524
30100 75836 30100 75836
89177 90525 89177 90525
87553 50091 87553 50091
73512 77248 73512 77248
22064 97557 22064 97557
63750 44736 63750 44736
2399 96025 2399 96025
29905 88427 29905 88427
54191 ...

output:

4949362925

result:

ok single line: '4949362925'

Test #54:

score: 0
Accepted
time: 57ms
memory: 12108kb

input:

99713 85568
43719 78844 43719 78844
33991 59935 33991 59935
92925 27684 92925 27684
60286 18810 60286 18810
61410 15158 61410 15158
85740 19367 85740 19367
43352 47681 43352 47681
47811 52636 47811 52636
93092 52225 93092 52225
36943 73559 36943 73559
59912 57408 59912 57408
60639 87392 60639 87392
...

output:

4971341116

result:

ok single line: '4971341116'

Test #55:

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

input:

99883 86910
55536 1053 55536 1053
21242 23495 21242 23495
45485 56205 45485 56205
50620 73711 50620 73711
23850 55731 23850 55731
37260 16224 37260 16224
2259 23390 2259 23390
96517 89046 96517 89046
77483 29174 77483 29174
95366 60764 95366 60764
57536 36070 57536 36070
56850 8416 56850 8416
16038 ...

output:

4886506698

result:

ok single line: '4886506698'

Test #56:

score: 0
Accepted
time: 64ms
memory: 11884kb

input:

99983 83817
58795 99486 58795 99486
21058 4598 21058 4598
61620 11559 61620 11559
34661 78688 34661 78688
77815 68520 77815 68520
21591 16288 21591 16288
20346 36445 20346 36445
76817 27129 76817 27129
76177 31402 76177 31402
44392 5997 44392 5997
25117 81175 25117 81175
55373 62174 55373 62174
6204...

output:

4968724747

result:

ok single line: '4968724747'

Test #57:

score: 0
Accepted
time: 580ms
memory: 12092kb

input:

83160 90683
25845 47632 25845 47632
55730 52535 55730 52535
78252 71397 78252 71397
23041 36989 23041 36989
76643 31953 76643 31953
55555 13626 55555 13626
51598 76034 51598 76034
6152 49447 6152 49447
6383 46914 6383 46914
13306 1647 13306 1647
26282 55141 26282 55141
70184 34713 70184 34713
21879 ...

output:

3073603429

result:

ok single line: '3073603429'

Test #58:

score: 0
Accepted
time: 641ms
memory: 12176kb

input:

83160 96664
9683 34570 9683 34570
65381 4539 65381 4539
54199 61055 54199 61055
32492 77890 32492 77890
75266 54094 75266 54094
36306 39491 36306 39491
75167 75004 75167 75004
2105 1003 2105 1003
28218 54030 28218 54030
44257 61634 44257 61634
80782 24311 80782 24311
1767 40165 1767 40165
17209 3608...

output:

3073604510

result:

ok single line: '3073604510'

Test #59:

score: 0
Accepted
time: 584ms
memory: 12064kb

input:

83160 90066
17246 35100 17246 35100
16401 7141 16401 7141
2153 46311 2153 46311
63120 19021 63120 19021
31332 27577 31332 27577
16459 73661 16459 73661
73020 14553 73020 14553
8592 50820 8592 50820
29146 27390 29146 27390
55298 9062 55298 9062
51993 11352 51993 11352
57512 1418 57512 1418
43466 2498...

output:

3073603936

result:

ok single line: '3073603936'

Test #60:

score: 0
Accepted
time: 610ms
memory: 12160kb

input:

83160 96055
55170 62983 55170 62983
23300 53840 23300 53840
58900 35766 58900 35766
67659 66360 67659 66360
21058 55920 21058 55920
76646 44549 76646 44549
48799 30620 48799 30620
80059 59190 80059 59190
3663 66844 3663 66844
74846 74009 74846 74009
8630 38104 8630 38104
3800 72902 3800 72902
18135 ...

output:

3073604031

result:

ok single line: '3073604031'

Test #61:

score: 0
Accepted
time: 555ms
memory: 12100kb

input:

83160 88739
7851 37290 7851 37290
64008 56336 64008 56336
53191 5264 53191 5264
55806 23639 55806 23639
14639 44993 14639 44993
25170 68187 25170 68187
81926 34670 81926 34670
82281 62162 82281 62162
37378 4624 37378 4624
13883 10243 13883 10243
40819 60647 40819 60647
52059 46491 52059 46491
59007 ...

output:

3073604053

result:

ok single line: '3073604053'

Test #62:

score: 0
Accepted
time: 613ms
memory: 12352kb

input:

83160 99749
71811 24541 71811 24541
38479 48869 38479 48869
57110 23821 57110 23821
20981 79024 20981 79024
65206 67143 65206 67143
48049 56897 48049 56897
65239 76602 65239 76602
60016 888 60016 888
51062 50682 51062 50682
48106 36394 48106 36394
75390 1606 75390 1606
62923 17186 62923 17186
48628 ...

output:

3073605119

result:

ok single line: '3073605119'

Test #63:

score: 0
Accepted
time: 576ms
memory: 11888kb

input:

83160 86087
66621 78656 66621 78656
17938 7207 17938 7207
9652 10634 9652 10634
44941 74110 44941 74110
72108 44206 72108 44206
61161 45954 61161 45954
19292 70041 19292 70041
2495 66921 2495 66921
82177 7349 82177 7349
35685 40230 35685 40230
69339 36702 69339 36702
14838 25057 14838 25057
56022 62...

output:

3073603143

result:

ok single line: '3073603143'

Subtask #6:

score: 30
Accepted

Dependency #1:

100%
Accepted

Dependency #2:

100%
Accepted

Dependency #3:

100%
Accepted

Dependency #4:

100%
Accepted

Dependency #5:

100%
Accepted

Test #64:

score: 30
Accepted
time: 664ms
memory: 11400kb

input:

83160 93358
68289 35885 80691 63455
81214 43346 82261 49430
70807 31687 76195 35027
82385 46890 82891 76920
82272 58671 82328 60823
83013 68708 83127 77537
19766 29379 49613 37117
82279 62009 82315 69327
83129 69819 83135 79688
24322 54069 47964 60209
80994 54271 82042 72296
82375 65006 82376 68574
...

output:

3036122639

result:

ok single line: '3036122639'

Test #65:

score: 0
Accepted
time: 650ms
memory: 11428kb

input:

83160 93062
56990 40408 76540 56520
55466 69581 71866 71576
72425 71710 73297 78781
35386 17468 42736 48316
66450 13962 68150 32043
62711 17337 64059 19451
75848 71516 75887 71705
64799 39715 64828 39857
72310 76471 72410 76881
75904 17505 81597 39610
64658 15645 64969 17114
62914 8886 63601 14590
7...

output:

3112990308

result:

ok single line: '3112990308'

Test #66:

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

input:

83160 80786
28047 31723 63126 51888
46383 63592 59027 71874
61698 64512 61891 76286
28266 5332 35804 28025
28061 23942 28248 27124
40435 76452 51946 78372
28054 2585 28055 15702
33570 70962 34236 71850
62747 71230 63007 77894
55385 72719 57168 74991
61152 66257 61669 72067
28057 75 28059 290
62815 7...

output:

2797922557

result:

ok single line: '2797922557'

Test #67:

score: 0
Accepted
time: 509ms
memory: 10988kb

input:

83160 89363
58515 51945 78606 80192
83092 71408 83155 76994
79062 67265 79673 73243
79886 76891 80976 76900
79325 76175 79387 76261
72719 80948 73901 81833
83156 73416 83157 78406
78654 53228 78840 71185
78728 52752 78734 52989
78827 53120 78914 53142
78808 53007 78811 53090
83156 79664 83156 81637
...

output:

3108957950

result:

ok single line: '3108957950'

Test #68:

score: 0
Accepted
time: 545ms
memory: 11008kb

input:

83160 88511
73897 45834 75942 57320
80008 81404 83109 82212
83113 82531 83159 83055
83112 81433 83112 82481
83112 83003 83112 83030
77661 47408 77872 55819
77864 76511 77864 76646
83112 83044 83112 83050
76303 78406 77222 78773
77870 81741 77872 81988
83126 83156 83130 83159
79840 45889 79974 46764
...

output:

3168760110

result:

ok single line: '3168760110'

Test #69:

score: 0
Accepted
time: 556ms
memory: 11088kb

input:

83160 86504
66640 81926 79383 82890
17523 83126 33278 83150
67521 83106 73053 83110
82509 82651 82624 82830
74567 82995 78421 83067
78661 83088 79007 83091
78522 82997 78648 83062
79731 81956 80218 82488
74719 83108 79286 83112
79366 83113 79374 83120
78509 83039 78519 83057
79383 83117 79383 83121
...

output:

3316637130

result:

ok single line: '3316637130'

Test #70:

score: 0
Accepted
time: 616ms
memory: 11156kb

input:

83160 84863
49663 30118 51862 51725
40750 63826 49931 74339
47743 76629 47768 80007
77282 61756 78867 67377
48437 76612 49750 76620
83091 51064 83126 54209
10719 24250 25641 28691
49983 78926 51693 80050
82569 77501 82640 83150
79711 79560 82177 82957
48916 75753 49242 75970
83103 42741 83135 47535
...

output:

3312212659

result:

ok single line: '3312212659'

Test #71:

score: 0
Accepted
time: 621ms
memory: 11244kb

input:

83160 92579
19945 57676 80239 64443
64389 25697 75320 41868
2619 1941 3817 39953
779 59012 3304 63431
68835 24815 71360 24934
75666 29491 80662 43030
83073 72319 83143 76574
39015 77961 61340 78630
81614 28975 82512 29454
81661 11859 82890 16527
25412 48441 55832 53876
81504 28187 81512 28872
80646 ...

output:

3029830989

result:

ok single line: '3029830989'

Test #72:

score: 0
Accepted
time: 550ms
memory: 10992kb

input:

83160 87422
47974 19177 75815 64548
82839 38893 82921 82329
54008 80505 54761 81508
74014 75245 75273 77447
82930 67459 83042 81660
75623 78621 75719 80143
82923 39087 82926 48316
82940 82071 83024 82614
82922 39341 82922 42450
77638 72365 78746 73244
83033 82898 83039 82929
83023 81903 83032 82004
...

output:

3202112344

result:

ok single line: '3202112344'

Test #73:

score: 0
Accepted
time: 619ms
memory: 11524kb

input:

83160 93765
46401 34354 56550 66792
73453 77778 75327 78607
64779 81215 68094 82164
59260 81288 62240 81486
24490 77152 43269 81835
58627 82845 59249 83008
17030 75512 23585 81060
43991 78686 54140 79005
53570 77592 54848 77795
80803 20 82265 22761
72622 9860 73657 14113
78874 80996 80861 81708
5762...

output:

3083195729

result:

ok single line: '3083195729'

Test #74:

score: 0
Accepted
time: 126ms
memory: 11660kb

input:

99814 98265
54265 43195 73992 96315
47318 97147 69892 98813
72797 98500 73315 99697
4920 99169 56551 99625
80980 29173 94444 31523
64286 99470 65111 99612
10978 97288 40235 97831
1006 99143 2481 99363
72995 98040 73979 98099
85330 67097 98357 86945
69696 99326 69881 99467
73823 99152 73890 99808
739...

output:

4806177885

result:

ok single line: '4806177885'

Test #75:

score: 0
Accepted
time: 62ms
memory: 11652kb

input:

99887 91031
49650 10700 77067 14462
54025 805 92454 5926
49749 262 52254 1067
49588 1620 49607 11742
3045 12533 10347 13250
99422 63957 99782 97402
40873 12297 48511 12428
63250 8848 63466 8997
76051 75898 76056 77553
79677 602 87762 608
13933 11767 35593 12219
93327 7062 97856 7816
65139 8348 79155...

output:

4988266528

result:

ok single line: '4988266528'

Test #76:

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

input:

99716 84632
17486 66197 53430 88386
6004 24566 7075 26407
60340 83216 62630 91701
19145 94512 23942 98771
8685 80111 8913 81692
27952 96212 30794 96461
23016 94007 39052 94364
4716 6964 4811 12646
5681 1914 5928 2530
22716 88900 22973 93747
5686 1383 5870 1470
56650 96893 59591 99338
37327 94491 384...

output:

4623269909

result:

ok single line: '4623269909'

Test #77:

score: 0
Accepted
time: 119ms
memory: 11208kb

input:

99716 88540
21678 44888 63922 69139
70054 92728 74851 95376
67905 79097 68437 86856
75798 47478 89057 87993
98738 53602 99641 86800
73758 84003 74374 87565
6079 38216 15433 45727
72853 53425 73028 69994
70539 48329 72449 66081
64687 89640 64932 94957
99616 48591 99627 52370
89194 89245 97073 90830
6...

output:

4780661743

result:

ok single line: '4780661743'

Test #78:

score: 0
Accepted
time: 95ms
memory: 11432kb

input:

99909 81534
62829 19017 65364 71709
51802 87460 59271 96687
82826 80514 86248 85677
63955 74358 64442 84471
7387 83690 39768 91079
10571 78008 14671 82887
77017 51119 79520 83954
87309 89047 95119 91581
20052 17980 20546 25581
15493 98617 58387 98951
50872 65977 61983 67441
4188 96734 11588 98423
50...

output:

4900919128

result:

ok single line: '4900919128'

Test #79:

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

input:

99717 94496
29879 12438 66685 24314
95975 79556 96816 85961
22359 2004 23445 16906
16745 570 22217 9244
25464 23749 28212 24061
26810 24159 27804 24236
22228 3920 22244 11177
88750 59673 95156 65295
89245 90287 90181 96066
95211 57722 95804 58438
28385 23950 29568 24296
91702 33202 94523 41366
95332...

output:

4258108949

result:

ok single line: '4258108949'

Test #80:

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

input:

99772 85568
32557 45118 76657 61864
78864 43543 98630 43877
88683 26888 96294 43251
28999 15102 29980 47190
18893 49493 28013 54264
98886 43837 99772 43985
98510 35267 98711 43278
99176 30766 99227 34232
31944 5804 32516 13458
98087 15687 99654 18027
44395 13202 69531 38152
82574 43269 87348 43381
9...

output:

4588954930

result:

ok single line: '4588954930'

Test #81:

score: 0
Accepted
time: 396ms
memory: 11464kb

input:

99900 96335
60183 66133 62639 68302
46613 98664 60073 99747
7127 99852 39766 99894
30878 99830 41673 99843
3021 61478 17261 64471
98612 98811 98894 99565
50761 93217 54194 97306
58210 93800 60743 95871
58211 73317 62550 82729
33071 99846 36466 99850
51307 98093 52528 98330
68765 78534 94000 99174
62...

output:

3716965952

result:

ok single line: '3716965952'

Test #82:

score: 0
Accepted
time: 617ms
memory: 11216kb

input:

83160 99358
5749 64133 71828 80541
2937 48282 2986 60025
3381 21139 4580 28059
58483 9861 64328 59657
4210 8426 5631 12717
79926 80687 82656 82716
82825 81521 83119 81559
3969 5876 4057 6281
82609 67206 82859 67838
5614 72210 5706 77189
80936 66485 81962 66766
81710 65737 82454 66286
77910 23836 830...

output:

3276607065

result:

ok single line: '3276607065'

Test #83:

score: 0
Accepted
time: 80ms
memory: 8340kb

input:

83160 62
12185 33984 77492 53116
7348 56659 64458 60280
30550 18067 34197 26268
67146 65922 71869 66747
38431 56636 77083 56641
72956 59110 74025 65402
6327 58826 6868 59027
66820 58990 66936 66398
75013 82010 75375 83082
67098 58129 67134 58922
67122 57450 67123 58076
66719 64501 66735 65920
28722 ...

output:

2907600256

result:

ok single line: '2907600256'

Test #84:

score: 0
Accepted
time: 78ms
memory: 8276kb

input:

83160 6
7190 796 41978 74999
8157 550 75108 660
6248 27981 6775 55639
7915 466 8043 547
37485 686 57216 691
8039 308 8064 420

output:

3178100632

result:

ok single line: '3178100632'

Test #85:

score: 0
Accepted
time: 626ms
memory: 11480kb

input:

83160 99363
36658 59090 82051 81797
80511 24227 82413 46771
82432 69021 82859 69079
81057 57111 81149 58181
30124 81999 69637 82877
82920 75792 82979 82645
45264 58829 74447 58972
67996 59083 70385 59086
3947 27168 15486 78032
82197 68218 82253 68226
83159 78051 83160 78597
71985 59089 72672 59089
3...

output:

3116489733

result:

ok single line: '3116489733'

Test #86:

score: 0
Accepted
time: 190ms
memory: 8876kb

input:

83160 18511
23549 27423 51955 80738
69055 45118 74946 54656
56986 39814 62744 43290
79926 2396 82505 22436
67617 47907 67819 54194
68513 42565 68619 45539
77479 82277 78697 82295
75045 52831 77033 63415
79377 34936 80806 44356
76774 67099 76931 75740
75685 50853 77169 51065
68913 46598 68976 47553
5...

output:

3124679865

result:

ok single line: '3124679865'

Test #87:

score: 0
Accepted
time: 80ms
memory: 8272kb

input:

83160 4
1033 12653 20282 69536
43466 3762 46899 12116
60301 1808 71718 2662
751 7886 968 41787

output:

3083719344

result:

ok single line: '3083719344'