Question
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
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started