F - Regular Triangle Inside a Rectangle Editorial by YocyCraft

solution by single formula

WLOG we can assume a<ba<b. Therefore, if ba233\frac{b}{a} \ge \frac{2 \sqrt{3}}{3}, the answer will be 233a\frac{2 \sqrt{3}}{3}a; if ba<233\frac{b}{a} \lt \frac{2 \sqrt{3}}{3}, the answer will be 2a2+b23ab2 \sqrt{a^{2}+b^{2}-\sqrt{3}ab}.

posted:
last update:



2025-04-03 (Thu)
20:14:10 +00:00