QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#337189#6372. Dancenhuang685AC ✓370ms27956kbC++203.1kb2024-02-25 07:20:382024-02-25 07:20:38

Judging History

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

  • [2024-02-25 07:20:38]
  • 评测
  • 测评结果:AC
  • 用时:370ms
  • 内存:27956kb
  • [2024-02-25 07:20:38]
  • 提交

answer

/**
 * @file qoj6372-1.cpp
 * @author n685
 * @brief
 * @date 2024-02-23
 *
 *
 */
#include <bits/stdc++.h>

#ifdef LOCAL
#include "dd/debug.h"
#else
#define dbg(...) 42
#define dbgR(...) 4242
#define dbgP(...) 420
#define dbgRP(...) 420420
void nline() {}
#endif

const int MX = 201;
int n, d;
int64_t a, b;
std::bitset<MX + 50> p;

void small() {
  // std::array<std::vector<int64_t>, MX> dp;
  std::array<std::vector<int64_t>, 2> dp;
  dp.fill(std::vector<int64_t>(1 << d, (int64_t)4e18));
  int par = 0;
  for (int i = 0; i < (1 << d); ++i) {
    int64_t val = 0;
    for (int j = 0; j < d - 1; ++j) {
      if ((i & (2 << j))) {
        if (i & (1 << j)) {
          val += b;
        } else {
          val += a;
        }
      }
    }
    dp[par][i] = val;
  }
  for (int i = d; i < MX; ++i) {
    par = !par;
    for (int j = 0; j < (1 << d); ++j) {
      dp[par][j] = (int64_t)4e18;
      auto apply = [&](int k) {
        int64_t val = dp[!par][k];
        if (k % 2) {
          if (j % 2) {
            val += b;
          } else {
            val += a;
          }
        }
        dp[par][j] = std::min(dp[par][j], val);
      };
      int k = j / 2;
      if ((j % 2) || !p[i - d]) {
        apply(k);
      }
      k += (1 << (d - 1));
      apply(k);
    }
  }
  int64_t ans = (int64_t)4e18;
  for (int i = 0; i < (1 << d); ++i) {
    if (i % 2) {
      dp[par][i] += a;
    }
    ans = std::min(ans, dp[par][i]);
  }
  std::cout << ans << '\n';
}
void big() {
  int m = (MX + d) / d;
  int sz = m * d;
  int64_t ans = (int64_t)4e18;
  for (int i = 0; i < (1 << m); ++i) {
    bool g = true;
    for (int j = 0; j < m - 1; ++j) {
      if (p[d * j] && !(i & (1 << (m - 2 - j))) && !(i & (1 << (m - 1 - j)))) {
        g = false;
        break;
      }
    }
    if (!g) {
      continue;
    }
    std::array<std::vector<int64_t>, 2> dp;
    dp.fill(std::vector<int64_t>(1 << m, (int64_t)4e18));
    dp[0][i] = 0;
    int par = 1;
    for (int j = 1; j < d; ++j) {
      for (int k = 0; k < m; ++k) {
        for (int l = 0; l < (1 << m); ++l) {
          dp[par][l] = (int64_t)4e18;
          int loc = k * d + j;
          if (k > 0 && p[loc - d] && !(l & 1) && !(l & 2)) {
            continue;
          }
          dp[par][l] =
              std::min(dp[!par][l / 2],
                       dp[!par][l / 2 + (1 << (m - 1))] + ((l % 2) ? b : a));
        }
        par = !par;
      }
    }
    par = !par;
    for (int j = 0; j < (1 << m); ++j) {
      for (int k = 0; k < m - 1; ++k) {
        if (j & (2 << k)) {
          if (i & (1 << k)) {
            dp[par][j] += b;
          } else {
            dp[par][j] += a;
          }
        }
      }
      ans = std::min(ans, dp[par][j]);
    }
  }
  std::cout << ans << '\n';
}

int main() {
#ifndef LOCAL
  std::cin.tie(nullptr)->sync_with_stdio(false);
#endif

  std::cin >> n >> d >> a >> b;
  if (a < b) {
    b = a;
  }

  for (int i = 0; i < n; ++i) {
    int x;
    std::cin >> x;
    --x;
    p[x] = 1;
  }

  d *= 2;
  if (d <= 20) {
    small();
  } else {
    big();
  }
}

这程序好像有点Bug,我给组数据试试?

Details

Tip: Click on the bar to expand more detailed information

Test #1:

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

input:

3 1 2 1
4 1 7

output:

5

result:

ok 1 number(s): "5"

Test #2:

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

input:

3 1 7 1
4 1 7

output:

11

result:

ok 1 number(s): "11"

Test #3:

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

input:

1 1 441060 865580
6

output:

441060

result:

ok 1 number(s): "441060"

Test #4:

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

input:

1 2 524484 157528
88

output:

524484

result:

ok 1 number(s): "524484"

Test #5:

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

input:

1 3 607908 706373
65

output:

607908

result:

ok 1 number(s): "607908"

Test #6:

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

input:

1 1 724036 287921
39

output:

724036

result:

ok 1 number(s): "724036"

Test #7:

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

input:

1 4 807460 804061
17

output:

807460

result:

ok 1 number(s): "807460"

Test #8:

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

input:

1 7 974308 869046
72

output:

974308

result:

ok 1 number(s): "974308"

Test #9:

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

input:

1 4 221588 389967
17

output:

221588

result:

ok 1 number(s): "221588"

Test #10:

score: 0
Accepted
time: 96ms
memory: 9152kb

input:

1 9 704116 877292
5

output:

704116

result:

ok 1 number(s): "704116"

Test #11:

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

input:

1 3 820703 814856
86

output:

820703

result:

ok 1 number(s): "820703"

Test #12:

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

input:

1 29 195626 207042
54

output:

195626

result:

ok 1 number(s): "195626"

Test #13:

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

input:

1 19 794740 856124
14

output:

794740

result:

ok 1 number(s): "794740"

Test #14:

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

input:

1 28 444117 184242
58

output:

444117

result:

ok 1 number(s): "444117"

Test #15:

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

input:

1 32 527541 733087
27

output:

527541

result:

ok 1 number(s): "527541"

Test #16:

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

input:

1 21 610965 281931
9

output:

610965

result:

ok 1 number(s): "610965"

Test #17:

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

input:

1 7 393855 215606
79

output:

393855

result:

ok 1 number(s): "393855"

Test #18:

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

input:

2 1 228470 977748
3 41

output:

456940

result:

ok 1 number(s): "456940"

Test #19:

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

input:

2 2 344598 526593
80 2

output:

689196

result:

ok 1 number(s): "689196"

Test #20:

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

input:

2 2 428022 42733
62 56

output:

513488

result:

ok 1 number(s): "513488"

Test #21:

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

input:

2 2 511446 591577
28 9

output:

1022892

result:

ok 1 number(s): "1022892"

Test #22:

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

input:

2 1 594870 883526
5 67

output:

1189740

result:

ok 1 number(s): "1189740"

Test #23:

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

input:

2 2 794422 13919
65 74

output:

864017

result:

ok 1 number(s): "864017"

Test #24:

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

input:

2 1 883770 771924
1 15

output:

1767540

result:

ok 1 number(s): "1767540"

Test #25:

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

input:

2 1 333594 259250
89 95

output:

667188

result:

ok 1 number(s): "667188"

Test #26:

score: 0
Accepted
time: 288ms
memory: 3904kb

input:

2 11 482884 164110
69 4

output:

965768

result:

ok 1 number(s): "965768"

Test #27:

score: 0
Accepted
time: 14ms
memory: 3648kb

input:

2 14 49295 556296
29 97

output:

98590

result:

ok 1 number(s): "98590"

Test #28:

score: 0
Accepted
time: 70ms
memory: 3524kb

input:

2 12 424218 948481
98 86

output:

848436

result:

ok 1 number(s): "848436"

Test #29:

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

input:

2 17 73594 533496
33 77

output:

147188

result:

ok 1 number(s): "147188"

Test #30:

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

input:

2 25 157018 49636
15 38

output:

314036

result:

ok 1 number(s): "314036"

Test #31:

score: 0
Accepted
time: 283ms
memory: 3536kb

input:

2 11 273146 631185
92 92

output:

273146

result:

ok 1 number(s): "273146"

Test #32:

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

input:

2 34 23333 340667
58 79

output:

46666

result:

ok 1 number(s): "46666"

Test #33:

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

input:

3 1 791688 281405
92 12 7

output:

2375064

result:

ok 1 number(s): "2375064"

Test #34:

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

input:

3 1 907816 606057
73 61 76

output:

2421689

result:

ok 1 number(s): "2421689"

Test #35:

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

input:

3 2 991240 154901
43 23 53

output:

2911886

result:

ok 1 number(s): "2911886"

Test #36:

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

input:

3 2 107368 703746
20 76 30

output:

322104

result:

ok 1 number(s): "322104"

Test #37:

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

input:

3 5 158088 252590
2 30 94

output:

474264

result:

ok 1 number(s): "474264"

Test #38:

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

input:

3 5 390344 317575
61 41 44

output:

1171032

result:

ok 1 number(s): "1171032"

Test #39:

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

input:

3 6 513247 896986
88 3 16

output:

1539741

result:

ok 1 number(s): "1539741"

Test #40:

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

input:

3 15 963072 384312
72 83 85

output:

2694768

result:

ok 1 number(s): "2694768"

Test #41:

score: 0
Accepted
time: 70ms
memory: 3692kb

input:

3 12 112362 513363
44 96 5

output:

337086

result:

ok 1 number(s): "337086"

Test #42:

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

input:

3 20 711477 872845
13 85 98

output:

2134431

result:

ok 1 number(s): "2134431"

Test #43:

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

input:

3 29 310592 297735
69 74 90

output:

931776

result:

ok 1 number(s): "931776"

Test #44:

score: 0
Accepted
time: 70ms
memory: 3820kb

input:

3 12 959968 882750
20 65 8

output:

2879904

result:

ok 1 number(s): "2879904"

Test #45:

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

input:

3 18 43392 431594
94 22 73

output:

130176

result:

ok 1 number(s): "130176"

Test #46:

score: 0
Accepted
time: 287ms
memory: 3604kb

input:

3 11 126816 756246
68 76 50

output:

380448

result:

ok 1 number(s): "380448"

Test #47:

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

input:

3 49 685514 689921
41 59 83

output:

2056542

result:

ok 1 number(s): "2056542"

Test #48:

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

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: 0ms
memory: 3808kb

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: 0ms
memory: 3844kb

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: 0ms
memory: 3612kb

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: 0ms
memory: 3576kb

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: 2ms
memory: 3976kb

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: 0ms
memory: 3612kb

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: 11ms
memory: 3652kb

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: 0ms
memory: 3636kb

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: 0ms
memory: 3612kb

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: 0ms
memory: 3616kb

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: 0ms
memory: 3656kb

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: 0ms
memory: 3576kb

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: 1ms
memory: 3680kb

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: 0ms
memory: 3656kb

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: 0ms
memory: 3652kb

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: 0ms
memory: 3876kb

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: 0ms
memory: 3876kb

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: 0ms
memory: 3648kb

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: 0ms
memory: 3640kb

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: 0ms
memory: 3640kb

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: 1ms
memory: 3700kb

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: 0ms
memory: 3532kb

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: 1ms
memory: 3680kb

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: 2ms
memory: 3680kb

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: 0ms
memory: 3580kb

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: 0ms
memory: 3880kb

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: 168ms
memory: 3900kb

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: 0ms
memory: 3588kb

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: 0ms
memory: 3644kb

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: 0ms
memory: 3580kb

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: 0ms
memory: 3592kb

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: 0ms
memory: 3580kb

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: 0ms
memory: 3584kb

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: 0ms
memory: 3620kb

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: 1ms
memory: 3672kb

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: 0
Accepted
time: 6ms
memory: 3608kb

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:

2942163

result:

ok 1 number(s): "2942163"

Test #85:

score: 0
Accepted
time: 38ms
memory: 3596kb

input:

96 12 901749 521016
98 48 76 85 71 76 71 12 5 81 67 24 62 76 60 38 79 45 49 88 48 39 16 48 88 100 18 65 35 90 21 36 30 75 69 21 27 74 28 12 70 80 78 9 9 55 53 64 20 67 77 85 54 92 70 61 51 93 45 59 16 84 87 84 34 76 98 48 43 94 9 70 31 4 56 12 32 33 98 77 78 75 22 97 88 23 11 56 98 65 84 55 73 77 60...

output:

25068819

result:

ok 1 number(s): "25068819"

Test #86:

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

input:

96 5 794144 650068
79 57 1 51 66 24 70 13 51 17 82 31 94 28 28 36 41 6 12 41 80 73 61 27 9 72 85 44 84 33 24 90 60 58 34 80 33 97 40 83 91 3 35 2 34 20 77 14 12 98 1 67 88 77 19 93 7 10 66 68 78 17 41 1 21 65 95 87 95 36 50 78 56 4 28 31 25 19 69 2 92 43 50 59 53 35 94 6 26 49 67 63 36 83 38 66

output:

27225640

result:

ok 1 number(s): "27225640"

Test #87:

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

input:

96 9 393259 42254
39 46 90 14 9 65 80 16 7 16 91 33 100 80 72 33 27 1 77 57 12 1 59 99 22 23 8 30 98 32 93 87 15 86 73 26 100 19 32 70 89 98 10 61 54 79 10 37 51 62 55 25 2 1 74 92 5 71 53 61 33 89 10 42 20 36 62 78 71 61 34 51 40 76 26 16 66 70 5 75 16 99 26 64 55 88 78 29 13 66 79 12 58 45 63 44

output:

3038953

result:

ok 1 number(s): "3038953"

Test #88:

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

input:

96 38 992374 467144
3 39 82 81 53 6 94 23 71 19 92 30 9 32 23 34 17 97 41 69 35 28 64 80 43 65 34 15 23 43 58 80 65 21 4 69 59 26 29 73 83 86 81 19 71 34 47 55 94 31 96 79 25 32 32 80 6 24 28 54 88 61 78 76 26 8 24 65 48 86 18 31 17 48 23 100 7 16 48 49 45 54 97 78 48 52 58 56 7 82 88 74 92 3 89 19

output:

32932424

result:

ok 1 number(s): "32932424"

Test #89:

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

input:

96 1 641750 19454
43 26 96 44 61 15 70 17 85 67 41 67 17 78 7 77 42 21 5 50 94 35 50 16 46 76 26 82 36 85 96 38 90 25 17 44 42 8 35 64 68 34 66 100 63 64 82 63 36 52 66 48 81 44 79 45 60 83 16 20 49 75 12 62 91 72 59 19 60 12 92 55 33 41 24 56 83 66 22 53 12 6 77 52 70 100 9 10 7 41 35 54 47 85 36 1

output:

2528788

result:

ok 1 number(s): "2528788"

Test #90:

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

input:

96 3 725174 535595
20 87 69 19 49 74 52 60 25 57 78 86 34 92 69 3 83 69 83 60 77 92 66 33 11 88 92 8 7 76 29 51 95 59 87 81 49 9 57 49 23 27 45 15 3 82 45 85 88 41 87 48 20 35 100 92 76 94 33 59 27 7 77 35 15 71 93 63 42 27 8 30 63 1 11 9 91 17 82 83 36 45 45 28 21 49 28 39 23 52 96 63 46 93 87 35

output:

21087057

result:

ok 1 number(s): "21087057"

Test #91:

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

input:

96 40 808598 892951
2 41 37 3 37 30 35 100 72 52 11 1 51 14 20 13 35 22 65 69 60 49 79 54 60 9 63 30 85 71 65 55 99 89 62 19 59 97 67 26 77 16 25 23 43 100 3 99 44 30 15 40 54 18 21 47 80 97 50 91 13 42 42 24 39 70 27 12 33 38 20 10 97 57 98 62 94 68 38 14 64 80 13 92 63 99 51 77 36 56 61 72 32 10 3...

output:

49324478

result:

ok 1 number(s): "49324478"

Test #92:

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

input:

96 6 591488 826625
64 32 75 40 88 52 1 26 40 26 1 32 19 85 67 32 10 89 1 85 67 48 70 48 49 12 56 9 37 50 31 82 20 53 40 19 26 41 22 61 77 77 52 78 100 93 76 86 32 100 38 41 43 52 91 75 4 85 11 55 56 38 51 5 28 75 91 56 32 12 6 16 89 28 25 85 52 59 92 18 74 5 73 83 50 13 47 79 2 3 92 35 22 66 7 97

output:

23068032

result:

ok 1 number(s): "23068032"

Test #93:

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

input:

97 1 289764 545368
77 37 58 89 15 78 33 11 70 46 4 13 12 16 20 6 74 2 94 12 74 63 85 69 29 50 13 57 66 4 17 82 61 82 13 42 9 28 41 97 83 64 49 88 88 49 43 71 23 28 100 8 49 3 83 70 38 45 72 47 23 43 10 90 22 22 22 86 92 34 34 89 20 32 99 62 30 13 43 16 89 26 83 48 48 98 10 10 13 7 77 49 1 53 89 95 45

output:

12459852

result:

ok 1 number(s): "12459852"

Test #94:

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

input:

97 2 405892 94213
50 3 35 72 3 33 20 59 14 33 45 33 29 38 74 24 23 51 80 17 53 20 93 90 90 58 83 83 37 91 53 91 61 8 84 80 20 33 55 78 37 52 32 96 20 67 13 85 70 10 24 8 83 93 8 17 54 48 85 86 5 74 75 71 50 13 60 35 79 49 45 69 50 88 82 23 34 64 95 46 16 61 51 20 91 48 29 48 33 18 46 54 87 69 36 37 69

output:

6733017

result:

ok 1 number(s): "6733017"

Test #95:

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

input:

97 1 489316 643057
32 52 8 56 91 89 2 99 65 23 79 52 46 52 32 46 63 91 58 26 37 77 13 11 43 82 57 1 15 90 85 91 69 41 59 21 23 26 74 59 91 45 20 11 64 85 68 11 26 7 49 4 29 76 29 72 59 59 94 22 83 97 41 60 74 11 86 88 61 64 49 44 85 49 69 76 42 19 51 72 40 4 23 84 41 97 48 78 46 29 11 71 85 77 87 71...

output:

19083324

result:

ok 1 number(s): "19083324"

Test #96:

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

input:

97 1 572740 159198
2 14 77 31 79 48 84 42 9 25 16 71 56 75 87 64 8 44 35 36 16 38 21 33 8 95 28 27 85 81 22 100 69 71 30 55 41 23 88 52 50 42 4 19 4 99 39 20 74 88 69 100 64 67 50 27 63 66 12 61 68 32 94 41 94 10 20 41 59 87 65 19 11 5 52 21 57 61 11 11 64 34 87 56 88 55 70 16 62 41 72 80 84 94 35 1...

output:

13559196

result:

ok 1 number(s): "13559196"

Test #97:

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

input:

97 1 688868 516554
83 67 53 14 67 4 67 82 49 15 45 98 73 1 41 82 57 92 9 53 99 99 30 54 65 11 98 50 64 68 54 13 78 1 5 92 48 19 99 33 4 30 83 30 44 25 94 38 22 77 97 97 98 58 71 74 79 78 25 96 50 63 59 22 21 1 54 86 42 2 77 91 45 53 39 74 61 16 63 37 92 69 59 27 34 5 97 54 75 40 37 90 70 2 82 55 22

output:

23936126

result:

ok 1 number(s): "23936126"

Test #98:

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

input:

97 3 855716 581539
43 83 99 77 44 26 31 61 32 100 16 36 11 42 53 19 42 81 77 76 53 17 62 92 83 44 35 94 13 54 19 22 86 64 55 71 73 13 36 99 9 16 46 53 28 57 19 66 25 52 46 85 71 28 17 72 87 92 51 66 6 30 90 88 65 91 26 87 14 33 96 41 6 69 12 76 85 13 72 94 28 43 95 63 24 96 34 22 8 62 59 12 58 26 93...

output:

25629598

result:

ok 1 number(s): "25629598"

Test #99:

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

input:

97 2 81403 382944
93 53 68 67 74 30 50 40 2 35 3 83 3 24 29 13 68 90 1 46 69 7 71 24 13 96 54 87 67 34 77 71 51 37 99 44 54 40 36 71 5 56 82 10 26 17 25 20 61 59 46 34 21 62 60 15 45 38 14 41 95 64 75 6 64 80 47 11 86 37 19 81 25 39 76 3 11 100 60 5 27 31 24 72 97 84 17 40 41 19 75 49 48 44 85 66 54

output:

3337523

result:

ok 1 number(s): "3337523"

Test #100:

score: 0
Accepted
time: 231ms
memory: 3640kb

input:

97 11 498523 870270
82 32 32 68 14 19 61 42 32 99 81 83 84 25 8 11 96 28 5 100 69 100 33 26 14 70 5 98 48 90 51 7 75 78 70 36 12 20 17 96 85 16 96 76 26 7 42 96 12 1 60 6 1 100 73 74 86 83 76 25 1 8 78 22 83 58 13 59 22 24 69 57 76 20 99 64 58 53 33 53 42 21 72 15 26 36 18 21 7 63 92 3 15 1 41 64 55

output:

19940920

result:

ok 1 number(s): "19940920"

Test #101:

score: 0
Accepted
time: 10ms
memory: 3660kb

input:

97 14 680518 775130
54 45 64 34 18 71 60 43 70 38 8 89 12 77 69 14 54 85 69 58 1 34 77 97 35 47 76 76 93 33 50 69 97 65 38 94 21 51 29 66 3 47 53 73 43 76 62 38 8 32 88 84 35 86 22 6 42 91 97 30 59 36 40 39 66 51 10 98 71 66 7 61 9 12 70 87 52 43 4 78 52 90 100 78 87 48 1 75 35 35 83 10 74 3 19 44 44

output:

29942792

result:

ok 1 number(s): "29942792"

Test #102:

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

input:

97 2 22736 167315
22 38 45 96 49 5 70 54 30 33 13 87 22 21 20 11 44 85 34 74 29 54 79 70 48 93 3 62 11 44 23 58 52 4 66 41 81 74 21 58 97 34 24 23 64 31 99 57 43 97 33 46 62 13 77 98 44 45 76 23 22 9 9 68 72 23 77 90 47 95 94 38 85 84 80 72 93 89 48 51 80 45 71 83 89 4 81 98 18 56 88 71 4 65 36 19 35

output:

909440

result:

ok 1 number(s): "909440"

Test #103:

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

input:

97 14 621851 783693
91 27 38 63 92 50 85 61 95 36 14 92 31 77 64 12 34 72 98 82 52 85 85 50 62 40 29 51 28 51 92 55 99 32 5 83 52 85 18 45 95 26 95 82 93 90 32 84 90 70 83 100 72 36 36 97 41 6 59 20 77 89 77 10 74 90 44 81 23 13 78 18 70 64 74 57 38 40 83 13 9 1 47 96 86 65 70 21 16 77 96 25 34 28 5...

output:

26739593

result:

ok 1 number(s): "26739593"

Test #104:

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

input:

97 43 238523 144516
26 14 51 26 1 58 64 50 100 84 63 26 39 18 60 59 51 100 62 59 15 96 71 78 72 46 13 15 49 93 30 9 32 36 13 54 23 62 31 40 76 78 80 71 77 20 71 92 32 94 53 73 28 48 90 54 99 57 51 78 34 99 11 96 48 63 82 30 35 38 52 42 86 57 67 12 9 90 65 21 84 53 23 75 8 12 13 67 16 31 43 5 93 1 9 ...

output:

10500591

result:

ok 1 number(s): "10500591"

Test #105:

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

input:

97 44 354652 660656
4 75 28 6 93 14 43 89 52 74 92 41 56 41 18 77 92 56 40 68 98 53 79 99 25 67 91 41 20 84 62 22 40 66 88 96 29 55 46 33 34 67 63 78 17 38 34 6 84 80 78 69 75 39 11 13 11 72 64 21 12 30 76 73 68 62 8 79 18 57 64 17 20 9 62 65 17 37 25 47 100 96 95 47 55 66 31 4 32 39 4 14 80 18 57 5...

output:

20924468

result:

ok 1 number(s): "20924468"

Test #106:

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

input:

97 40 470780 242205
85 29 93 85 77 73 25 29 91 65 38 64 77 63 72 99 45 5 26 85 77 6 91 25 86 75 58 59 98 71 99 30 36 96 67 33 44 56 56 14 89 56 47 94 57 52 96 23 36 65 2 61 9 30 32 64 15 75 77 56 94 62 33 58 96 60 42 24 8 72 68 93 50 65 48 22 33 87 69 82 27 27 62 19 1 16 62 42 45 50 69 23 74 26 8 55...

output:

17179790

result:

ok 1 number(s): "17179790"

Test #107:

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

input:

97 25 220966 175879
47 16 30 26 28 92 95 68 59 43 16 86 41 29 16 17 16 68 66 93 84 9 91 19 75 90 52 45 50 54 60 45 54 60 32 38 11 96 10 44 92 21 70 32 14 45 73 6 25 35 28 62 94 56 98 92 39 59 46 12 33 61 42 39 84 62 7 68 7 42 62 99 46 36 72 33 79 87 23 86 42 56 15 2 84 25 58 44 11 93 8 86 56 90 88 6...

output:

8009198

result:

ok 1 number(s): "8009198"

Test #108:

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

input:

98 1 885686 881729
66 8 1 31 26 85 98 14 79 48 14 66 64 17 10 90 34 14 26 31 80 39 2 24 52 39 38 68 35 97 63 9 88 32 77 57 6 28 39 88 54 18 78 43 18 68 93 44 68 78 18 40 7 98 80 23 25 34 35 24 92 72 16 58 89 13 98 20 80 15 6 70 26 17 40 13 57 87 75 75 64 31 81 9 29 21 5 27 25 68 11 7 19 27 75 75 81 85

output:

34474485

result:

ok 1 number(s): "34474485"

Test #109:

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

input:

98 1 969110 206381
47 61 70 18 14 44 84 58 19 38 51 89 73 43 64 16 87 63 4 49 59 100 10 37 12 51 5 82 5 88 100 18 100 66 56 91 8 20 49 69 8 15 53 55 62 86 48 58 24 72 43 36 42 85 5 74 29 49 41 59 70 3 73 43 17 4 32 64 62 30 22 41 56 73 23 66 73 37 28 1 92 74 45 80 75 75 23 65 37 79 76 17 17 44 26 9 ...

output:

20054949

result:

ok 1 number(s): "20054949"

Test #110:

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

input:

98 2 85238 755226
17 23 43 89 98 4 66 98 62 32 84 4 90 58 22 34 32 7 81 58 42 61 23 54 69 68 75 8 84 83 40 27 97 84 19 28 19 25 72 50 66 4 41 66 2 4 19 72 68 57 71 28 84 76 26 29 41 56 58 98 59 38 39 32 37 3 70 13 61 45 34 16 87 29 10 19 85 84 80 28 8 9 17 44 18 24 46 3 58 87 33 34 7 52 74 55 21 24

output:

3239044

result:

ok 1 number(s): "3239044"

Test #111:

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

input:

98 2 135958 271366
98 77 20 72 90 59 45 37 10 23 22 27 7 80 73 56 72 56 71 67 22 10 43 75 26 84 45 34 54 70 76 32 9 17 94 70 34 18 82 35 21 92 24 78 42 26 74 89 19 50 91 20 18 58 47 84 50 67 67 33 33 70 4 9 60 1 4 66 43 64 45 92 21 81 97 64 1 34 36 54 32 40 85 16 68 78 65 37 70 90 98 43 1 60 21 89 4...

output:

5574278

result:

ok 1 number(s): "5574278"

Test #112:

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

input:

98 5 252086 820210
76 26 89 60 78 15 31 85 54 13 55 42 24 94 35 74 21 4 49 72 97 67 51 100 91 4 16 53 33 61 9 40 5 47 68 7 44 15 97 28 75 89 12 89 86 44 44 99 71 35 12 20 57 45 68 27 54 71 84 72 15 97 69 94 88 92 38 15 25 79 53 71 51 41 80 17 5 89 92 92 60 83 53 88 11 28 80 71 87 1 63 52 92 76 80 35...

output:

10335526

result:

ok 1 number(s): "10335526"

Test #113:

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

input:

98 4 418935 917899
31 41 38 18 54 29 91 68 37 1 29 84 54 39 47 18 7 93 8 99 59 85 68 39 5 37 48 1 77 52 73 62 17 11 18 82 66 12 30 90 80 66 67 12 70 76 70 38 67 14 60 8 25 27 14 33 74 89 10 42 71 59 88 59 32 82 2 16 98 13 76 14 12 54 57 23 29 86 100 49 7 52 93 23 8 27 29 39 8 24 93 74 88 97 75 11 94...

output:

16338465

result:

ok 1 number(s): "16338465"

Test #114:

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

input:

98 8 710881 732198
69 41 23 45 10 74 40 69 25 52 26 46 25 65 78 99 77 69 58 54 90 68 88 95 39 71 49 23 80 31 7 38 92 44 4 59 39 95 33 54 21 100 96 77 36 73 18 36 53 93 25 47 68 66 75 24 80 12 46 94 84 88 66 40 13 74 62 23 62 71 71 63 78 47 27 59 37 24 3 73 99 81 74 91 31 100 24 9 50 17 83 100 82 56 ...

output:

30567883

result:

ok 1 number(s): "30567883"

Test #115:

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

input:

98 4 160705 219523
57 24 87 54 54 59 51 83 43 8 4 33 6 69 53 93 5 99 62 9 86 53 45 97 28 49 96 34 56 94 77 82 13 96 66 50 92 79 5 83 1 60 14 30 48 63 23 17 8 39 51 27 52 12 76 83 25 61 11 74 77 40 76 56 35 53 28 75 97 54 30 40 33 28 54 12 88 81 76 13 14 64 17 42 64 56 29 90 16 57 8 54 49 14 10 42 56...

output:

6588905

result:

ok 1 number(s): "6588905"

Test #116:

score: 0
Accepted
time: 124ms
memory: 3596kb

input:

98 11 309995 91679
37 33 20 16 53 19 50 84 89 47 27 43 30 21 17 96 63 68 30 70 14 87 85 67 57 17 75 13 6 42 76 44 39 71 31 5 2 9 25 54 14 87 71 27 57 28 47 55 100 66 79 5 94 98 34 19 77 73 32 87 40 60 31 73 23 41 29 14 38 96 55 44 54 19 25 44 78 71 35 38 23 32 49 100 25 60 4 40 44 34 92 61 16 19 84 ...

output:

5295619

result:

ok 1 number(s): "5295619"

Test #117:

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

input:

98 9 909110 516569
6 26 12 79 89 60 64 87 53 54 28 45 44 74 69 1 53 60 91 86 50 15 91 44 66 64 98 6 23 49 53 33 94 7 70 59 66 20 18 41 12 78 42 86 78 87 88 85 39 35 20 67 5 21 92 19 79 26 7 88 99 36 99 6 21 13 92 1 22 25 39 21 39 96 23 32 23 17 79 11 52 92 21 14 27 21 93 63 35 54 4 19 46 81 10 93 36...

output:

25104739

result:

ok 1 number(s): "25104739"

Test #118:

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

input:

98 39 284033 908755
62 15 97 49 32 2 75 98 10 53 37 39 50 18 13 94 47 51 59 98 74 42 97 16 84 18 20 84 33 52 21 26 40 35 98 6 33 39 14 32 6 70 21 41 7 42 29 4 82 4 74 21 27 41 47 2 77 83 94 85 62 9 76 44 19 80 59 92 2 47 38 1 15 68 29 5 64 64 22 85 81 43 97 19 20 77 77 86 25 71 12 80 72 44 35 71 26 76

output:

14769716

result:

ok 1 number(s): "14769716"

Test #119:

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

input:

98 44 900705 461065
9 2 7 9 44 98 55 91 23 5 86 80 57 63 8 37 61 87 19 79 36 45 79 56 90 25 12 51 50 93 56 84 70 51 6 73 4 17 20 27 91 10 98 25 87 64 60 12 36 25 44 94 87 56 94 71 30 39 82 39 19 23 9 22 93 53 93 38 11 72 8 25 31 65 21 68 35 18 100 89 48 95 76 94 46 29 24 36 25 30 59 52 27 26 78 37 6...

output:

35598845

result:

ok 1 number(s): "35598845"

Test #120:

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

input:

98 36 16833 42614
79 63 84 84 32 58 37 31 63 92 19 99 78 86 58 55 9 36 97 88 15 6 3 78 51 37 83 77 28 88 92 97 74 85 85 6 18 13 34 8 46 7 77 41 31 78 27 30 80 14 60 90 22 47 15 18 50 50 87 74 1 54 67 7 17 44 31 91 97 88 20 4 65 25 8 21 43 61 56 19 75 38 44 65 88 78 39 69 41 41 12 61 22 34 30 83 84 65

output:

824817

result:

ok 1 number(s): "824817"

Test #121:

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

input:

98 29 67553 591458
57 17 52 71 20 17 15 70 10 82 52 14 95 4 21 77 50 76 83 94 98 67 11 91 12 53 49 95 99 80 24 9 78 6 56 48 29 14 53 97 100 96 65 48 75 4 82 48 32 7 93 82 56 34 40 73 54 53 8 13 79 85 32 92 40 43 57 40 83 3 28 79 95 77 95 70 59 15 12 46 95 73 16 37 39 32 61 3 54 40 77 71 12 50 77 25 ...

output:

3107438

result:

ok 1 number(s): "3107438"

Test #122:

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

input:

98 47 883148 300941
34 8 90 8 67 35 85 1 78 52 38 48 63 70 64 99 33 51 23 10 9 66 3 89 5 65 43 77 59 59 94 24 91 78 29 52 92 54 11 28 100 57 92 99 23 1 54 27 21 81 19 83 49 72 9 1 78 41 65 78 18 89 41 77 29 48 26 79 79 72 22 82 3 48 22 93 5 11 58 62 9 2 64 24 14 42 61 9 20 88 16 33 2 2 57 33 13 57

output:

26626349

result:

ok 1 number(s): "26626349"

Test #123:

score: 0
Accepted
time: 367ms
memory: 27956kb

input:

100 10 454193 436651
36 8 39 25 56 44 15 2 33 36 75 42 59 60 55 67 35 30 53 90 80 64 81 78 8 100 91 72 71 59 17 29 51 79 78 51 83 16 16 47 49 3 42 17 32 90 87 76 98 85 93 34 34 36 71 54 11 95 20 25 32 29 90 20 22 6 100 93 45 25 43 86 47 42 81 85 75 13 69 10 40 37 65 88 4 26 52 40 65 88 33 7 91 21 50...

output:

19894883

result:

ok 1 number(s): "19894883"

Test #124:

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

input:

99 1 448905 993897
62 79 37 72 32 88 58 21 80 46 19 22 4 22 100 89 99 26 50 59 86 12 11 70 74 33 52 67 8 90 18 45 28 79 40 64 98 15 37 75 25 77 99 2 59 90 32 9 14 40 32 59 62 97 82 84 8 30 91 100 61 13 22 29 56 4 79 37 64 87 95 42 24 1 81 60 1 56 4 26 36 36 75 69 13 56 91 44 33 30 37 70 41 6 66 51 1...

output:

17507295

result:

ok 1 number(s): "17507295"

Test #125:

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

input:

99 1 532329 510038
40 28 14 59 20 43 40 61 20 36 61 33 25 36 50 11 47 70 31 68 65 73 32 87 39 41 22 93 82 85 54 46 28 12 11 5 5 20 47 60 83 66 82 10 3 12 95 23 69 26 65 55 100 80 3 31 16 42 4 35 46 37 84 14 80 95 13 94 50 10 10 21 54 50 68 13 9 2 52 53 64 79 47 33 64 6 14 82 49 41 2 79 39 14 17 85 3...

output:

20315011

result:

ok 1 number(s): "20315011"

Test #126:

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

input:

99 1 648457 58882
13 82 86 35 8 3 23 1 68 26 94 56 42 63 12 33 92 23 17 81 48 30 40 8 100 61 89 19 53 81 87 59 36 38 86 43 16 12 70 41 37 54 70 25 39 30 58 49 17 19 81 51 43 63 28 82 20 45 17 74 24 68 45 91 4 94 47 39 45 25 10 97 88 10 51 66 25 53 8 87 84 14 10 5 6 52 37 20 66 52 63 96 33 30 60 27 5...

output:

6360011

result:

ok 1 number(s): "6360011"

Test #127:

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

input:

99 3 699177 416238
87 43 55 14 100 70 5 40 15 24 35 79 51 77 62 52 41 71 95 95 27 87 48 30 53 78 59 33 31 68 23 67 36 72 61 80 30 13 80 22 92 51 41 33 83 44 20 58 65 4 13 43 81 50 49 37 33 56 30 9 6 3 2 80 27 93 89 95 27 44 22 64 15 66 38 11 33 8 65 13 7 57 82 76 53 1 55 57 74 51 28 5 23 38 19 65 73...

output:

20178087

result:

ok 1 number(s): "20178087"

Test #128:

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

input:

99 2 815305 932379
69 97 32 93 84 26 87 80 59 19 64 94 68 100 25 74 90 20 72 4 3 48 64 47 14 94 29 60 1 63 55 76 40 2 36 26 41 10 95 15 50 40 29 48 27 62 79 72 17 89 30 47 15 41 70 88 41 68 39 44 80 34 67 65 51 84 15 40 17 60 37 43 49 22 25 68 45 50 17 48 35 88 50 40 99 51 78 83 87 63 97 15 21 47 71...

output:

30981590

result:

ok 1 number(s): "30981590"

Test #129:

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

input:

99 6 14857 997363
16 8 74 60 64 41 48 63 42 99 35 32 2 40 33 10 79 13 36 31 65 66 89 93 28 19 74 4 50 41 24 94 49 53 82 1 62 100 28 81 59 25 96 67 99 2 4 99 12 68 82 40 88 18 16 86 57 82 66 19 35 92 90 31 94 69 83 42 86 90 53 94 9 38 99 66 61 59 25 4 79 66 86 80 96 50 16 55 20 85 23 33 6 71 65 83 30...

output:

609137

result:

ok 1 number(s): "609137"

Test #130:

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

input:

99 1 340358 824555
52 33 83 32 50 17 34 14 48 69 44 96 43 6 18 76 83 52 15 66 8 17 100 65 66 45 40 52 93 43 37 13 30 54 97 77 24 53 21 42 28 40 14 35 54 13 3 68 50 40 16 72 23 82 79 41 19 2 81 55 65 8 65 70 66 56 77 35 33 97 27 50 31 51 73 15 71 52 34 41 59 28 23 10 69 13 35 70 59 3 100 47 24 81 39 ...

output:

13614320

result:

ok 1 number(s): "13614320"

Test #131:

score: 0
Accepted
time: 145ms
memory: 3668kb

input:

99 11 790182 344585
40 12 47 32 98 99 42 16 70 25 26 95 24 10 1 79 14 83 23 25 8 14 69 63 54 19 83 66 57 98 3 57 51 3 67 69 73 33 2 59 8 4 28 1 58 3 21 37 5 82 34 52 11 17 87 100 64 39 42 39 62 63 67 94 84 39 47 79 65 88 86 23 90 40 4 68 15 97 7 85 86 14 67 61 2 61 33 51 33 47 17 1 95 38 84 16 61 8 86

output:

18078895

result:

ok 1 number(s): "18078895"

Test #132:

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

input:

99 8 939473 216741
20 21 75 98 93 59 40 13 4 64 49 98 56 62 70 73 73 40 79 82 31 48 6 34 75 88 62 45 7 42 6 15 77 90 32 27 87 64 18 29 26 27 85 98 75 72 40 87 92 1 69 26 37 2 37 37 17 47 56 52 29 84 30 7 68 32 44 26 13 30 15 31 7 31 75 100 8 94 78 10 99 83 99 23 63 77 16 93 53 24 100 9 58 43 57 88 4...

output:

12788505

result:

ok 1 number(s): "12788505"

Test #133:

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

input:

99 8 505884 865823
81 10 68 57 28 100 59 24 68 71 50 99 62 14 9 75 63 39 56 94 67 76 12 14 97 42 85 39 28 53 78 12 31 18 63 74 55 79 11 29 20 22 64 49 4 27 73 6 31 78 11 88 60 25 96 24 18 4 42 45 84 60 98 40 66 99 11 17 97 56 99 16 92 4 77 76 49 41 14 83 28 34 75 28 64 37 100 24 48 41 12 70 84 6 87 ...

output:

21247128

result:

ok 1 number(s): "21247128"

Test #134:

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

input:

99 16 104998 258008
49 3 65 28 72 45 65 31 33 74 59 1 72 71 61 80 52 35 20 6 95 99 17 87 10 85 11 20 46 60 51 1 78 53 3 16 14 86 3 16 18 10 39 7 20 86 11 36 82 43 65 42 82 57 50 23 16 61 21 50 39 32 67 70 76 71 74 4 74 77 83 88 72 84 71 61 90 88 57 56 53 94 50 38 54 98 92 47 43 57 20 27 14 64 9 33 2...

output:

4724910

result:

ok 1 number(s): "4724910"

Test #135:

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

input:

99 39 754375 810319
85 90 66 87 92 46 41 24 38 22 4 34 79 12 49 14 74 66 80 87 57 10 3 27 16 95 99 83 63 98 90 59 7 61 11 95 97 75 9 11 99 50 16 96 12 16 45 40 28 63 35 15 42 73 5 81 69 28 13 4 100 47 100 60 42 39 12 50 86 3 69 8 92 73 76 24 62 42 38 61 15 46 26 20 80 45 31 97 34 16 67 100 69 42 60 ...

output:

39981875

result:

ok 1 number(s): "39981875"

Test #136:

score: 0
Accepted
time: 10ms
memory: 3648kb

input:

99 13 870503 167675
62 51 39 66 80 1 27 60 90 13 45 53 96 30 11 32 23 19 54 96 40 67 11 48 77 11 70 9 37 93 22 67 15 87 82 29 3 68 31 92 57 51 95 3 56 34 8 54 76 48 51 11 73 59 30 36 81 32 22 39 86 78 66 41 62 30 50 95 72 22 72 87 18 29 59 69 78 88 91 87 43 85 94 84 26 95 50 34 47 27 28 9 56 58 7 58...

output:

9454056

result:

ok 1 number(s): "9454056"

Test #137:

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

input:

99 39 953927 683816
44 5 20 49 68 61 9 3 30 99 75 72 13 53 69 55 63 59 44 6 12 24 20 69 30 28 40 28 8 80 58 72 15 21 57 66 14 69 42 77 12 40 79 19 92 52 71 72 28 46 76 7 11 42 51 91 90 43 39 79 64 13 31 30 89 29 84 51 59 33 84 66 52 85 46 22 85 39 47 18 67 20 62 56 77 41 73 72 63 38 93 18 58 66 58 9...

output:

43299288

result:

ok 1 number(s): "43299288"

Test #138:

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

input:

99 24 479921 650194
6 88 45 86 7 87 75 42 97 74 60 99 81 23 5 77 42 30 80 22 30 23 15 59 23 39 34 14 63 59 20 98 33 81 30 63 81 8 100 7 15 1 10 58 41 41 52 55 17 15 6 4 96 76 13 15 17 18 96 43 7 9 32 11 78 42 41 95 54 2 70 69 48 56 77 45 35 35 1 22 81 45 22 43 48 58 73 74 29 82 33 93 40 27 26 8 14 4...

output:

21116524

result:

ok 1 number(s): "21116524"

Test #139:

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

input:

100 1 620884 371829
77 84 54 78 43 57 61 81 14 68 77 37 85 79 54 96 49 97 95 78 21 34 85 45 4 3 70 2 78 44 16 62 96 1 23 11 7 48 15 46 53 73 43 64 28 97 43 34 16 96 27 51 70 11 74 22 19 38 40 49 69 31 36 67 27 61 58 15 48 82 86 31 25 46 100 38 43 74 81 87 12 46 29 67 55 10 35 14 24 85 27 83 26 9 17 ...

output:

19980541

result:

ok 1 number(s): "19980541"

Test #140:

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

input:

100 2 737012 920674
55 38 23 49 31 17 47 24 58 66 10 60 94 98 12 15 2 42 73 96 100 83 94 66 65 19 41 29 61 31 52 75 96 31 2 56 22 45 25 31 7 62 23 79 72 15 98 60 68 89 60 51 4 2 95 81 24 42 53 88 51 62 1 56 47 60 92 60 35 97 98 7 55 2 83 95 59 16 38 13 36 81 97 43 98 60 62 52 44 96 92 92 12 18 64 6 ...

output:

28743468

result:

ok 1 number(s): "28743468"

Test #141:

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

input:

100 3 787732 212622
36 91 99 36 15 72 30 64 97 60 47 75 12 24 66 37 43 90 50 5 83 48 10 87 18 36 7 47 27 22 85 88 4 61 77 94 32 42 40 12 65 59 11 87 16 37 68 73 20 74 76 47 42 92 20 24 36 57 70 19 29 97 62 29 71 59 30 17 21 24 9 74 85 62 65 44 67 71 98 39 64 15 69 7 49 10 81 90 57 7 57 1 10 26 11 44...

output:

14168870

result:

ok 1 number(s): "14168870"

Test #142:

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

input:

100 1 903860 761467
6 53 72 11 7 28 100 4 45 46 84 98 29 39 21 47 87 39 40 14 66 5 22 4 83 52 77 69 6 21 17 93 12 90 48 31 39 35 58 93 20 51 86 98 52 55 23 87 68 68 8 43 81 71 41 79 44 60 79 67 7 20 28 18 98 50 64 62 7 39 13 53 19 19 52 97 75 21 50 78 80 54 33 75 91 63 99 24 69 7 22 10 8 42 62 86 61...

output:

31783606

result:

ok 1 number(s): "31783606"

Test #143:

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

input:

100 4 987284 310311
88 3 41 95 95 87 86 43 88 37 21 21 50 61 75 69 36 80 18 27 38 62 34 25 32 64 47 95 76 8 49 97 8 20 23 73 54 39 73 86 74 40 74 10 88 69 94 1 19 57 29 39 15 62 62 26 48 63 96 2 93 52 81 3 26 49 98 18 90 55 25 33 49 75 35 50 87 68 98 8 100 89 4 46 42 5 22 62 90 18 87 32 95 50 10 20 ...

output:

18646455

result:

ok 1 number(s): "18646455"

Test #144:

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

input:

100 2 154132 408000
47 18 91 57 71 2 51 26 76 21 92 55 76 2 87 9 30 81 77 46 100 80 59 64 58 97 92 39 25 94 18 19 16 84 69 44 79 33 6 48 87 29 45 41 68 5 15 28 19 35 77 27 88 40 8 36 69 82 23 80 48 18 11 69 73 35 62 12 70 85 52 79 10 83 5 52 11 73 10 61 51 63 40 82 31 8 59 26 11 36 17 46 83 75 8 8 1...

output:

6165280

result:

ok 1 number(s): "6165280"

Test #145:

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

input:

100 2 790038 472959
25 16 6 47 3 48 36 36 69 12 83 25 90 37 31 77 20 19 38 5 95 86 92 84 61 34 100 68 59 12 22 39 71 16 35 15 92 37 100 2 42 60 34 27 71 77 44 39 98 19 97 9 44 92 58 42 86 8 18 29 64 53 97 65 18 90 68 74 54 9 56 83 23 54 94 19 4 83 25 28 81 74 60 58 21 81 8 90 83 99 48 61 38 65 60 28...

output:

22411548

result:

ok 1 number(s): "22411548"

Test #146:

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

input:

100 8 272566 960285
9 100 70 47 43 41 48 50 91 67 69 24 71 41 14 79 48 53 42 60 95 71 54 82 58 12 52 83 39 76 95 83 96 69 97 15 50 25 72 23 14 19 52 81 83 67 53 8 53 62 22 81 28 31 67 97 31 44 88 13 58 1 99 85 32 64 34 26 81 96 10 52 78 35 21 72 60 40 98 67 9 61 7 2 54 29 14 64 54 39 61 14 9 22 16 3...

output:

11175206

result:

ok 1 number(s): "11175206"

Test #147:

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

input:

100 2 389152 865145
81 9 99 14 47 89 46 43 37 11 84 31 3 85 79 82 10 10 2 21 18 5 98 61 75 89 23 62 85 19 95 41 26 55 66 62 64 56 92 94 36 43 9 78 100 32 81 58 45 92 46 63 66 16 17 37 88 61 5 22 20 30 61 94 16 57 31 65 30 34 40 60 11 26 96 4 49 26 64 93 10 30 35 64 27 42 97 13 78 16 52 22 60 27 94 6...

output:

15176928

result:

ok 1 number(s): "15176928"

Test #148:

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

input:

100 15 764075 290035
49 98 91 76 82 34 65 50 2 14 93 24 9 41 22 79 100 6 71 33 50 33 96 33 96 35 45 43 2 22 63 34 73 83 89 16 23 67 89 89 33 38 80 36 20 91 14 76 84 57 92 21 88 43 75 33 85 18 80 23 79 2 34 35 14 29 97 52 10 59 27 41 87 99 90 92 90 76 8 66 39 85 7 69 17 6 81 36 68 33 64 75 94 90 11 7...

output:

17084010

result:

ok 1 number(s): "17084010"

Test #149:

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

input:

100 3 363190 906412
14 91 84 43 25 76 75 61 58 21 94 30 23 85 74 80 90 5 35 45 78 64 2 6 6 82 79 37 20 29 32 31 27 19 29 62 90 81 82 80 31 25 48 95 41 46 55 3 27 26 45 75 2 67 34 28 87 75 62 16 42 82 99 61 24 100 64 39 90 85 15 21 68 79 96 65 31 23 44 39 71 40 83 82 10 59 61 60 63 53 65 37 28 52 29 ...

output:

15617170

result:

ok 1 number(s): "15617170"

Test #150:

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

input:

100 43 12566 267235
57 77 90 6 33 72 47 54 68 65 43 67 34 31 69 23 7 37 95 18 40 67 88 50 16 96 59 4 37 75 66 85 48 23 41 29 65 55 87 75 12 74 33 76 29 68 86 15 81 47 11 43 63 79 85 89 40 30 54 74 99 88 32 51 86 69 91 93 3 2 93 45 88 72 93 32 3 73 29 44 38 93 58 61 36 2 12 17 62 12 12 17 80 34 84 30...

output:

779092

result:

ok 1 number(s): "779092"

Test #151:

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

input:

100 24 95990 816079
35 39 67 89 21 31 29 94 15 55 80 86 51 53 20 45 56 78 77 36 20 24 4 67 81 5 38 18 11 62 99 93 61 53 12 63 80 56 1 52 71 63 12 83 73 86 53 29 25 36 36 40 97 69 10 44 56 41 72 13 81 20 98 36 14 60 29 38 85 17 97 20 18 24 76 85 14 32 77 74 58 36 30 33 82 56 31 55 75 19 73 26 74 42 3...

output:

4031580

result:

ok 1 number(s): "4031580"

Test #152:

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

input:

100 12 212118 332220
8 93 43 65 13 99 15 33 55 45 17 5 60 72 82 67 1 26 63 45 95 81 12 88 34 17 8 44 90 61 35 98 57 86 91 4 86 52 20 37 25 64 96 7 17 8 12 43 77 25 64 36 40 60 31 88 61 45 81 45 59 55 55 17 33 59 63 86 71 40 13 99 52 84 63 30 30 74 33 100 82 66 2 5 25 9 54 89 87 30 42 35 68 50 83 10 ...

output:

8908956

result:

ok 1 number(s): "8908956"

Test #153:

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

input:

100 7 962305 331302
78 83 81 10 61 17 81 64 22 16 3 36 28 42 17 85 80 1 99 53 10 80 8 83 23 36 2 30 42 40 1 20 74 46 56 9 53 88 78 68 25 16 19 45 66 5 84 30 66 95 91 37 25 86 93 20 84 28 49 9 2 54 64 94 22 72 27 30 67 14 99 6 44 51 94 53 76 66 87 12 4 96 54 92 12 15 54 91 53 74 77 98 50 15 63 26 34 ...

output:

18726209

result:

ok 1 number(s): "18726209"

Test #154:

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

input:

100 17 527856 754648
14 78 65 5 46 30 51 87 66 18 89 91 16 85 15 56 28 98 12 76 14 79 44 63 93 75 47 81 81 32 36 56 98 25 74 56 79 70 11 49 36 19 56 88 24 13 67 35 15 33 13 24 73 22 92 26 38 7 86 44 40 31 24 56 40 40 25 22 89 44 76 86 83 83 13 53 93 27 96 16 68 59 32 100 69 68 74 40 51 55 76 63 23 4...

output:

24281376

result:

ok 1 number(s): "24281376"

Test #155:

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

input:

100 13 611280 270789
83 32 34 80 34 86 33 27 10 8 22 10 37 8 65 78 73 47 86 85 97 40 52 84 54 87 13 11 55 27 72 65 94 55 45 93 89 74 33 30 90 16 44 8 64 27 21 48 67 22 42 16 7 5 13 77 54 11 8 83 17 62 89 33 64 31 59 74 75 59 79 65 17 35 100 98 97 74 52 43 92 94 4 72 12 22 92 74 68 66 37 72 18 57 45 ...

output:

13547469

result:

ok 1 number(s): "13547469"

Test #156:

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

input:

100 17 727408 819633
65 93 7 68 22 45 16 71 53 99 60 37 46 22 27 88 18 99 71 7 72 97 60 5 19 95 83 26 30 14 4 78 7 77 20 31 4 63 44 15 49 4 28 19 8 53 92 58 19 7 62 12 46 92 34 24 58 14 13 19 7 97 43 18 83 30 93 23 61 74 95 32 47 87 87 51 13 24 100 69 15 28 68 39 59 76 15 12 80 77 2 81 12 66 96 63 3...

output:

32005952

result:

ok 1 number(s): "32005952"

Test #157:

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

input:

100 28 810833 368477
43 43 84 47 10 1 98 6 97 93 97 48 63 45 73 15 71 40 49 16 51 58 77 22 72 16 49 52 100 9 41 78 3 7 95 72 15 68 58 8 3 97 11 31 48 67 47 84 67 100 90 4 80 82 59 79 62 29 30 58 81 28 8 7 11 29 27 68 56 86 7 8 78 48 70 8 21 79 60 3 43 67 36 3 5 25 38 46 97 85 59 98 6 74 44 5 56 5 66...

output:

19382441

result:

ok 1 number(s): "19382441"

Test #158:

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

input:

100 24 894257 884618
24 1 49 22 98 60 80 46 45 91 34 71 80 59 36 33 11 88 31 25 35 15 89 47 33 32 20 78 79 96 73 87 15 40 70 10 29 61 77 85 58 94 95 43 88 85 17 98 15 86 11 4 14 73 80 26 79 32 39 89 63 52 73 84 35 19 65 25 42 5 19 87 8 4 65 53 36 25 13 38 67 2 12 75 52 67 56 84 13 88 24 11 100 90 91...

output:

36375367

result:

ok 1 number(s): "36375367"

Test #159:

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

input:

100 28 10385 241974
2 62 26 10 90 27 63 97 88 78 67 86 97 90 86 51 64 37 16 31 14 72 97 69 86 49 86 96 49 92 9 100 11 66 45 44 36 61 91 70 16 83 70 50 32 3 72 15 70 75 35 97 61 60 1 81 83 44 52 28 41 87 35 69 54 18 91 70 24 28 26 63 42 64 48 6 40 80 69 64 95 37 72 51 98 17 79 14 26 99 89 20 95 98 42...

output:

488095

result:

ok 1 number(s): "488095"

Test #160:

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

input:

100 23 61105 758115
75 16 2 81 74 83 45 37 28 72 5 9 14 4 48 73 5 81 94 48 97 29 5 86 47 61 64 22 27 83 42 1 19 100 20 85 47 58 14 63 63 71 58 66 72 25 39 25 14 64 59 93 95 47 18 36 87 47 73 67 19 18 92 57 82 9 25 18 11 43 38 30 72 24 34 59 48 31 29 90 15 76 44 11 45 66 98 48 34 6 53 26 85 15 94 19 ...

output:

2810830

result:

ok 1 number(s): "2810830"

Test #161:

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

input:

100 31 177233 306959
49 77 67 68 66 38 27 81 76 62 34 24 27 26 98 91 46 34 72 57 68 94 30 7 8 81 35 44 98 70 78 10 19 34 83 23 61 55 24 40 17 68 41 73 12 43 98 39 66 49 84 85 34 38 39 83 3 62 78 2 96 49 57 30 2 8 59 71 97 62 50 9 3 68 17 4 64 77 73 17 31 11 16 82 91 20 12 86 51 18 18 35 83 23 37 62 ...

output:

8507184

result:

ok 1 number(s): "8507184"

Test #162:

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

input:

100 27 260657 855803
31 27 44 44 54 98 9 20 15 52 67 43 44 49 61 13 98 82 58 66 51 51 38 24 61 94 5 62 72 73 6 22 27 59 58 60 72 48 39 25 76 57 29 89 56 57 64 56 22 42 8 81 68 17 60 38 8 66 96 42 78 76 23 19 26 7 97 20 83 77 65 89 33 28 100 61 72 28 29 47 58 46 80 54 34 69 35 24 67 21 83 44 69 31 88...

output:

11468908

result:

ok 1 number(s): "11468908"

Test #163:

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

input:

100 22 606318 980612
67 57 61 20 16 84 6 37 87 92 88 52 89 81 1 77 47 23 35 5 18 98 20 92 16 59 25 42 46 21 77 63 60 77 96 23 68 30 21 66 75 25 67 61 90 62 38 95 82 98 79 9 29 31 11 39 10 47 56 73 37 89 14 66 93 83 64 8 96 86 12 38 91 9 79 81 27 74 19 48 45 23 11 39 43 6 50 80 17 6 44 89 61 40 24 68...

output:

26071674

result:

ok 1 number(s): "26071674"

Test #164:

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

input:

100 18 689742 529456
48 15 38 100 8 39 85 85 38 82 25 79 6 3 59 99 96 72 13 19 2 55 40 2 77 71 95 68 16 12 13 68 56 7 71 65 75 30 44 55 29 14 51 73 34 88 96 5 34 79 3 1 71 22 24 82 15 63 73 12 27 16 75 47 21 74 94 57 83 9 20 14 21 65 58 26 43 17 75 78 69 58 71 7 90 64 73 14 21 13 9 94 55 48 71 2 83 ...

output:

26438694

result:

ok 1 number(s): "26438694"

Test #165:

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

input:

100 21 773166 821405
14 72 6 83 96 95 71 28 78 69 58 98 15 22 21 22 40 12 95 28 81 16 52 23 26 88 65 87 87 7 42 81 68 40 46 98 93 27 54 36 84 7 39 84 74 2 63 23 90 76 32 97 9 9 45 37 31 66 82 47 1 48 41 32 41 73 28 10 69 24 28 89 52 25 45 79 51 71 27 4 93 97 43 79 40 14 88 44 34 25 62 4 45 65 30 48 ...

output:

32472972

result:

ok 1 number(s): "32472972"

Test #166:

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

input:

100 17 856590 370249
96 26 79 58 84 54 53 64 26 71 96 17 36 44 71 40 85 65 81 37 64 73 61 44 91 100 31 9 65 98 78 93 64 66 17 40 4 24 69 21 42 4 22 96 18 20 22 37 33 62 52 94 44 99 70 92 35 77 96 86 82 79 94 17 64 64 62 59 51 35 40 56 86 85 32 32 59 22 79 31 21 32 7 43 83 63 6 78 54 36 27 13 43 73 7...

output:

20319749

result:

ok 1 number(s): "20319749"

Test #167:

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

input:

100 25 972718 919094
73 87 56 42 72 10 31 3 65 61 29 36 53 58 33 50 34 13 58 47 43 30 77 61 52 20 98 27 35 89 10 94 73 92 92 77 11 17 87 2 97 92 10 7 58 34 84 54 85 47 72 90 78 90 91 39 39 81 17 21 60 14 59 6 100 63 100 3 42 54 55 36 12 42 15 77 75 76 40 61 37 75 79 19 29 13 37 16 67 35 96 22 41 89 ...

output:

39896410

result:

ok 1 number(s): "39896410"

Test #168:

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

input:

100 28 56142 467938
55 41 21 25 64 77 18 47 9 52 70 55 70 85 84 72 79 54 36 68 18 95 85 82 5 33 68 53 10 76 47 3 77 26 67 15 25 22 2 91 51 81 85 19 98 52 47 72 41 40 1 82 16 77 12 94 56 96 22 56 38 37 25 79 20 61 34 60 24 69 59 11 46 90 10 34 83 19 92 96 61 6 46 91 76 63 56 53 83 46 57 39 28 97 76 7...

output:

2582532

result:

ok 1 number(s): "2582532"

Test #169:

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

input:

100 24 139566 16782
33 94 98 100 48 37 100 87 57 46 3 74 87 99 42 90 19 2 18 73 98 52 97 3 66 45 46 79 84 75 79 12 81 51 42 60 32 14 20 76 2 78 69 26 42 78 10 86 81 29 21 78 51 60 33 41 60 99 43 96 16 72 90 68 43 56 68 5 18 85 71 86 77 50 97 87 91 73 40 26 88 41 10 50 22 4 74 87 96 58 22 48 22 6 23 ...

output:

978666

result:

ok 1 number(s): "978666"

Test #170:

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

input:

100 32 222990 532923
6 52 74 84 36 92 78 30 100 36 41 93 96 26 96 16 72 55 100 83 81 9 6 21 27 62 13 97 63 62 15 17 81 85 9 98 43 15 39 57 56 66 52 42 82 92 72 3 37 19 49 74 81 47 58 96 64 11 48 31 98 4 47 57 67 55 94 62 5 12 87 62 7 6 80 32 3 24 100 52 8 83 82 22 69 58 93 25 16 65 91 57 16 22 75 46...

output:

11818470

result:

ok 1 number(s): "11818470"

Test #171:

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

input:

100 31 339119 857575
84 6 43 63 24 47 64 70 44 26 74 12 13 40 54 34 13 95 77 92 60 70 26 42 84 78 83 23 29 53 48 29 89 15 79 36 57 8 53 50 10 63 36 49 22 10 35 13 88 8 70 66 28 38 79 47 84 14 65 70 80 35 9 30 91 46 32 7 87 27 98 37 41 66 67 85 10 71 52 83 36 18 50 94 15 7 12 63 21 68 52 67 10 30 26 ...

output:

16616831

result:

ok 1 number(s): "16616831"

Test #172:

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

input:

100 35 422543 439123
65 59 20 42 12 7 47 17 88 21 11 35 34 63 9 52 54 44 63 9 43 27 34 59 41 94 53 50 7 53 84 38 89 45 54 77 68 1 72 31 69 56 24 73 66 24 98 31 32 89 2 70 62 28 100 98 88 21 82 5 61 70 74 19 14 45 66 59 73 42 2 12 71 18 46 38 26 21 8 9 60 49 18 58 62 61 39 97 33 79 17 80 97 46 73 26 ...

output:

22817322

result:

ok 1 number(s): "22817322"

Test #173:

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

input:

100 32 205433 372798
27 50 53 83 59 25 13 48 55 95 89 62 94 33 52 70 37 23 100 17 54 25 26 61 30 2 47 32 63 28 46 60 7 8 32 70 27 53 18 62 69 9 46 16 11 17 79 14 29 63 25 63 51 63 65 30 12 5 39 70 100 66 79 100 3 54 31 99 72 11 100 19 72 89 81 53 72 21 55 21 74 78 78 53 49 71 39 3 100 23 44 47 91 99...

output:

10477083

result:

ok 1 number(s): "10477083"

Test #174:

score: 0
Accepted
time: 370ms
memory: 27796kb

input:

100 10 372172 247800
98 88 56 17 6 5 44 90 100 93 97 2 41 33 26 49 80 71 73 88 72 62 91 89 43 96 89 90 15 7 19 11 47 73 97 79 62 73 61 43 84 79 83 91 27 59 65 6 87 67 31 14 70 60 80 35 66 14 75 100 14 85 55 9 80 32 35 91 98 54 95 26 8 44 57 41 100 4 96 74 19 33 65 52 1 1 93 7 52 78 61 31 30 9 66 5 1...

output:

12642520

result:

ok 1 number(s): "12642520"