2288A - Youmu Konpaku and the Duel This solution involves the use of calculus to find the minimum in $$$O(1)$$$.
We start by recognising that charges must occur before attacks. Let $$$M$$$ be the total amount of moves:
After $$$C$$$ moves to charge, we reach a maximum attack power of $$$1+C$$$ (+1 +1 +1 +... $$$C$$$ times). Then, we must make the minimum amount of attacking moves such that the total damage is greater than or equal to the yokai's health, $$$x$$$. That is:
Since our highest power is $$$1+C$$$:
shoutout to my boy Gauss btw




