there is some simple logical mistake i m unable to find plz check once for most cases its fine.
https://onlinegdb.com/ByMNHEiVw
your approach is correct
the mistake you have done is
you are multiplying time with inp which may lead to overflow
as constraints are large
corect approach is first calculate the max num of boards painted by painter
and then multiply it with time
see the reference code for better understanding
Reference code
i made changes u told still it is not working.i feel there is some logical error
2 test cases are failing plz tell
send me the link of modified code
i sent the link on chat with TA option plz check
okay i will check there
i shared the link once again
i have commented the errors and write the correct one
Modified code