This is a code template for Modular, which I copied from this. I made some changes to the code and to check, I ran this on B. Divide and Sum and it failed.
Here is my code.
Please highlight my mistake and also it will be nice if you can tell, how to better my template. Thanks.