Question: n = a * * b You are given T number of numbers you have to turn them into zero there are two spells that
You are given T number of numbers you have to turn them into zero there are two spells that you can cast the spells are: Aabra It reduces the number by two Dabra If the number can be written as nab where a and bl then reduce the number to maxab Both spells take unit of energy each. Calculate minimum energy required to change number to zero.Input FormatThe first line contains the T integer. The next T lines each contain an integer. NConstraintsnab where
and then reduce the number to max Both spells take unit of energy each. Calculate minimum
energy required to change number to zero.
Input Format
The first line contains the integer. The next lines each contain an integer,
Constraints
hours
Submissions:
Max Score:
Difficulty: Medium
Rate This Challenge:
More
Output Format
Output lines. Each line containing the minimum energy required convert the value zero.
Sample Input
Sample Output
Explanation
can turned just one spell Aabra can turbed just one spell Aabra will require two Aabra
spells will also needs spells Aabra and Dabra Aabras will turn into then into then will turn into
Daabra first then then will turn into then then then will turn into Aabra then more spells
will turn into Aabra then more spells will turn into Aabra then more spells
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
