Let S be a subset of {1, 2, . . . , 500} such that no two distinct elements of S have a product that is a perfect square. Find the maximum possible number of elements in S.
The largest possible number of elements in S is 282.