I've tried calculating the slopes and count them using map, but was failing a test case all the time. No matter how many digits I set for the float it just seemed that 94911150/94911151 equals 94911151/94911152.

???!

It was crazy. Anyone could help me?