In Xiao K's QQ group, Xiao T always gets weird and weird. Xiao T will speak in the group for nnndays, and xiao K has an anger value of mmm. Xiao T has an ability value every day, and the ability value on day iiiis aia_iai. Every day, Xiao T will choose whether to laugh at Xiao K. If Xiao T chooses to laugh at Xiao K on day iii, Xiao K will be hurt by aia_iaifrom Xiao T. On this basis, if Xiao T's ability value aia_iaiexceeds Xiao K's anger value mmm, Xiao K will be furious and ban Xiao T for ddddays. That is to say, in i+1,i+2,...,mini+1, i+2, ..., mini+1,i+2,...,mindays, Xiao T will be banned. Now, Xiao T wants to maximize the damage to Xiao K, but Xiao T is too bad to solve this problem, so he found you. hope you can help him solve this problem. You only need to find out the maximum damage caused by Xiao T to Xiao K.
In Xiao K's QQ group, Xiao T always gets weird and weird. Xiao T will speak in the group for nnn days, and xiao K has an anger value of mmm. Xiao T has an ability value every day, and the ability value on day iii is aia_iai. Every day, Xiao T will choose whether to laugh at Xiao K. If Xiao T chooses to laugh at Xiao K on day iii, Xiao K will be hurt by aia_iai from Xiao T. On this basis, if Xiao T's ability value aia_iai exceeds Xiao K's anger value mmm, Xiao K will be furious and ban Xiao T for ddd days. That is to say, in i+1,i+2,...,min(i+d,n)i+1, i+2, ..., min(i+d, n)i+1,i+2,...,min(i+d,n) days, Xiao T will be banned. Now, Xiao T wants to maximize the damage to Xiao K, but Xiao T is too bad to solve this problem, so he found you. hope you can help him solve this problem. You only need to find out the maximum damage caused by Xiao T to Xiao K.