#include <bits/stdc++.h>
using namespace std;
static const int N = 1e5 + 10;
int n, k, s[N];
int main() {
  cin >> n >> k;
  int sum = 0;
  for (int i = 1; i <= n; ++i) cin >> s[i], sum += s[i];
  if (k == 1) {
    cout << s[1] + s[2];
    return 0;
  }
  int hn = n >> 1;
  if (n % 2 == 1) ++hn;
  if (hn == k) {
    int ans = 0;
    if (n % 2 == 0)
      for (int i = 1; i <= hn; ++i) ans = max(ans, s[i] + s[n - i + 1]);
    if (n % 2 == 1) {
      for (int i = 1; i < hn; ++i) ans = max(ans, s[i] + s[n - 1]);
      ans = max(ans, s[n]);
    }
    cout << ans;
    return 0;
  }
  int rem = k - hn;
  int ans = s[n];
  if (n % 2 == 0)
    n -= rem * 2;
  else
    n -= rem * 2 + 1;
  for (int i = 1; i <= n >> 1; ++i) ans = max(ans, s[i] + s[n - i + 1]);
  cout << ans;
  return 0;
}
