#include <bits/stdc++.h>
using namespace std;
int v[100010];
int main() {
  int n, k, mx = 0;
  cin >> n >> k;
  for (int i = 0; i < n; i++) {
    cin >> v[i];
    if (v[i] > mx) mx = v[i];
  }
  if (n <= k) {
    cout << mx;
    return 0;
  }
  int r = 2 * (n - k) - 1;
  for (int i = 0; i < n - k; i++) {
    if (mx < v[i] + v[r - i]) mx = v[i] + v[r - i];
  }
  cout << mx;
  return 0;
}
