Painter problem


some of the test cases are showing wrong answer.pls tell the correct code.

1 In the valid function the no of painter initially have to be 1 and not 0
since u cant start the the work with 0 painters
2 These lines are of no use, and cause some test case to fail
// if(cur_sum){
// painter++;
// if(painter>k)
// return false;
// }

3 since there can be an overflow
in ll ans=bst(a,n,s,e,k)t;
do a mod ooperation before multiplying
ll ans=bst(a,n,s,e,k)%10000003
t;

on doing such changes output is coming 0 instead of 50

This fetched me the correct answer, please see it u have made the changes as i have

output is coming correct now but on submitting four testcases are showing wrong answer

HEY it seemed that we are missing out one variable t .
PLease check this out