#include #include #include using namespace std; using ll = long long int; ll dp[200010][2]; const ll INF = 1LL << 60; int main() { ll N, P; scanf("%lld%lld", &N, &P); vector H(N); for(int i=0; i