Runtime error an dsingle output

https://ide.codingblocks.com/s/151867 This is my code .If I run it without input the code shows runtime error but after giving custom input it shows output for only one test case

Hello @tanjuljain19,
https://ide.codingblocks.com/s/152070 I have corrected the run time error in your code. You were using i variable twice, in the outer as well as in the inner loops. That will give you error. Now it is showing output for both the test cases.