#include<stdio.h>int main(){ int i,j,n,k,m,max=0; int arr[201]={}; scanf("%d %d",&n,&k); for (i=1;i<=n;i++) { scanf("%d",&arr[i]); if ( || max<arr[i]+arr[i-m]) { max = arr[i]+arr[i-m]; } } printf("%d",max);}