Question: You will need to create an efficient algorithm in respect to time that will pass all test cases when passed any argument within the constraint.
You will need to create an efficient algorithm in respect to time that will pass all test cases when passed any argument within the constraint.


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 m
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
