#include <bits/stdc++.h>

using namespace std;
const int N = 100100;
int a[N];

int main() {
    int n, k, ans = 0;
    scanf("%d%d", &n, &k);
    for (int i = 0; i < n; i++) scanf("%d", a + i);
    for (int i = 0; i < n - k; i++)
        ans = max(ans, a[i] + a[2 * (n - k) - i - 1]);
    for (int i = 0; i < n; i++)
        ans = max(ans, a[i]);
    printf("%d", ans);
    return 0;
}