Please help me to correct this code

Mistakes

  1. you have to take no of array element first then no of painters

  2. consider time only at the end
    first minimize the max no of board painted by each painter then at end multiply with time.

  3. long long int ub=sum*tp; will be a huge number which overflow the long long int
    so best is to consider the time at end only

  4. also i have changed the function ispossible_to_paint()

Modified Code

if you have any doubt in this
feel free to ask