#include <bits/stdc++.h>
using namespace std;
const int inf = 0x3f3f3f3f;
const int maxn = 1e5 + 7;
int n, k;
int a[maxn];
int box[maxn];
int main() {
  while (scanf("%d %d", &n, &k) != EOF) {
    if (k > n) k = n;
    for (int i = 0; i < n; ++i) {
      scanf("%d", &a[i]);
    }
    int ans = -1;
    int num = (n - k);
    for (int i = 0; i < num; ++i) {
      box[i] = a[i] + a[(num * 2 - i - 1)];
      ans = max(ans, box[i]);
    }
    for (int i = num * 2; i < n; ++i) {
      box[i] = a[i];
      ans = max(ans, box[i]);
    }
    printf("%d\n", ans);
  }
  return 0;
}
