Two testcases not passing , Did everything in code,please help

https://ide.codingblocks.com/s/195620 – code

Is the failing of test cases due to some format issue or problem in code?

@anmol1911
hello anmol,
ur code is correct,but fails for large test cases because summation of a[i]*t can be bigger than the range of long datatype so instead of applying binary search on time ,apply bs on maximum unit of board a painter can paint.
and then multiply ur answer with t and take modulo.

check ur updated code here

Thanks for helping me out :smile: