Codeforces Round 1133 (Div. 1, Div. 2) is coming soon! Register here. ×

What's wrong with my code bruh 
Difference between en1 and en2, changed 19 character(s)
Please tell me what's going on here imma lose my stuff↵
https://codeforces.me/contest/2
203192/submission/366196095483077↵
↵
↵
I'm handling the first case where the sum of the array perfectly divides the health. (h % sum == 0)↵
Here the output is n * (h/sum) + k * (h/sum — 1). Since no need to reload once you've gone through the array↵
For the second case, I'm maintaining a minimum value and checking if I replace that value with max from the suffix.

History

 
 
 
 
Revisions
 
 
  Rev. Lang. By When Δ Comment
en2 English ahmadexe 2026-03-13 15:49:30 19 Fixed link
en1 English ahmadexe 2026-03-13 15:28:34 477 Initial revision (published)