fork(5) download
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. int main()
  5. {
  6. double rez=0, x;
  7. int i;
  8. i = 1;
  9. cin >> x;
  10. while(rez<=x) {
  11. i++;
  12. rez = rez + (1 / i);
  13. }
  14. cout << i << endl;
  15. return 0;
  16. }
Time limit exceeded #stdin #stdout 5s 15224KB
stdin
Standard input is empty
stdout
Standard output is empty