#include <bits/stdc++.h>
using namespace std;
const int MAXN = 200000;
const int MAXVAL = 1000000;
int ar[MAXN], N, K;
int main() {
  scanf("%d %d", &N, &K);
  for (int i = 0; i < N; ++i) scanf("%d", &ar[i]);
  int minBoxSize = 0;
  while (1) {
    if (2 * K == N or N == 0) break;
    if (((N & 1) != 0)) {
      minBoxSize = max(minBoxSize, ar[N - 1]);
      N--;
      --K;
    } else {
      minBoxSize = max(minBoxSize, ar[N - 1]);
      N--;
      --K;
    }
  }
  int from = 0, to = N - 1;
  while (from < to) {
    minBoxSize = max(minBoxSize, ar[from] + ar[to]);
    ++from;
    --to;
  }
  printf("%d\n", minBoxSize);
  return 0;
}
