Painter Problem

The program has little bit of problem plz help, finding that problem.

hello @Mihir163
a) use long long to avoid overflow

b) dont sort the array because order matters (painters can only paint contigous bocks)

c)image
here it should be a[i]*t (where t is time given in question)

d) check output format u have to report ans%mod.