Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Java program........ You are starting an asteroid mining mission with a single harvester robot. That robot is capable of mining one gram of mineral per

Java program........

You are starting an asteroid mining mission with a single harvester robot. That robot is capable of mining one gram of mineral per day. It also has the ability to clone itself by constructing another harvester robot. That new robot becomes available for use the next day and can be involved in the mining process or can be used to construct yet another robot.

Each day you will decide what you want each robot in your fleet to do. They can either mine one gram of mineral or spend the day constructing another robot.

Write a program to compute a minimum number of days required to mine nn grams of mineral.

Note that you can mine more mineral than required. Just ensure that you spent the minimum possible number of days to have the necessary amount of mineral mined.

Input:

A single integer number nn, which is the number of grams of mineral to be mined. The value of nn will be between 1 and 1000000 (inclusive). For example:

9 

Output:

A single integer, the minimum number of days required to mine nn grams of mineral. For example:

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

Semantics In Databases Second International Workshop Dagstuhl Castle Germany January 2001 Revised Papers Lncs 2582

Authors: Leopoldo Bertossi ,Gyula O.H. Katona ,Klaus-Dieter Schewe ,Bernhard Thalheim

2003rd Edition

3540009574, 978-3540009573

Students also viewed these Databases questions

Question

4. What advice would you give to Carol Sullivan-Diaz?

Answered: 1 week ago