ENG  RUSTimus Online Judge
Online Judge
Problems
Authors
Online contests
About Online Judge
Frequently asked questions
Site news
Webboard
Links
Problem set
Submit solution
Judge status
Guide
Register
Update your info
Authors ranklist
Current contest
Scheduled contests
Past contests
Rules
back to board

Discussion of Problem 2188. They are charging the cannon... WHY?!

First test is correct?
Posted by coder 24 Jun 2026 11:16
Why for D = 8  answer is 10?  Why 9 is not answer ?

indexes               :  0 1 2  3   4 5  6  7  8  9  10
prefix-sum of a[1..10]:  0 7 11 18 18 23 29 33 37 42 46
prefix-sum of b[1..10]:  0 5 8  13 14 16 19 22 29 31 31
diff                  :  0 2 3  5  4  7  10 11 8  11 15

t = 9, diff 11, t = 10 diff = 15   and minimum t which diff >8  is 9.