func_code_string: #include <bits/stdc++.h>   using namespace std;   const int Z = (int)1e5 + 111;   const int INF = (int)1e9 * 2 + 111;   int n, m, k;   bool can(long long x) {     int u = k;     int one = x, two = max(x - k + 1, (long long)1);     long long p = ((long long)one + two) * ((long long)one - two + 1) / 2;     p += (long long)k - ((long long)one - two + 1);     one = x;     two = max(x - (n - k), (long long)1);     p += ((long long)one + two) * ((long long)one - two + 1) / 2 - x;     p += (long long)n - k - ((long long)one - two);     if (p <= m) return 1;     return 0;   }   int main() {     cin >> n >> m >> k;     int l = 1, r = m + 1;     while (l < r - 1) {       int mid = (l + r) / 2;       if (can(mid))         l = mid;       else         r = mid;     }     cout << l;     return 0;   }   