#include <bits/stdc++.h>
using namespace std;
template <typename T>
ostream& operator<<(ostream& output, vector<T>& v) {
  output << "[ ";
  if (int(v.size())) {
    output << v[0];
  }
  for (int i = 1; i < int(v.size()); i++) {
    output << ", " << v[i];
  }
  output << " ]";
  return output;
}
template <typename T1, typename T2>
ostream& operator<<(ostream& output, pair<T1, T2>& p) {
  output << "( " << p.first << ", " << p.second << " )";
  return output;
}
template <typename T>
ostream& operator,(ostream& output, T x) {
  output << x << " ";
  return output;
}
long long dp[5007][5007];
long long p[5007], comu[5007];
int n, m, k;
long long sum(int start) {
  return comu[start + m - 1] - (start > 0 ? comu[start - 1] : 0);
}
long long rec(int start, int bakislot) {
  if (bakislot == 0) {
    return 0;
  } else {
    if (start + m > n) {
      return -(1 << 29);
    } else {
      long long& ret = dp[start][bakislot];
      if (ret != -1) {
        return ret;
      } else
        return ret = max(sum(start) + rec(start + m, bakislot - 1),
                         rec(start + 1, bakislot));
    }
  }
}
int main() {
  memset(dp, -1, sizeof(dp));
  cin >> n >> m >> k;
  for (int i = 0; i < n; i++) {
    cin >> p[i];
  }
  comu[0] = p[0];
  for (int i = 1; i < n; i++) {
    comu[i] = comu[i - 1] + p[i];
  }
  cout << rec(0, k) << endl;
}

### Prompt

Create a solution in CPP for the following problem:

The new ITone 6 has been released recently and George got really keen to buy it. Unfortunately, he didn't have enough money, so George was going to work as a programmer. Now he faced the following problem at the work.

Given a sequence of n integers p1, p2, ..., pn. You are to choose k pairs of integers:

[l1, r1], [l2, r2], ..., [lk, rk] (1 ≤ l1 ≤ r1 < l2 ≤ r2 < ... < lk ≤ rk ≤ n; ri - li + 1 = m), 

in such a way that the value of sum <image> is maximal possible. Help George to cope with the task.

Input

The first line contains three integers n, m and k (1 ≤ (m × k) ≤ n ≤ 5000). The second line contains n integers p1, p2, ..., pn (0 ≤ pi ≤ 109).

Output

Print an integer in a single line — the maximum possible value of sum.

Examples

Input

5 2 1
1 2 3 4 5


Output

9


Input

7 1 3
2 10 7 18 5 33 0


Output

61

### Response

```cpp
#include <bits/stdc++.h>
using namespace std;
template <typename T>
ostream& operator<<(ostream& output, vector<T>& v) {
  output << "[ ";
  if (int(v.size())) {
    output << v[0];
  }
  for (int i = 1; i < int(v.size()); i++) {
    output << ", " << v[i];
  }
  output << " ]";
  return output;
}
template <typename T1, typename T2>
ostream& operator<<(ostream& output, pair<T1, T2>& p) {
  output << "( " << p.first << ", " << p.second << " )";
  return output;
}
template <typename T>
ostream& operator,(ostream& output, T x) {
  output << x << " ";
  return output;
}
long long dp[5007][5007];
long long p[5007], comu[5007];
int n, m, k;
long long sum(int start) {
  return comu[start + m - 1] - (start > 0 ? comu[start - 1] : 0);
}
long long rec(int start, int bakislot) {
  if (bakislot == 0) {
    return 0;
  } else {
    if (start + m > n) {
      return -(1 << 29);
    } else {
      long long& ret = dp[start][bakislot];
      if (ret != -1) {
        return ret;
      } else
        return ret = max(sum(start) + rec(start + m, bakislot - 1),
                         rec(start + 1, bakislot));
    }
  }
}
int main() {
  memset(dp, -1, sizeof(dp));
  cin >> n >> m >> k;
  for (int i = 0; i < n; i++) {
    cin >> p[i];
  }
  comu[0] = p[0];
  for (int i = 1; i < n; i++) {
    comu[i] = comu[i - 1] + p[i];
  }
  cout << rec(0, k) << endl;
}

```