func_code_string: #include <bits/stdc++.h>   using namespace std;   long long int max(long long int a, long long int b) {     if (a > b)       return a;     else       return b;   }   long long int min(long long int a, long long int b) {     if (a < b)       return a;     else       return b;   }   const int dx[4] = {-1, 1, 0, 0};   const int dy[4] = {0, 0, -1, 1};   int XX[] = {-1, -1, -1, 0, 0, 1, 1, 1};   int YY[] = {-1, 0, 1, -1, 1, -1, 0, 1};   int main() {     ios_base::sync_with_stdio(false), cin.tie(NULL), cout.tie(NULL);     long long int k, i, j, t, a, b, l, r, x, n;     cin >> n >> k;     long long int arr[n];     for (i = 0; i < n; i++) {       cin >> arr[i];     }     sort(arr, arr + n);     long long int maxi = k, count = 0;     for (i = 0; i < n; i++) {       long long int z = ceil(arr[i] * 1.0 / 2);       if (maxi >= z) {         maxi = max(maxi, arr[i]);         continue;       }       while (maxi < z) {         maxi = 2 * maxi;         count++;       }       maxi = max(maxi, arr[i]);     }     cout << count;   }   