QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#106475#6372. DanceDitaMirikaWA 3692ms3496kbC++14979b2023-05-17 21:08:552023-05-17 21:08:59

Details

Tip: Click on the bar to expand more detailed information

Test #1:

score: 100
Accepted
time: 5ms
memory: 3296kb

input:

3 1 2 1
4 1 7

output:

5

result:

ok 1 number(s): "5"

Test #2:

score: 0
Accepted
time: 8ms
memory: 3328kb

input:

3 1 7 1
4 1 7

output:

11

result:

ok 1 number(s): "11"

Test #3:

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

input:

1 1 441060 865580
6

output:

441060

result:

ok 1 number(s): "441060"

Test #4:

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

input:

1 2 524484 157528
88

output:

524484

result:

ok 1 number(s): "524484"

Test #5:

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

input:

1 3 607908 706373
65

output:

607908

result:

ok 1 number(s): "607908"

Test #6:

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

input:

1 1 724036 287921
39

output:

724036

result:

ok 1 number(s): "724036"

Test #7:

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

input:

1 4 807460 804061
17

output:

807460

result:

ok 1 number(s): "807460"

Test #8:

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

input:

1 7 974308 869046
72

output:

974308

result:

ok 1 number(s): "974308"

Test #9:

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

input:

1 4 221588 389967
17

output:

221588

result:

ok 1 number(s): "221588"

Test #10:

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

input:

1 9 704116 877292
5

output:

704116

result:

ok 1 number(s): "704116"

Test #11:

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

input:

1 3 820703 814856
86

output:

820703

result:

ok 1 number(s): "820703"

Test #12:

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

input:

1 29 195626 207042
54

output:

195626

result:

ok 1 number(s): "195626"

Test #13:

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

input:

1 19 794740 856124
14

output:

794740

result:

ok 1 number(s): "794740"

Test #14:

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

input:

1 28 444117 184242
58

output:

444117

result:

ok 1 number(s): "444117"

Test #15:

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

input:

1 32 527541 733087
27

output:

527541

result:

ok 1 number(s): "527541"

Test #16:

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

input:

1 21 610965 281931
9

output:

610965

result:

ok 1 number(s): "610965"

Test #17:

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

input:

1 7 393855 215606
79

output:

393855

result:

ok 1 number(s): "393855"

Test #18:

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

input:

2 1 228470 977748
3 41

output:

456940

result:

ok 1 number(s): "456940"

Test #19:

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

input:

2 2 344598 526593
80 2

output:

689196

result:

ok 1 number(s): "689196"

Test #20:

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

input:

2 2 428022 42733
62 56

output:

513488

result:

ok 1 number(s): "513488"

Test #21:

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

input:

2 2 511446 591577
28 9

output:

1022892

result:

ok 1 number(s): "1022892"

Test #22:

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

input:

2 1 594870 883526
5 67

output:

1189740

result:

ok 1 number(s): "1189740"

Test #23:

score: 0
Accepted
time: 7ms
memory: 3380kb

input:

2 2 794422 13919
65 74

output:

864017

result:

ok 1 number(s): "864017"

Test #24:

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

input:

2 1 883770 771924
1 15

output:

1767540

result:

ok 1 number(s): "1767540"

Test #25:

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

input:

2 1 333594 259250
89 95

output:

667188

result:

ok 1 number(s): "667188"

Test #26:

score: 0
Accepted
time: 7ms
memory: 3324kb

input:

2 11 482884 164110
69 4

output:

965768

result:

ok 1 number(s): "965768"

Test #27:

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

input:

2 14 49295 556296
29 97

output:

98590

result:

ok 1 number(s): "98590"

Test #28:

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

input:

2 12 424218 948481
98 86

output:

848436

result:

ok 1 number(s): "848436"

Test #29:

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

input:

2 17 73594 533496
33 77

output:

147188

result:

ok 1 number(s): "147188"

Test #30:

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

input:

2 25 157018 49636
15 38

output:

314036

result:

ok 1 number(s): "314036"

Test #31:

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

input:

2 11 273146 631185
92 92

output:

273146

result:

ok 1 number(s): "273146"

Test #32:

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

input:

2 34 23333 340667
58 79

output:

46666

result:

ok 1 number(s): "46666"

Test #33:

score: 0
Accepted
time: 7ms
memory: 3496kb

input:

3 1 791688 281405
92 12 7

output:

2375064

result:

ok 1 number(s): "2375064"

Test #34:

score: 0
Accepted
time: 7ms
memory: 3480kb

input:

3 1 907816 606057
73 61 76

output:

2421689

result:

ok 1 number(s): "2421689"

Test #35:

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

input:

3 2 991240 154901
43 23 53

output:

2911886

result:

ok 1 number(s): "2911886"

Test #36:

score: 0
Accepted
time: 7ms
memory: 3292kb

input:

3 2 107368 703746
20 76 30

output:

322104

result:

ok 1 number(s): "322104"

Test #37:

score: 0
Accepted
time: 7ms
memory: 3380kb

input:

3 5 158088 252590
2 30 94

output:

474264

result:

ok 1 number(s): "474264"

Test #38:

score: 0
Accepted
time: 7ms
memory: 3292kb

input:

3 5 390344 317575
61 41 44

output:

1171032

result:

ok 1 number(s): "1171032"

Test #39:

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

input:

3 6 513247 896986
88 3 16

output:

1539741

result:

ok 1 number(s): "1539741"

Test #40:

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

input:

3 15 963072 384312
72 83 85

output:

2694768

result:

ok 1 number(s): "2694768"

Test #41:

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

input:

3 12 112362 513363
44 96 5

output:

337086

result:

ok 1 number(s): "337086"

Test #42:

score: 0
Accepted
time: 7ms
memory: 3432kb

input:

3 20 711477 872845
13 85 98

output:

2134431

result:

ok 1 number(s): "2134431"

Test #43:

score: 0
Accepted
time: 7ms
memory: 3384kb

input:

3 29 310592 297735
69 74 90

output:

931776

result:

ok 1 number(s): "931776"

Test #44:

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

input:

3 12 959968 882750
20 65 8

output:

2879904

result:

ok 1 number(s): "2879904"

Test #45:

score: 0
Accepted
time: 7ms
memory: 3340kb

input:

3 18 43392 431594
94 22 73

output:

130176

result:

ok 1 number(s): "130176"

Test #46:

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

input:

3 11 126816 756246
68 76 50

output:

380448

result:

ok 1 number(s): "380448"

Test #47:

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

input:

3 49 685514 689921
41 59 83

output:

2056542

result:

ok 1 number(s): "2056542"

Test #48:

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

input:

10 1 251127 64273
86 86 27 41 99 63 58 16 98 14

output:

1763854

result:

ok 1 number(s): "1763854"

Test #49:

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

input:

10 2 334552 580414
67 40 92 25 91 27 40 56 42 4

output:

3010968

result:

ok 1 number(s): "3010968"

Test #50:

score: 0
Accepted
time: 15ms
memory: 3320kb

input:

10 3 417976 905066
45 1 69 100 75 82 22 99 85 94

output:

3343808

result:

ok 1 number(s): "3343808"

Test #51:

score: 0
Accepted
time: 27ms
memory: 3388kb

input:

10 1 534104 453910
19 55 41 83 59 38 4 39 25 85

output:

4192638

result:

ok 1 number(s): "4192638"

Test #52:

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

input:

10 1 617528 2755
96 4 10 67 47 97 87 83 69 83

output:

868233

result:

ok 1 number(s): "868233"

Test #53:

score: 0
Accepted
time: 37ms
memory: 3340kb

input:

10 6 784376 67739
51 19 60 25 23 16 51 66 64 68

output:

2652576

result:

ok 1 number(s): "2652576"

Test #54:

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

input:

10 3 624048 730227
9 22 29 1 17 18 86 58 63 47

output:

6240480

result:

ok 1 number(s): "6240480"

Test #55:

score: 0
Accepted
time: 29ms
memory: 3452kb

input:

10 14 73873 217553
97 98 93 1 57 8 93 72 86 6

output:

664857

result:

ok 1 number(s): "664857"

Test #56:

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

input:

10 3 966267 122413
77 15 21 60 56 60 4 73 31 50

output:

5565813

result:

ok 1 number(s): "5565813"

Test #57:

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

input:

10 5 565382 514598
45 95 14 30 92 5 10 72 96 49

output:

5552252

result:

ok 1 number(s): "5552252"

Test #58:

score: 0
Accepted
time: 36ms
memory: 3256kb

input:

10 27 164497 163680
2 88 7 89 35 38 17 83 56 48

output:

1315159

result:

ok 1 number(s): "1315159"

Test #59:

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

input:

10 47 813873 491799
49 83 20 52 51 47 96 76 62 96

output:

7002783

result:

ok 1 number(s): "7002783"

Test #60:

score: 0
Accepted
time: 41ms
memory: 3384kb

input:

10 41 897297 40643
19 37 85 35 43 6 79 16 5 86

output:

2766875

result:

ok 1 number(s): "2766875"

Test #61:

score: 0
Accepted
time: 23ms
memory: 3248kb

input:

10 21 13425 622191
96 98 66 19 31 62 57 59 53 76

output:

134250

result:

ok 1 number(s): "134250"

Test #62:

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

input:

10 28 763611 555866
70 81 99 56 78 80 35 94 12 55

output:

7220620

result:

ok 1 number(s): "7220620"

Test #63:

score: 0
Accepted
time: 491ms
memory: 3340kb

input:

50 1 25934 980199
7 38 53 71 65 42 31 57 74 74 59 35 2 33 12 14 70 90 52 78 69 7 17 55 71 21 21 83 42 14 42 61 84 2 79 88 9 67 9 32 27 6 23 40 73 91 98 95 8 68

output:

752086

result:

ok 1 number(s): "752086"

Test #64:

score: 0
Accepted
time: 504ms
memory: 3288kb

input:

50 1 109358 496340
89 96 30 54 49 1 13 1 18 65 92 50 20 51 62 32 23 30 38 92 40 64 33 76 32 34 91 1 20 17 79 69 80 36 50 22 16 64 24 13 86 94 7 48 13 5 69 13 56 65

output:

2733950

result:

ok 1 number(s): "2733950"

Test #65:

score: 0
Accepted
time: 533ms
memory: 3440kb

input:

50 1 225486 77888
62 53 94 29 41 61 95 40 62 55 33 73 29 73 21 50 64 83 20 1 23 21 50 97 85 50 62 27 86 4 11 78 88 62 25 59 27 65 34 2 32 83 90 59 57 23 24 23 3 47

output:

4239058

result:

ok 1 number(s): "4239058"

Test #66:

score: 0
Accepted
time: 682ms
memory: 3380kb

input:

50 4 308910 626732
40 7 71 16 29 16 77 84 9 57 63 84 46 92 75 72 8 31 97 10 3 86 58 14 46 62 32 53 69 95 48 83 88 96 96 1 41 53 57 87 87 80 66 71 1 37 95 36 55 32

output:

8340570

result:

ok 1 number(s): "8340570"

Test #67:

score: 0
Accepted
time: 539ms
memory: 3376kb

input:

50 1 392334 142873
13 60 44 96 17 76 60 24 53 47 4 11 63 14 33 90 57 80 83 24 90 43 66 35 99 87 98 71 39 83 80 92 96 21 71 38 52 50 71 72 45 68 49 83 37 59 49 62 7 25

output:

8420439

result:

ok 1 number(s): "8420439"

Test #68:

score: 0
Accepted
time: 674ms
memory: 3288kb

input:

50 4 591886 16370
73 75 94 58 93 87 20 11 40 32 74 45 1 51 46 35 47 73 39 42 44 61 95 66 25 16 43 23 84 73 45 5 5 85 13 14 77 44 4 42 54 54 21 6 25 91 75 90 7 7

output:

1999706

result:

ok 1 number(s): "1999706"

Test #69:

score: 0
Accepted
time: 913ms
memory: 3328kb

input:

50 5 488402 58390
75 79 98 42 53 67 94 78 66 81 57 1 63 47 11 87 39 16 92 37 31 39 63 43 92 9 92 61 41 98 43 30 94 1 66 52 94 76 31 98 98 77 23 31 24 99 32 51 57 30

output:

4347598

result:

ok 1 number(s): "4347598"

Test #70:

score: 0
Accepted
time: 512ms
memory: 3432kb

input:

50 1 970930 545716
64 63 62 50 85 53 5 80 88 45 27 100 45 44 98 86 59 47 97 99 35 32 32 32 89 87 39 76 5 62 8 66 11 54 37 52 47 68 11 31 70 44 37 96 28 89 42 32 16 72

output:

22508686

result:

ok 1 number(s): "22508686"

Test #71:

score: 0
Accepted
time: 1295ms
memory: 3340kb

input:

50 18 863325 450576
32 72 91 13 88 9 4 77 30 88 58 7 73 96 55 88 17 4 56 53 59 66 69 11 10 56 18 55 58 5 11 23 41 37 6 99 53 86 27 1 96 68 2 93 40 58 65 74 3 95

output:

20196918

result:

ok 1 number(s): "20196918"

Test #72:

score: 0
Accepted
time: 897ms
memory: 3400kb

input:

50 6 462439 99657
100 61 75 75 32 50 18 88 94 87 67 13 83 48 6 93 7 3 17 69 90 86 75 84 27 2 37 48 68 8 84 16 88 64 37 57 21 9 20 88 90 55 73 52 69 13 3 5 42 68

output:

5700533

result:

ok 1 number(s): "5700533"

Test #73:

score: 0
Accepted
time: 1430ms
memory: 3336kb

input:

50 30 61554 491843
61 53 72 42 63 95 29 3 59 86 68 6 92 100 54 87 1 99 89 81 18 13 80 64 37 56 59 38 94 15 53 10 42 100 72 100 80 20 12 80 84 50 44 2 90 72 36 23 89 29

output:

2092836

result:

ok 1 number(s): "2092836"

Test #74:

score: 0
Accepted
time: 1954ms
memory: 3292kb

input:

50 37 710931 44154
8 40 82 5 79 96 4 89 64 30 13 39 96 45 46 33 22 31 53 62 81 24 66 96 51 63 55 97 11 57 95 67 72 8 81 66 63 98 18 71 69 91 22 87 78 2 75 31 32 57

output:

3713403

result:

ok 1 number(s): "3713403"

Test #75:

score: 0
Accepted
time: 1101ms
memory: 3400kb

input:

50 11 761651 401510
86 2 54 81 71 51 87 32 8 24 46 66 13 60 8 51 67 79 31 71 64 81 74 18 4 71 22 19 81 48 24 76 76 38 55 4 69 98 40 52 23 88 9 99 18 20 33 41 83 46

output:

16284254

result:

ok 1 number(s): "16284254"

Test #76:

score: 0
Accepted
time: 1391ms
memory: 3384kb

input:

50 42 877779 917651
59 55 27 64 59 11 73 76 56 23 83 77 34 86 58 73 20 24 9 80 35 38 91 39 65 92 92 45 55 47 60 89 80 68 30 42 76 91 51 44 78 77 89 6 62 30 100 59 35 35

output:

32477823

result:

ok 1 number(s): "32477823"

Test #77:

score: 0
Accepted
time: 1368ms
memory: 3292kb

input:

50 48 403773 884029
29 42 61 5 7 37 39 6 15 89 61 8 2 52 6 92 87 95 57 96 50 45 86 33 54 99 86 31 11 26 26 11 89 28 3 46 51 31 9 75 81 41 19 61 11 27 73 42 28 5

output:

14939601

result:

ok 1 number(s): "14939601"

Test #78:

score: 0
Accepted
time: 2185ms
memory: 3392kb

input:

96 1 726546 433200
80 74 23 52 97 75 73 12 69 49 95 69 69 18 30 6 5 86 66 80 76 90 67 27 7 56 99 50 97 6 70 42 22 31 50 27 13 41 47 6 12 5 32 29 47 22 8 10 77 66 86 85 90 3 85 17 63 48 13 75 58 9 12 15 59 35 38 61 4 53 49 21 26 48 54 27 86 48 14 64 21 20 90 88 60 75 20 90 16 46 47 86 67 83 98 14

output:

22761720

result:

ok 1 number(s): "22761720"

Test #79:

score: 0
Accepted
time: 2123ms
memory: 3396kb

input:

96 1 809970 757852
62 28 92 31 85 30 51 56 17 39 36 84 78 33 80 25 50 35 44 90 48 51 83 48 68 76 66 76 68 2 6 51 34 65 25 69 23 42 62 87 66 94 12 41 91 48 67 20 25 55 2 81 24 94 6 60 68 55 30 10 36 33 73 4 83 25 76 14 95 64 61 96 53 4 41 73 90 91 66 91 45 55 58 59 7 25 34 28 29 57 12 96 69 91 50 64

output:

28325032

result:

ok 1 number(s): "28325032"

Test #80:

score: 0
Accepted
time: 2263ms
memory: 3380kb

input:

96 1 893394 306697
39 94 64 14 77 86 38 96 60 29 65 3 95 59 42 47 99 83 26 99 31 8 92 69 21 89 36 98 46 89 39 64 30 95 96 6 30 38 80 72 20 90 99 52 31 62 33 34 73 45 27 77 67 85 27 15 76 66 35 49 14 68 31 93 7 24 10 63 77 88 73 64 87 60 24 30 6 45 27 17 61 90 26 23 53 74 53 61 37 64 77 9 64 3 97 98

output:

22908517

result:

ok 1 number(s): "22908517"

Test #81:

score: 0
Accepted
time: 2954ms
memory: 3252kb

input:

96 4 9522 855541
13 47 41 86 61 41 20 35 100 23 6 22 12 74 93 69 44 28 8 20 10 65 4 86 81 1 2 16 17 88 75 72 38 25 67 44 49 27 95 65 79 79 75 64 71 76 92 51 24 26 51 69 5 72 48 70 88 70 52 81 96 99 96 66 31 23 44 7 71 7 88 39 17 20 11 83 14 96 83 55 84 29 94 95 4 28 84 99 50 79 42 18 50 19 44 40

output:

380880

result:

ok 1 number(s): "380880"

Test #82:

score: 0
Accepted
time: 2352ms
memory: 3292kb

input:

96 2 92946 404386
87 1 10 73 53 1 98 79 48 14 40 41 33 100 55 91 84 80 85 25 93 26 24 7 42 21 80 43 91 75 3 77 50 54 38 81 55 28 5 41 25 68 62 75 15 94 59 61 76 23 75 65 40 63 73 17 92 81 61 20 77 30 61 55 54 14 70 64 58 22 92 18 47 76 98 28 30 42 31 82 12 64 65 67 46 73 2 37 70 82 7 31 52 27 96 74

output:

3717840

result:

ok 1 number(s): "3717840"

Test #83:

score: 0
Accepted
time: 3099ms
memory: 3392kb

input:

96 5 292498 469370
46 12 64 32 25 15 67 66 39 94 10 79 59 37 67 27 82 69 49 44 48 40 41 38 60 54 21 83 44 57 72 95 59 14 88 61 81 26 42 7 38 57 30 98 95 34 80 1 76 1 24 65 12 32 15 27 13 99 84 94 37 88 80 16 98 8 42 58 30 52 20 61 12 85 71 34 42 48 39 42 60 38 1 3 39 73 40 1 95 1 33 49 37 52 2 54

output:

10822426

result:

ok 1 number(s): "10822426"

Test #84:

score: -100
Wrong Answer
time: 3692ms
memory: 3400kb

input:

96 7 419221 33690
6 65 12 85 31 78 59 98 87 18 81 33 84 72 81 35 55 6 48 25 48 42 55 58 95 26 63 55 71 26 52 1 13 18 6 26 69 82 47 91 98 12 64 51 5 65 35 87 65 25 56 13 66 58 57 98 6 57 83 75 15 37 76 72 19 93 28 96 11 6 67 94 80 23 22 47 84 72 25 33 55 88 83 54 59 75 5 83 31 28 67 1 6 20 12 100

output:

3163052

result:

wrong answer 1st numbers differ - expected: '2942163', found: '3163052'