Getting tle in last two cases

Hey, I am getting tle in last two cases, here is the link of my code

hello @great

a) s should be max element in array * time

b)


here remove i=i-1
and intitialise current_sum with a[i]*time

check ur updated code here->