QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#235734#7648. 网格图最大流计数hos_lyric100 ✓2101ms31860kbC++1412.5kb2023-11-03 07:31:092023-11-03 07:31:10

Judging History

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

  • [2023-11-03 07:31:10]
  • 评测
  • 测评结果:100
  • 用时:2101ms
  • 内存:31860kb
  • [2023-11-03 07:31:09]
  • 提交

answer

#include <cassert>
#include <cmath>
#include <cstdint>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <algorithm>
#include <bitset>
#include <complex>
#include <deque>
#include <functional>
#include <iostream>
#include <limits>
#include <map>
#include <numeric>
#include <queue>
#include <random>
#include <set>
#include <sstream>
#include <string>
#include <unordered_map>
#include <unordered_set>
#include <utility>
#include <vector>

using namespace std;

using Int = long long;

template <class T1, class T2> ostream &operator<<(ostream &os, const pair<T1, T2> &a) { return os << "(" << a.first << ", " << a.second << ")"; };
template <class T> ostream &operator<<(ostream &os, const vector<T> &as) { const int sz = as.size(); os << "["; for (int i = 0; i < sz; ++i) { if (i >= 256) { os << ", ..."; break; } if (i > 0) { os << ", "; } os << as[i]; } return os << "]"; }
template <class T> void pv(T a, T b) { for (T i = a; i != b; ++i) cerr << *i << " "; cerr << endl; }
template <class T> bool chmin(T &t, const T &f) { if (t > f) { t = f; return true; } return false; }
template <class T> bool chmax(T &t, const T &f) { if (t < f) { t = f; return true; } return false; }
#define COLOR(s) ("\x1b[" s "m")

////////////////////////////////////////////////////////////////////////////////
template <unsigned M_> struct ModInt {
  static constexpr unsigned M = M_;
  unsigned x;
  constexpr ModInt() : x(0U) {}
  constexpr ModInt(unsigned x_) : x(x_ % M) {}
  constexpr ModInt(unsigned long long x_) : x(x_ % M) {}
  constexpr ModInt(int x_) : x(((x_ %= static_cast<int>(M)) < 0) ? (x_ + static_cast<int>(M)) : x_) {}
  constexpr ModInt(long long x_) : x(((x_ %= static_cast<long long>(M)) < 0) ? (x_ + static_cast<long long>(M)) : x_) {}
  ModInt &operator+=(const ModInt &a) { x = ((x += a.x) >= M) ? (x - M) : x; return *this; }
  ModInt &operator-=(const ModInt &a) { x = ((x -= a.x) >= M) ? (x + M) : x; return *this; }
  ModInt &operator*=(const ModInt &a) { x = (static_cast<unsigned long long>(x) * a.x) % M; return *this; }
  ModInt &operator/=(const ModInt &a) { return (*this *= a.inv()); }
  ModInt pow(long long e) const {
    if (e < 0) return inv().pow(-e);
    ModInt a = *this, b = 1U; for (; e; e >>= 1) { if (e & 1) b *= a; a *= a; } return b;
  }
  ModInt inv() const {
    unsigned a = M, b = x; int y = 0, z = 1;
    for (; b; ) { const unsigned q = a / b; const unsigned c = a - q * b; a = b; b = c; const int w = y - static_cast<int>(q) * z; y = z; z = w; }
    assert(a == 1U); return ModInt(y);
  }
  ModInt operator+() const { return *this; }
  ModInt operator-() const { ModInt a; a.x = x ? (M - x) : 0U; return a; }
  ModInt operator+(const ModInt &a) const { return (ModInt(*this) += a); }
  ModInt operator-(const ModInt &a) const { return (ModInt(*this) -= a); }
  ModInt operator*(const ModInt &a) const { return (ModInt(*this) *= a); }
  ModInt operator/(const ModInt &a) const { return (ModInt(*this) /= a); }
  template <class T> friend ModInt operator+(T a, const ModInt &b) { return (ModInt(a) += b); }
  template <class T> friend ModInt operator-(T a, const ModInt &b) { return (ModInt(a) -= b); }
  template <class T> friend ModInt operator*(T a, const ModInt &b) { return (ModInt(a) *= b); }
  template <class T> friend ModInt operator/(T a, const ModInt &b) { return (ModInt(a) /= b); }
  explicit operator bool() const { return x; }
  bool operator==(const ModInt &a) const { return (x == a.x); }
  bool operator!=(const ModInt &a) const { return (x != a.x); }
  friend std::ostream &operator<<(std::ostream &os, const ModInt &a) { return os << a.x; }
};
////////////////////////////////////////////////////////////////////////////////

constexpr unsigned MO = 1000000007;
using Mint = ModInt<MO>;


template <class Flow> struct MaxFlow {
  // Watch out when using types other than int and long long.
  static constexpr Flow FLOW_EPS = 1e-10L;
  static constexpr Flow FLOW_INF = std::numeric_limits<Flow>::max();
  
  int n, m;
  vector<int> ptr, nxt, zu;
  vector<Flow> capa;

  explicit MaxFlow(int n_) : n(n_), m(0), ptr(n_, -1) {}
  void ae(int u, int v, Flow w0, Flow w1 = 0) {
    assert(0 <= u); assert(u < n);
    assert(0 <= v); assert(v < n);
    assert(0 <= w0);
    assert(0 <= w1);
    nxt.push_back(ptr[u]); zu.push_back(v); capa.push_back(w0); ptr[u] = m++;
    nxt.push_back(ptr[v]); zu.push_back(u); capa.push_back(w1); ptr[v] = m++;
  }

  vector<int> see, lev, que;

  Flow augment(int u, int t, Flow limFlow) {
    if (u == t) return limFlow;
    for (int &i = see[u]; ~i; i = nxt[i]) if (capa[i] > FLOW_EPS) {
      const int v = zu[i];
      if (lev[u] < lev[v]) {
        const Flow f = augment(v, t, min(limFlow, capa[i]));
        if (f > FLOW_EPS) { capa[i] -= f; capa[i ^ 1] += f; return f; }
      }
    }
    return 0;
  }
  bool bfs(int s, int t) {
    for (int u = 0; u < n; ++u) { see[u] = ptr[u]; lev[u] = -1; }
    auto head = que.begin(), tail = que.begin();
    for (lev[*tail++ = s] = 0; head != tail; ) {
      const int u = *head++;
      for (int i = ptr[u]; ~i; i = nxt[i]) if (capa[i] > FLOW_EPS) {
        const int v = zu[i];
        if (!~lev[v]) {
          lev[*tail++ = v] = lev[u] + 1;
          if (v == t) return true;
        }
      }
    }
    return false;
  }
  Flow run(int s, int t, Flow limFlow = FLOW_INF) {
    see.resize(n); lev.resize(n); que.resize(n);
    Flow flow = 0;
    for (; flow + FLOW_EPS < limFlow && bfs(s, t); ) {
      for (Flow f; (f = augment(s, t, limFlow - flow)) > FLOW_EPS; flow += f) {}
    }
    return flow;
  }
};

////////////////////////////////////////////////////////////////////////////////


// det(a + x I)
// O(n^3)
//   Call by value: Modifies a (Watch out when using C-style array!)
template <class T> vector<T> charPoly(vector<vector<T>> a) {
  const int n = a.size();
  // upper Hessenberg
  for (int j = 0; j < n - 2; ++j) {
    for (int i = j + 1; i < n; ++i) {
      if (a[i][j]) {
        swap(a[j + 1], a[i]);
        for (int ii = 0; ii < n; ++ii) swap(a[ii][j + 1], a[ii][i]);
        break;
      }
    }
    if (a[j + 1][j]) {
      const T s = 1 / a[j + 1][j];
      for (int i = j + 2; i < n; ++i) {
        const T t = s * a[i][j];
        for (int jj = j; jj < n; ++jj) a[i][jj] -= t * a[j + 1][jj];
        for (int ii = 0; ii < n; ++ii) a[ii][j + 1] += t * a[ii][i];
      }
    }
  }
  // fss[i] := det(a[0..i][0..i] + x I_i)
  vector<vector<T>> fss(n + 1);
  fss[0] = {1};
  for (int i = 0; i < n; ++i) {
    fss[i + 1].assign(i + 2, 0);
    for (int k = 0; k <= i; ++k) fss[i + 1][k + 1] = fss[i][k];
    for (int k = 0; k <= i; ++k) fss[i + 1][k] += a[i][i] * fss[i][k];
    T prod = 1;
    for (int j = i - 1; j >= 0; --j) {
      prod *= -a[j + 1][j];
      const T t = prod * a[j][i];
      for (int k = 0; k <= j; ++k) fss[i + 1][k] += t * fss[j][k];
    }
  }
  return fss[n];
}

// det(a[0] + x a[1] + ... + x^m a[m])
// O((m n)^3)
//   Call by value: Modifies a (Watch out when using C-style array!)
template <class T> vector<T> detPoly(vector<vector<vector<T>>> a) {
  assert(!a.empty());
  const int m = a.size() - 1, n = a[0].size();
  T prod = 1;
  int off = 0;
  for (int h = 0; h < n; ++h) {
    for (; ; ) {
      if (a[m][h][h]) break;
      for (int j = h + 1; j < n; ++j) {
        if (a[m][h][j]) {
          prod = -prod;
          for (int d = 0; d <= m; ++d) for (int i = 0; i < n; ++i) {
            swap(a[d][i][h], a[d][i][j]);
          }
          break;
        }
      }
      if (a[m][h][h]) break;
      if (++off > m * n) return vector<T>(m * n + 1, 0);
      for (int d = m; --d >= 0; ) for (int j = 0; j < n; ++j) {
        a[d + 1][h][j] = a[d][h][j];
      }
      for (int j = 0; j < n; ++j) {
        a[0][h][j] = 0;
      }
      for (int i = 0; i < h; ++i) {
        const T t = a[m][h][i];
        for (int d = 0; d <= m; ++d) for (int j = 0; j < n; ++j) {
          a[d][h][j] -= t * a[d][i][j];
        }
      }
    }
    prod *= a[m][h][h];
    const T s = 1 / a[m][h][h];
    for (int d = 0; d <= m; ++d) for (int j = 0; j < n; ++j) {
      a[d][h][j] *= s;
    }
    for (int i = 0; i < n; ++i) if (h != i) {
      const T t = a[m][i][h];
      for (int d = 0; d <= m; ++d) for (int j = 0; j < n; ++j) {
        a[d][i][j] -= t * a[d][h][j];
      }
    }
  }
  vector<vector<T>> b(m * n, vector<T>(m * n, 0));
  for (int i = 0; i < (m - 1) * n; ++i) b[i][n + i] = -1;
  for (int d = 0; d < m; ++d) {
    for (int i = 0; i < n; ++i) for (int j = 0; j < n; ++j) {
      b[(m - 1) * n + i][d * n + j] = a[d][i][j];
    }
  }
  const vector<T> fs = charPoly(b);
  vector<T> gs(m * n + 1, 0);
  for (int i = 0; off + i <= m * n; ++i) gs[i] = prod * fs[off + i];
  return gs;
}


/*
  f[i0][i1]: #{pair of disjoint paths from i0 and from i1}
  
  M = 3
  3: virtual point
  of 
     [                   +1 + x^2 f[0][1]  -1 + x^2 f[0][2]  +1 + x f[0][3] ]
  pf [ -1 + x^2 f[1][0]                    +1 + x^2 f[1][2]  -1 + x f[1][3] ]
     [ +1 + x^2 f[2][0]  -1 + x^2 f[2][1]                    +1 + x f[2][3] ]
     [ -1 + x   f[3][0]  +1 + x   f[3][1]  -1 + x   f[3][2]                 ]
  = 1 + O(x)
  
  M = 4
  4: virtual point, 5: never used
     [                   +1 + x^2 f[0][1]  -1 + x^2 f[0][2]  +1 + x^2 f[0][3]  -1 + x f[0][4]  +1 ]
     [ -1 + x^2 f[1][0]                    +1 + x^2 f[1][2]  -1 + x^2 f[1][3]  +1 + x f[1][4]  -1 ]
  pf [ +1 + x^2 f[2][0]  -1 + x^2 f[2][1]                    +1 + x^2 f[2][3]  -1 + x f[2][4]  +1 ]
     [ -1 + x^2 f[3][0]  +1 + x^2 f[3][1]  -1 + x^2 f[3][2]                    +1 + x f[3][4]  -1 ]
     [ +1 + x   f[4][0]  -1 + x   f[4][1]  +1 + x   f[4][2]  -1 + x   f[4][3]                  +1 ]
     [ -1                +1                -1                +1                -1                 ]
  = 1 + O(x)
*/

int M, N, K;
vector<int> A, B;
char S[410][410];

int id(int s, int x, int y) {
  return 2 + (x * K + y) * 2 + s;
}

int F;
Mint path[410][410];
Mint pathSum[410][410];

int main() {
  for (; ~scanf("%d%d%d", &M, &N, &K); ) {
    A.resize(M); for (int i = 0; i < M; ++i) { scanf("%d", &A[i]); --A[i]; }
    B.resize(N); for (int j = 0; j < N; ++j) { scanf("%d", &B[j]); --B[j]; }
    for (int x = 0; x < K; ++x) {
      scanf("%s", S[x]);
    }
    
    MaxFlow<int> mf(2 + 2 * K * K);
    for (int i = 0; i < M; ++i) mf.ae(0, id(0, 0, A[i]), 1);
    for (int j = 0; j < N; ++j) mf.ae(id(1, K - 1, B[j]), 1, 1);
    for (int x = 0; x < K; ++x) for (int y = 0; y < K; ++y) {
      if (x + 1 < K) mf.ae(id(1, x, y), id(0, x + 1, y), 1);
      if (y + 1 < K) mf.ae(id(1, x, y), id(0, x, y + 1), 1);
    }
    for (int x = 0; x < K; ++x) for (int y = 0; y < K; ++y) if (S[x][y] == '1') mf.ae(id(0, x, y), id(1, x, y), 1);
    F = mf.run(0, 1);
    
    memset(path, 0, sizeof(path));
    static Mint dp[410][410];
    for (int i = 0; i < M; ++i) {
      memset(dp, 0, sizeof(dp));
      dp[0][A[i]] = 1;
      for (int x = 0; x < K; ++x) for (int y = 0; y < K; ++y) if (S[x][y] == '1') {
        if (x + 1 < K && S[x + 1][y] == '1') dp[x + 1][y] += dp[x][y];
        if (y + 1 < K && S[x][y + 1] == '1') dp[x][y + 1] += dp[x][y];
      }
      for (int j = 0; j < N; ++j) {
        path[i][j] = dp[K - 1][B[j]];
      }
    }
    memset(pathSum, 0, sizeof(pathSum));
    for (int i = 0; i < M; ++i) {
      for (int j = 0; j < N; ++j) {
        pathSum[i][j + 1] = pathSum[i][j] + path[i][j];
      }
    }
    
    const int m = (M % 2 != 0) ? (M + 1) : (M + 2);
    vector<vector<vector<Mint>>> mat(3, vector<vector<Mint>>(m, vector<Mint>(m, 0)));
    for (int i0 = 0; i0 < m; ++i0) for (int i1 = i0 + 1; i1 < m; ++i1) {
      const Mint s = ((i1 - i0 - 1) & 1) ? -1 : +1;
      mat[0][i0][i1] += s;
      mat[0][i1][i0] -= s;
    }
    for (int i0 = 0; i0 < M; ++i0) for (int i1 = i0 + 1; i1 < M; ++i1) {
      Mint t = 0;
      for (int j1 = 0; j1 < N; ++j1) {
        t += pathSum[i0][j1] * path[i1][j1] - path[i0][j1] * pathSum[i1][j1];
      }
      mat[2][i0][i1] += t;
      mat[2][i1][i0] -= t;
    }
    for (int i = 0; i < M; ++i) {
      const Mint t = pathSum[i][N];
      mat[1][i][M] += t;
      mat[1][M][i] -= t;
    }
    
    const auto ps = detPoly(mat);
// cerr<<"ps = "<<ps<<endl;
    assert(ps[0] == 1);
    vector<Mint> qs(m + 1, 0);
    qs[0] = 1;
    for (int k = 1; k <= m; ++k) {
      Mint t = ps[k];
      for (int l = 1; l < k; ++l) t -= qs[l] * qs[k - l];
      qs[k] = t / 2;
    }
// cerr<<"qs = "<<qs<<endl;
    printf("%d %u\n", F, qs[F].x);
  }
  return 0;
}

詳細信息

Subtask #1:

score: 5
Accepted

Test #1:

score: 5
Accepted
time: 1ms
memory: 5656kb

input:

7 7 7
1 2 3 4 5 6 7
1 2 3 4 5 6 7
1111111
1111111
1111111
1111111
1111111
1111111
1111111

output:

7 1

result:

ok 2 number(s): "7 1"

Test #2:

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

input:

7 7 7
1 2 3 4 5 6 7
1 2 3 4 5 6 7
1111111
1111111
1111111
1111111
1111111
1111111
1111111

output:

7 1

result:

ok 2 number(s): "7 1"

Test #3:

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

input:

7 7 7
1 2 3 4 5 6 7
1 2 3 4 5 6 7
1111111
1111111
1111111
1111111
1111111
1111111
1111111

output:

7 1

result:

ok 2 number(s): "7 1"

Test #4:

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

input:

7 7 7
1 2 3 4 5 6 7
1 2 3 4 5 6 7
1111111
1111111
1111111
1111111
1111111
1110111
1111111

output:

6 52

result:

ok 2 number(s): "6 52"

Test #5:

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

input:

7 7 7
1 2 3 4 5 6 7
1 2 3 4 5 6 7
1111111
1111111
1111111
1111111
1111111
1110111
1111111

output:

6 52

result:

ok 2 number(s): "6 52"

Subtask #2:

score: 5
Accepted

Dependency #1:

100%
Accepted

Test #6:

score: 5
Accepted
time: 1ms
memory: 5840kb

input:

16 17 18
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17
111111111111111111
111111111111111111
111011111111111111
111111111111111111
111111111111111111
111011110111111111
111111111111111111
111111111111111111
111111111111111111
111111111111111111
111111111111111111
1...

output:

14 328354990

result:

ok 2 number(s): "14 328354990"

Test #7:

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

input:

17 16 18
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17
2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17
111111111111111111
111111111111111111
111111111111111111
111111111111111111
111111111111111111
111111111111111111
111111111111111111
111111111111111111
111111101111111111
111111111111111111
111111111111011111
...

output:

15 449998848

result:

ok 2 number(s): "15 449998848"

Test #8:

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

input:

16 18 18
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18
111111111111110111
111111111111111111
111111111111111111
111111111111111111
111111111111111111
111111111111111111
111111111111111111
111111111111111111
111111111110111111
111111111111111111
11111111111111111...

output:

15 844316215

result:

ok 2 number(s): "15 844316215"

Test #9:

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

input:

16 17 18
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17
111111111111111111
111111111111111111
111011111111110111
111111111111111111
111111111111111111
111011111111111111
111111111111111111
111111111111111111
111111111111111111
111111111111111111
111111111111111111
1...

output:

15 133840

result:

ok 2 number(s): "15 133840"

Test #10:

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

input:

18 18 18
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18
111111111111111111
111111111111111111
111111111111111111
111111111111111111
111111111111111111
111111111111111111
111111111011111111
111111111111111111
111101111111111111
111111111111111111
11111111111...

output:

16 27330297

result:

ok 2 number(s): "16 27330297"

Subtask #3:

score: 10
Accepted

Dependency #2:

100%
Accepted

Test #11:

score: 10
Accepted
time: 60ms
memory: 21388kb

input:

10 377 400
1 2 3 4 5 6 7 8 9 10
12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 ...

output:

10 843273461

result:

ok 2 number(s): "10 843273461"

Test #12:

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

input:

10 367 400
1 2 3 4 5 6 7 8 9 10
17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104...

output:

10 273577493

result:

ok 2 number(s): "10 273577493"

Test #13:

score: 0
Accepted
time: 56ms
memory: 21584kb

input:

10 350 400
1 2 3 4 5 6 7 8 9 10
26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 11...

output:

9 605707862

result:

ok 2 number(s): "9 605707862"

Test #14:

score: 0
Accepted
time: 63ms
memory: 22020kb

input:

10 375 400
1 2 3 4 5 6 7 8 9 10
13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101...

output:

10 213051017

result:

ok 2 number(s): "10 213051017"

Test #15:

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

input:

10 330 400
1 2 3 4 5 6 7 8 9 10
36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 ...

output:

9 320097125

result:

ok 2 number(s): "9 320097125"

Test #16:

score: 0
Accepted
time: 48ms
memory: 21668kb

input:

10 360 400
1 2 3 4 5 6 7 8 9 10
21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107...

output:

10 195548453

result:

ok 2 number(s): "10 195548453"

Test #17:

score: 0
Accepted
time: 56ms
memory: 22076kb

input:

10 365 400
1 2 3 4 5 6 7 8 9 10
18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 10...

output:

10 20617593

result:

ok 2 number(s): "10 20617593"

Test #18:

score: 0
Accepted
time: 59ms
memory: 21700kb

input:

10 334 400
1 2 3 4 5 6 7 8 9 10
34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 11...

output:

10 602177426

result:

ok 2 number(s): "10 602177426"

Test #19:

score: 0
Accepted
time: 49ms
memory: 21524kb

input:

10 323 400
1 2 3 4 5 6 7 8 9 10
39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 1...

output:

9 619229914

result:

ok 2 number(s): "9 619229914"

Test #20:

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

input:

10 379 400
1 2 3 4 5 6 7 8 9 10
11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 1...

output:

10 409116219

result:

ok 2 number(s): "10 409116219"

Subtask #4:

score: 25
Accepted

Dependency #3:

100%
Accepted

Test #21:

score: 25
Accepted
time: 476ms
memory: 22472kb

input:

100 322 400
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 ...

output:

85 207066474

result:

ok 2 number(s): "85 207066474"

Test #22:

score: 0
Accepted
time: 443ms
memory: 22536kb

input:

100 334 400
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 ...

output:

84 608992198

result:

ok 2 number(s): "84 608992198"

Test #23:

score: 0
Accepted
time: 362ms
memory: 22216kb

input:

100 373 400
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 ...

output:

87 22076236

result:

ok 2 number(s): "87 22076236"

Test #24:

score: 0
Accepted
time: 489ms
memory: 22304kb

input:

100 327 400
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 ...

output:

87 819624712

result:

ok 2 number(s): "87 819624712"

Test #25:

score: 0
Accepted
time: 459ms
memory: 22272kb

input:

100 326 400
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 ...

output:

89 339092727

result:

ok 2 number(s): "89 339092727"

Test #26:

score: 0
Accepted
time: 389ms
memory: 22180kb

input:

100 366 400
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 ...

output:

87 577188664

result:

ok 2 number(s): "87 577188664"

Test #27:

score: 0
Accepted
time: 420ms
memory: 22324kb

input:

100 394 400
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 ...

output:

86 909840591

result:

ok 2 number(s): "86 909840591"

Test #28:

score: 0
Accepted
time: 343ms
memory: 22592kb

input:

100 389 400
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 ...

output:

87 793712350

result:

ok 2 number(s): "87 793712350"

Test #29:

score: 0
Accepted
time: 513ms
memory: 22696kb

input:

100 334 400
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 ...

output:

89 8486281

result:

ok 2 number(s): "89 8486281"

Test #30:

score: 0
Accepted
time: 371ms
memory: 22644kb

input:

100 367 400
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 ...

output:

87 419573333

result:

ok 2 number(s): "87 419573333"

Subtask #5:

score: 10
Accepted

Test #31:

score: 10
Accepted
time: 544ms
memory: 22412kb

input:

73 73 400
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73
109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 ...

output:

73 849796347

result:

ok 2 number(s): "73 849796347"

Test #32:

score: 0
Accepted
time: 501ms
memory: 21980kb

input:

68 68 400
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68
129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152...

output:

68 334069950

result:

ok 2 number(s): "68 334069950"

Test #33:

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

input:

72 72 400
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72
113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133...

output:

72 180096245

result:

ok 2 number(s): "72 180096245"

Test #34:

score: 0
Accepted
time: 561ms
memory: 21992kb

input:

71 71 400
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71
117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 13...

output:

71 234343448

result:

ok 2 number(s): "71 234343448"

Test #35:

score: 0
Accepted
time: 480ms
memory: 21836kb

input:

68 68 400
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68
129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152...

output:

68 371509898

result:

ok 2 number(s): "68 371509898"

Test #36:

score: 0
Accepted
time: 791ms
memory: 24636kb

input:

200 200 400
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 ...

output:

200 852372194

result:

ok 2 number(s): "200 852372194"

Test #37:

score: 0
Accepted
time: 885ms
memory: 25004kb

input:

230 230 400
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 ...

output:

230 65874836

result:

ok 2 number(s): "230 65874836"

Test #38:

score: 0
Accepted
time: 967ms
memory: 26168kb

input:

260 260 400
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 ...

output:

260 272563656

result:

ok 2 number(s): "260 272563656"

Test #39:

score: 0
Accepted
time: 1089ms
memory: 27508kb

input:

290 290 400
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 ...

output:

290 95450701

result:

ok 2 number(s): "290 95450701"

Test #40:

score: 0
Accepted
time: 1196ms
memory: 28152kb

input:

320 320 400
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 ...

output:

320 266455174

result:

ok 2 number(s): "320 266455174"

Subtask #6:

score: 25
Accepted

Dependency #5:

100%
Accepted

Test #41:

score: 25
Accepted
time: 202ms
memory: 22184kb

input:

107 371 400
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 ...

output:

107 3979643

result:

ok 2 number(s): "107 3979643"

Test #42:

score: 0
Accepted
time: 232ms
memory: 22500kb

input:

101 351 400
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 ...

output:

101 372994325

result:

ok 2 number(s): "101 372994325"

Test #43:

score: 0
Accepted
time: 203ms
memory: 22404kb

input:

101 369 400
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 ...

output:

101 46156842

result:

ok 2 number(s): "101 46156842"

Test #44:

score: 0
Accepted
time: 129ms
memory: 22156kb

input:

101 386 400
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 ...

output:

101 634357614

result:

ok 2 number(s): "101 634357614"

Test #45:

score: 0
Accepted
time: 154ms
memory: 22496kb

input:

109 388 400
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 ...

output:

109 24613754

result:

ok 2 number(s): "109 24613754"

Test #46:

score: 0
Accepted
time: 268ms
memory: 24500kb

input:

200 399 400
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 ...

output:

200 342259639

result:

ok 2 number(s): "200 342259639"

Test #47:

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

input:

230 393 400
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 ...

output:

230 596706635

result:

ok 2 number(s): "230 596706635"

Test #48:

score: 0
Accepted
time: 480ms
memory: 26664kb

input:

260 393 400
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 ...

output:

260 569883617

result:

ok 2 number(s): "260 569883617"

Test #49:

score: 0
Accepted
time: 605ms
memory: 26988kb

input:

290 395 400
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 ...

output:

290 473037952

result:

ok 2 number(s): "290 473037952"

Test #50:

score: 0
Accepted
time: 771ms
memory: 28248kb

input:

320 397 400
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 ...

output:

320 375576485

result:

ok 2 number(s): "320 375576485"

Subtask #7:

score: 20
Accepted

Dependency #1:

100%
Accepted

Dependency #2:

100%
Accepted

Dependency #3:

100%
Accepted

Dependency #4:

100%
Accepted

Dependency #5:

100%
Accepted

Dependency #6:

100%
Accepted

Test #51:

score: 20
Accepted
time: 1001ms
memory: 31212kb

input:

400 375 400
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 ...

output:

0 1

result:

ok 2 number(s): "0 1"

Test #52:

score: 0
Accepted
time: 1356ms
memory: 31748kb

input:

400 346 400
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 ...

output:

44 259349435

result:

ok 2 number(s): "44 259349435"

Test #53:

score: 0
Accepted
time: 1760ms
memory: 31860kb

input:

400 368 400
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 ...

output:

92 934744081

result:

ok 2 number(s): "92 934744081"

Test #54:

score: 0
Accepted
time: 1844ms
memory: 31524kb

input:

400 331 400
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 ...

output:

118 819815069

result:

ok 2 number(s): "118 819815069"

Test #55:

score: 0
Accepted
time: 1724ms
memory: 29600kb

input:

355 385 400
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 ...

output:

154 827736761

result:

ok 2 number(s): "154 827736761"

Test #56:

score: 0
Accepted
time: 2078ms
memory: 31792kb

input:

400 380 400
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 ...

output:

165 936566720

result:

ok 2 number(s): "165 936566720"

Test #57:

score: 0
Accepted
time: 1892ms
memory: 30644kb

input:

382 335 400
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 ...

output:

164 615816056

result:

ok 2 number(s): "164 615816056"

Test #58:

score: 0
Accepted
time: 2101ms
memory: 31692kb

input:

400 324 400
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 ...

output:

180 258747176

result:

ok 2 number(s): "180 258747176"

Test #59:

score: 0
Accepted
time: 2084ms
memory: 31676kb

input:

400 326 400
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 ...

output:

191 245039016

result:

ok 2 number(s): "191 245039016"

Test #60:

score: 0
Accepted
time: 1666ms
memory: 28868kb

input:

333 388 400
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 ...

output:

212 219763298

result:

ok 2 number(s): "212 219763298"

Extra Test:

score: 0
Extra Test Passed