#include <bits/stdc++.h>
using namespace std;
int main(void) {
  ios_base::sync_with_stdio(false);
  int i, f, g;
  int n, k;
  cin >> n >> k;
  int arr[n + 1];
  for (i = 0; i <= n; i += 1) {
    cin >> arr[i];
  }
  int max = arr[n - 1];
  if (k >= n) {
    cout << max << '\n';
    return 0;
  }
  while (k * 2 != n) {
    --k;
    --n;
  };
  for (i = 0; i <= (n - 1) / 2; i += 1) {
    if (max < arr[i] + arr[n - 1 - i]) {
      max = arr[i] + arr[n - 1 - i];
    }
  }
  cout << max;
  return 0;
}
