Poisoned Dagger
EasyRating 1200CodeforcesBinary Search on Answer
Approach hintTry it first, then revealHide
For a duration k, the damage is k plus the sum of min(k, a[i+1] - a[i]) over consecutive attacks, which never decreases as k grows. Binary search the smallest k reaching h, using 64-bit values.