Painter problem


Whats wrong in this code? Only one test case is getting passed, rest are not being passed. However, sample inputs are giving correct output.

@AbhilashaBansal
hello Abhilasha,
ur forget to take modulo of ur final answer,pls check output format

2 test cases (3rd and 2nd) are not getting passed, even after taking modulus.

@AbhilashaBansal
change ur datatype to long long

Right, thanks for all your help!