func_code_string: #include <bits/stdc++.h>   using namespace std;   int q[123456];   vector<int> sq;   int main() {     int n, k;     int a, b;     scanf( %d%d , &n, &k);     for (int i = 1; i <= n; i++) {       scanf( %d%d , &a, &b);       sq.push_back(min(2 * a, b) - min(a, b));       q[i] = min(a, b);       1;     }     sort(sq.begin(), sq.end(), greater<int>());     long long sum = 0;     int flag = 1;     for (int i = 0; i < k; i++) sum += sq[i], sq[i] < 0 ? flag = 0 : 0;     for (int i = 1; i <= n; i++) sum += q[i];     printf( %lld , flag * sum);   }   