Answered step by step
Verified Expert Solution
Link Copied!

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.

image text in transcribedimage text in transcribed

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

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Harness The Power Of Big Data The IBM Big Data Platform

Authors: Paul Zikopoulos, David Corrigan James Giles Thomas Deutsch Krishnan Parasuraman Dirk DeRoos Paul Zikopoulos

1st Edition

0071808183, 9780071808187

More Books

Students also viewed these Databases questions

Question

Do you tend to trust people easily?

Answered: 1 week ago

Question

Which job has the highest profit?

Answered: 1 week ago