#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, k;
  cin >> n >> k;
  int i, j;
  int arr[n], ans[k];
  memset(ans, 0, sizeof(ans));
  for (int i = 0; i < n; i++) {
    cin >> arr[i];
  }
  if (k >= n) {
    for (i = 0; i < n; i++) ans[i] = arr[i];
  } else if (2 * k == n) {
    for (i = 0; i < k; i++) {
      ans[i] = arr[i] + arr[n - i - 1];
    }
  } else if (2 * k > n) {
    int l = n, box = 2 * k, m = k;
    while (box > n) {
      ans[m - 1] = arr[l - 1];
      m--;
      l--;
      box--;
    }
    for (i = 0; i < m; i++) {
      ans[i] = arr[i] + arr[l - 1];
      l--;
    }
  }
  int max_ele = INT_MIN;
  for (i = 0; i < k; i++) {
    if (ans[i] > max_ele) max_ele = ans[i];
  }
  cout << max_ele;
}
