Source Code
#include <bits/stdc++.h>
using namespace std;
int main()
{
   int hare;
   cin>>hare;
   int turt;
   cin>>turt;
   int friends=0;
   int kg=turt;
   for(int i=0;i<100;i++)
    {

        if(hare>=kg)
        {
            friends++;
            kg=turt+kg;
        }

    }
	cout << friends<<endl;
	return 0;


}
Copy
The Tortoise and the Hare Doleh
GNU G++17
3 ms
936 KB
Accepted