Points and are chosen on the interiors of sides and of unit square , so that pentagon has only two distinct side lengths. The sum of all possible areas of quadrilateral can be expressed as , where are positive integers such that and is square-free (i.e. no perfect square greater than 1 divides ). Compute .