please see my code
Painter problem test cases not passed!
@varu
hello varun,
dont multply array with t .it might cause overflow. since t is constant u can multiply it later while printing answer.
also ur variable s should intialise with maximum value in array(it need not be n-1th becuase array is not sorted) .