correct solution using Heronian Triangles