My code for painter problem is failing testcases

It is passing 2 test cases.

@015itachiuchiha
Use long long instead of int
Each board is upto 10^8
Your sum variable is exceeding bounds of int

If your doubt is resolved please mark it as closed.