Editorial for Khoảng cách từ điểm đến đường thẳng
Remember to use this editorial only when stuck, and not to copy-paste code from it. Please be respectful to the problem author and editorialist.
Submitting an official solution before solving the problem yourself is a bannable offence.
Submitting an official solution before solving the problem yourself is a bannable offence.
Ta sẽ sử dụng công thức được định nghĩa trong SGK Hình học lớp 10 (bản cũ):
$$d(A, d) = \frac{|Ax + By+ C|}{\sqrt{A^2+B^2}}$$

Trích từ SGK Hình học lớp 10
Comments
Vấn đề với sai số làm tròn 10^-6 (như thế này) giải quyết như sau: