#include #include #include #include #include using namespace std; int n,k; int c[10007]; int cost; int test(int start,int end){ if(end>start) return (c[((start+end)/2)] + test(start,((start+end)/2)-k)) ; else return 0; } int main() { cin >> n >> k; for(int i=0;i> c[i]; } cout << test(0,n); return 0; }