#include <bits/stdc++.h>   using namespace std;   int N, K;   int T[200005];   vector<int> danger;   vector<pair<int, int> > v;   bool cf(pair<int, int> x, pair<int, int> y) {     return x.second * y.first > y.second * x.first;   }   int main() {     scanf( %d %d , &N, &K);     for (int i = 0; i < N; i++) {       scanf( %d , &T[i]);       if (T[i] < 0) {         danger.push_back(i);       }     }     if (danger.size() > K)       puts( -1 );     else {       int change = danger.size() * 2;       K -= danger.size();       for (int i = 0; i < (int)danger.size(); i++) {         if (i == danger.size() - 1)           v.push_back(make_pair(N - danger[i] - 1, 1));         else           v.push_back(make_pair(danger[i + 1] - danger[i] - 1, 2));       }       sort(v.begin(), v.end(), cf);       int idx = 0;       while (idx < v.size()) {         if (K - v[idx].first >= 0) {           K -= v[idx].first;           change -= v[idx].second;         }         idx++;       }       printf( %d n , change);     }     return 0;   }   