Divisible subaarys

i am unable to figure out the problem some of the testcases are passing and some are showing run error.please help me to identify the error .
here is the link for my code -

Take mod by n while you are taking input since it may overflow.
Then just take a count of the mods and count total answer.

sir i am unable to understand how to use mod.

please go through this video lecture once https://youtu.be/QQQpOa3aXew

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.