All test cases wrong
hello @kartik-malik
a)use long long in place of int to avoid overflow
b)seach space s=max in array , e=summation of array (note array is not sorted so u need to use loop to find max)
c) in question the have asked to report modulo in place of answer so chnage that as well
added sort funtio now 1 test case working
no dont do that because order matters painter can only paint contiguous blocks
please explain c part

why this specific no
it is not our choice .
it is mentioned in output format of the problem so we have to do the same to pass the test cases.
Genrally it is done to keep values within the range of int , and that number that is choosen for mod is genrally a prime number.
new code still not working
share ur updated code, in the current code u have not made any changes
there is 6 zeros in 10000003 .
u have used 7. change it and then it should work fine