Painter problem - c++ beginner problem

My code is not able to pass the test case: Please help me with the code

@prkfoxxx
Hello Priyansh,

  1. change your data type of sum and ans to long long because total sum can exceeds int range
  2. you need to print ans % 10000003
  3. you havent considered T (time taken by worker to print one unit)
    pls read problem statement carefully

hi i aman i am still not getting the correct answer. https://ide.codingblocks.com/s/179323

@prkfoxxx
brother you havent considered T (time taken by worker to print one unit of board) also convert int datatype to long long type