#include <bits/stdc++.h>
using namespace std;
int main(void) {
  long int n, k;
  scanf("%ld%ld", &n, &k);
  long int s[100000];
  for (long int i = 0; i < n; i++) scanf("%ld", &s[i]);
  if (k >= n)
    printf("%ld", s[n - 1]);
  else {
    long int nballstocombine = n - k;
    long int maxi = s[n - 1];
    for (long int i = 0; i < nballstocombine * 2; i++) {
      if (s[i] + s[(nballstocombine * 2) - 1 - i] > maxi)
        maxi = s[i] + s[(nballstocombine * 2) - 1 - i];
    }
    printf("%ld", maxi);
  }
  return 0;
}
