|
|
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. |
|
|