Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Russy P. Mitts and Danny Scotts like programming, but Russy P. Mitts practices more than Danny Scotts. Not wanting to fall behind. Danny Scotts resolves

image text in transcribed
image text in transcribed
image text in transcribed
image text in transcribed
Russy P. Mitts and Danny Scotts like programming, but Russy P. Mitts practices more than Danny Scotts. Not wanting to fall behind. Danny Scotts resolves to practice more. They each solve a number of problems in a day. Russy P. Mitts has already solved more problems than Danny Scotts. What is the minimum number of days it will take for Danny Scotts to have solved more problems than Russy P. Mitts? For example, if Russy P. Mitts is 5 problems ahead of Danny Scotts and they solve 3 and 5 problems a day, Russy P. Mitts will be ahead by only 3 after the first day, 1 after the second, and Danny Scotts will pass Russy P. Mitts on day 3. Function Description Complete the function minum in the editor below. The function must return the minimum number of days needed by Danny Scotts to catch up or its possible min Num has the following parameters): Number of problems Russy P. Mitt solves in a day D: Number of problems Danny Scotts solves in a day A Number of problems Russy P. Mitt is ahead to begin Constraints 1 s RDS 100 Os Ps 100 Input Format For Custom Testing Input from stdin will be processed as follows and passed to the function! The first line contains an integer R The second line contains an integer D. The third line contains an integer P. Sample Case o Sample Input Sample Output 4 Explanation Rusty P. Mitts is 1 problem ahead of Danny Scotts to begin. After 1 day passes. Danny Scotts will have solved 5 problems while Russy P. Mints will have only solved 1.3 problems Sample Case 1 Sample Input Sample Output Explanation Russy P. Mitts is 1 problem ahead of Danny Scotts to begin. After 1 day passes, Danny Scotts will have solved 5 problems wie Russy P. Mitts will have also solved 1.4.5 problems. On the second day, Danny Scotts will surpass Russy P. Mitts 5.5 > 1+4+4 View Code Diff 1 include le * Complete the 'minum function below. * The function is expected to return an INTEGER. The function accepts following parameters: - 1. INTEGER R 2. INTEGER D - 3. INTEGER P 12 19 20 int minnum(int R, int D, int p) { 23 24 int main()

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_2

Step: 3

blur-text-image_3

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

Introduction To Constraint Databases

Authors: Peter Revesz

1st Edition

1441931554, 978-1441931559

More Books

Students also viewed these Databases questions

Question

Describe the four forms of organizational structure.

Answered: 1 week ago