#include using namespace std; int main() { double sum; // Use double for sum to handle fractions int n, k; cin >> k; n = 1; sum = 0.0; while (sum <= k) { sum = sum + 1.0 / n; // Use 1.0 to ensure floating-point division n++; } cout << n - 1 << endl; // n is incremented one extra time in the loop return 0; }