This problems has a weird IO in terms of precision.
I also did a binary search and tested if each triangles intersected, but I also added to the solution a small amount like 1e-6. There are cases where you find something like 3.5004999999 and when you round the number you get 3.500, but the actual Judge answer is 3.501.