Is my logic wrong?

I’m unable to pass the test cases,
Can someone help me with a hint?

Link to my code: https://ide.codingblocks.com/s/210155

@kapurm17 in this question you have to find the minimum time required to paint all the boards. So for that your aim should be to assign board to painters such that the partition is almost equally distributed among them.
It is equally or almost equally distributed among them, then it will be minimum time possible.

You need to apply binary search on the length of a boards, after the length is found you can just multiply it with time

I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.

On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.