Hi everyone. I was solving problem https://codeforces.net/contest/1759/problem/E and my solution is this: https://codeforces.net/contest/1759/submission/228398584
but unfortunately i failed test 3. can you help me to clarify which part of my submission is wrong
In your solution you always try to use 2 green serums before blue + green, which is not always optimal. Consider the following testcase:
Your solution outputs 2, while the answer is 3, because you can multiply strength by 6, then eat 12 and 25, resulting in strength 42, then multiply by 2, and eat 83.