You have developed an artificial amoeba, and you can control exactly how it divides.
Each individual amoeba can be instructed to divide into A, B, or C amoebas. That
is, if you instruct an amoeba to divide into A, this amoeba will disappear, and A different new amoeba will appear.
You start out with K amoeba initially, and you want to give them instructions such that at the end, you have exactly N amoeba left. Giving an instruction is a costly affair because it requires you to produce some biochemicals, and so you want to give as few instructions as possible.
Find and write the minimum number of instructions that you should give to end up with exactly N amoebas. If it cannot be done, write −1 instead. Note that each instruction is given to a single amoeba, and not all of them together.
Find the minimum number of instructions needed for these instances:
(a) K = 23, A = 7, B = 12, C = 16, N = 114
(b) K = 9, A = 7, B = 15, C = 16, N = 76
This problem is from pen & paper test, ZIO-2019.
My attempt:-
extra Amoebas to produce = 114 - 23 = 91
Amoeba added by each instruction, A = 6 , B =11 , C = 15
I manually tried to find , n(A)=1,n(B)=5,n(C)=2 .
But my process took very long time, because im pretty noob in alogs. So is there any mathematical method to get the answer , instead of trying to put each value manually to get the answer
This is the change-making problem, thinly disguised. You have correctly analyzed your example. Note that the question is equivalent to, "If we have a n unlimited number of coins of denominations $6$, $11$, and $15$, what is the minimum number of coins required to make change for a coin of denomination $91$?" The only wrinkle is that if it requires more than $23$ coins, you have to report it just as if it can't be done at all.
The wiki article discusses solutions.