Answered step by step
Verified Expert Solution
Question
1 Approved Answer
You should complete the function and ensure it produces the correct output against all test cases possible within the constraints highlighted. The runtime of the
You should complete the function and ensure it produces the correct output against all test cases possible within the constraints highlighted. The runtime of the program is important so it is best to use an algorithm in the code which will not timeout.
Anansi's Ponzi Scheme HHackerRank Anansi wants to never work in his life again! So, being the trickster that he is, he decides to invest n dollars to start a Ponzi Scheme club. In this club, there are certain rules to be followed and they are: 1. Some participants are also recruiters. 2. A recruiter may recruit up to b participants. 3. Each participant may not recruit any new persons until his recruiter has already recruited exactly b participants. (At the start, Anansi is the only recruiter). 4. Each participant must pay a one-time entry fee of m dollars to his recruiter 5. Each recruiter keeps r percent of any money that he collects and passes the remainder on to his recruiter. 7. A person who is only a participant receives no money 8. Anansi has no recruiter. As such, he keeps all money he collects for himself Determine the minimum number of persons needed to join Anansi's club for him to recover at least the n dollars that were invested. Note: There will always be a solution. Input Format One line containing the following integers n b m r n the number of dollars invested b:the maxium number of recruits that a recruiter may have, . m the entry fee, and . r the percentage of earnings each recruiter is allowed to keep. Constraints 1n s10 2 Sb100 1 S mStep by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started