如果你 WA on test 24,且一下 hack 输出极小值,你可能把题意理解成任意时刻 ai≥0a_i\ge 0ai≥0 了。
hack:
in
1 1 10000000 999999999
ans
510000000