Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Java Cody had a hard time saving The Programmer from the Hydra, so he decided to call his friends to help him cut off

Java 

 

Cody had a hard time saving The Programmer from the Hydra, so he decided to call his friends to help him cut off the heads together. This was brilliant because then the number of heads he has to cut would be far less than if he was all alone. For example, if The Hydra had 10 heads and he called 5 friends then they would each cut 2 heads. This presented a problem, however, if The Hydra had 11 heads then that meant one of them had to cut 3 heads.

 

Input the number of friends Cody has to call and the number of heads the hydra currently has and then print the minimum number of heads each one of them has to cut.

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

Research Methods For Business Students

Authors: Mark Saunders, Philip Lewis, Adrian Thornhill

8th Edition

1292208783, 978-1292208787

More Books

Students also viewed these Programming questions

Question

=+a) Comparing the ratings of a new telephone set on a

Answered: 1 week ago