Can You tell me what is wrong with my code here

My testcase 1 and 4 is fine but rest wrong ans are coming

Hi @code_breaker-1001

Try using input 10 3 1 1 output that should come is 6 but your code is showing 9 Try to debug your code for this input. If you still face any issue please let me know

Thank You Sir for the help but it is still sho0wing me wrong ans. I have changed the code a little. Pls check again.

Sir that test case got right but 2 others showing still wrong

Sir pls reply asap. I want to know what is wrong

I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.

On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.

Hi @code_breaker-1001
you are failing conditions for some input values like 998097158 817129561 55253 767839
correct output for this should be :-
931097302

@code_breaker-1001 Also Please check constraints of questions you should take input as long instead of int

Bhaiya I dont know why we have to use long as constraint is < 10^9 and it is included in integer. Also bhaiya I tried changing to long but two test cases still wrong…