#include <bits/stdc++.h>   using namespace std;   long long find_smallest_number_with_cumulative_sum_greater_or_equal_than_sum(       long long sum) {     long long lower = 0, upper = (long long)15E8, mid;     while (lower < upper) {       mid = (lower + upper) / 2;       if (mid * (mid + 1) / 2 >= sum)         upper = mid;       else         lower = mid + 1;     }     return lower;   }   long long find_answer(long long n, long long H) {     long long lower = H - 1, upper = (long long)15E8, mid;     while (lower < upper) {       mid = (lower + upper) / 2;       long long current_sum = mid * (mid + 1) / 2 - H * (H - 1) / 2;       long long remaining_sum = n - current_sum;       if (find_smallest_number_with_cumulative_sum_greater_or_equal_than_sum(               remaining_sum) <= mid + 1)         upper = mid;       else         lower = mid + 1;     }     long long current_sum = lower * (lower + 1) / 2 - H * (H - 1) / 2;     long long remaining_sum = n - current_sum;     long long total_blocks_till_now = lower - (H - 1);     return total_blocks_till_now +            find_smallest_number_with_cumulative_sum_greater_or_equal_than_sum(                remaining_sum);   }   int main() {     long long n, H;     cin >> n >> H;     cout << find_answer(n, H) << endl;     return 0;   }   