#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, k, max;
  cin >> n >> k;
  if (k > n) k = n;
  vector<int> v(n);
  for (int i = 0; i < n; ++i) {
    cin >> v[i];
  }
  max = v[n - 1];
  for (int i = 0; i < 2 * k - n; ++i) v.pop_back();
  while (v.size() > 0) {
    if (v[0] + v[v.size() - 1] > max) max = v[0] + v[v.size() - 1];
    v.pop_back();
    v.erase(v.begin());
  }
  cout << max << endl;
}
