#include #include using namespace std; typedef long long ll; const int MAXN = 1e4 + 5; const ll INF = 1000000000000000LL; int A[MAXN]; ll dp[MAXN][2]; int main(){ #ifdef DEBUG freopen("input.txt", "r", stdin); #endif int N, K; scanf("%d %d", &N, &K); for(int i=1; i<=N; ++i) scanf("%d", &A[i]); if(N == 1) printf("%d\n", A[1]); else{ dp[1][1] = A[1], dp[1][0] = 0; for(int i=2; i<=N; ++i){ dp[i][0] = dp[i][1] = INF; for(int j=1; j