#include <bits/stdc++.h>
using namespace std;
bool solve(long long int x, long long int b[], long long int m,
           long long int a[], long long int n) {
  for (long long int i = 0; i < n; i++) {
    if (upper_bound(b, b + m, a[i] + x) - lower_bound(b, b + m, a[i] - x) <= 0)
      return false;
  }
  return true;
}
int ans[1001][1001];
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  long long int n, k;
  cin >> n >> k;
  long long int s[n], m = 0;
  for (long long int i = 0; i < n; i++) {
    cin >> s[i];
    m = max(m, s[i]);
  }
  if (k >= n) {
    cout << m;
  } else {
    long long int left = n, box = k, i = n - 1, ans = 0, start = 0;
    while (start < i) {
      if (left == 2 * box) {
        ans = max(ans, s[i] + s[start]);
        start++;
        i--;
        left -= 2;
      } else {
        ans = max(ans, s[i]);
        left--;
        i--;
      }
      box--;
    }
    cout << ans;
  }
  return 0;
}
