ashish_nar's blog

By ashish_nar, history, 5 years ago, In English

This program is running fine in eclipse but giving me runtime error on test case 4 in codeforces but I am not getting why?

Problem Link :

https://codeforces.com/problemset/problem/1137/B

Program Link :

https://ideone.com/fHQiiH

Please help me to find why codeforces is giving runtime error on test case 4.

  • Vote: I like it
  • 0
  • Vote: I do not like it

| Write comment?
»
5 years ago, # |
  Vote: I like it 0 Vote: I do not like it

Check out line 28,29 there is a possibility of division by zero So there is a runtime error