2023 WSMO Tiebreaker Round Problems/Problem 3

Problem

Let $S$ be the set of all values of $a$ such that the area of a triangle with side lengths $5, 7, a$ is a positive integer. Find $\sum_{x\in S}\left(x^2\right).$

Solution