#include <bits/stdc++.h>
using namespace std;
int main() {
  ios::sync_with_stdio(false);
  int n, k;
  cin >> n >> k;
  vector<int> a(n);
  for (int i = 0; i < n; ++i) cin >> a[i];
  int result = 0;
  int pairs = max(0, n - k);
  for (int i = 0, ii = 2 * pairs - 1; i < pairs; ++i, --ii)
    result = max(result, a[i] + a[ii]);
  for (int i = 2 * pairs; i < n; ++i) result = max(result, a[i]);
  cout << result << endl;
  return 0;
}
