I have two tuples - first tuple (A,B) where A and B are positive integers and one other tuple which is (0,0) initially. Input tuple remains fixed but the output tuple can be changed. I have to maximize the value of second term in the second tuple. Increment can be done in only these ways -
increase 1st term of 2nd tuple by 1 which decreases A by 1
increase 2nd term of 2nd tuple by the value in the 1st term of 2nd tuple which decreases A by B
A can be reduced to minimum 0. e.g. (A,B) = (10,2) Output Input (0,0) (10,2) (1,0) (9,2) (2,0) (8,2) (3,0) (7,2) (4,0) (6,2) (4,4) (4,2) (4,8) (2,2) (4,12) (0,2)
So the answer is 12. Can do the operations in any ways maximum value that can be attained by the second term is 12. What is the general procedure to solve this problem. I am stuck. Please help