#include <bits/stdc++.h>
using namespace std;
const int maxn = 1e5 * 1 + 3, inf = 1e9 + 5;
int n, k, s[maxn];
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  cin >> n >> k;
  for (int i = 0; i < n; i++) cin >> s[i];
  long long int l = s[n - 1] - 1, r = s[n - 1] + s[n - 2] + 1;
  while (l < r - 1) {
    long long int mid = (r + l) / 2;
    bool check = 1;
    for (int i = 0, j = n - 1, cnt = 0; i <= j; cnt++, j--) {
      if (cnt == k) {
        check = 0;
        break;
      }
      if (s[i] + s[j] <= mid) i++;
    }
    if (check == 0)
      l = mid;
    else
      r = mid;
  }
  cout << r;
  return 0;
}
