Please check the below code of painter partition

https://ide.codingblocks.com/s/240623 . it does not produce the correct output I think that there is some problem in the main function.

hi @rohitkandpal683,
these are the errors in your code:

  1. you did not take MOD
  2. you don’t have to compute per unit time and since you are computing assuming the painter take 1 unit time to paint a block so when printing answer you need to multiply it with t (t = Time taken to print each board by one painter)
  3. take long long as answer since the sum can be large
    i have corrected your code :- https://ide.codingblocks.com/s/240719