#include <bits/stdc++.h>
using namespace std;
int main() {
  long long int n, k;
  cin >> n >> k;
  long long int arr[n];
  for (int i = 0; i < n; i++) cin >> arr[i];
  if (k > n) {
    cout << arr[n - 1];
    return 0;
  }
  long long int size[k];
  long long int a = n - k;
  int i = 0, j = 2 * a - 1;
  for (; j > i;) {
    size[i] = arr[i] + arr[j];
    i++;
    j--;
  }
  for (int j = 2 * a; j < n; j++) {
    size[i] = arr[j];
    i++;
  }
  sort(size, size + k);
  cout << size[k - 1];
  return 0;
}
