#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, k;
  cin >> n >> k;
  vector<int> sizes;
  int x;
  while (cin >> x) {
    sizes.push_back(x);
  }
  int min = sizes.back();
  for (int i = 0; i < (n - k) * 2; i++) {
    int size = sizes[i] + sizes[(n - k) * 2 - i - 1];
    if (size > min) {
      min = size;
    }
  }
  printf("%d", min);
  return 0;
}
