I’m not sure if this is the right place to discuss this problem, but I’ve tried to contact the author, but couldn’t find his email, …
anyway the problem is: this problem has weak test cases, and I think all O(n) solutions must fail
9
4752 4262
3383 413
759 2927
4745 4322
1213 691
2506 4423
3040 4460
1000 1000
5000 1000
9
2459 691
2828 758
4361 1951
4183 4244
3832 4647
2529 5756
2481 5718
0 3587
728 2028
-1
the correct output is:
6920000.00
6919204.00