I got Runtime Error for this problem 10344 with the following message:
Your program has died with signal 8 (SIGFPE). Meaning:
Floating point excepti
I think it is cause by divided by zero.
But I dont know how it happen.
Could it have zero input int the 5-tuples except the last one?

