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