#include <bits/stdc++.h>
using namespace std;
int a[200005];
int main() {
  int n, k, maxx = 0;
  cin >> n >> k;
  for (int i = 1; i <= n; i++) scanf("%d", &a[i]);
  while ((n + 1) / 2 < k && k > 0 && n > 0) {
    maxx = max(maxx, a[n]);
    n--;
    k--;
  }
  if (n & 1) {
    maxx = max(maxx, a[n]);
    n--;
    k--;
  }
  for (int i = 1; i <= n / 2; i++) {
    maxx = max(maxx, a[i] + a[n - i + 1]);
  }
  cout << maxx;
  return 0;
}
