The gravitational force between two objects is directly proportional to the product of their masses and inversely proportional to the distance between the two objects. hence the Gravitational force is given as
F = k (product of masses)/(distance)² where k = constant
when mass of each object = 10 kg , distance = 10 m
F = k (10 x 10)/(10)² = k
when mass of each object = 20 kg , distance = 10 m
F = k (20 x 20)/(10)² = k (400/100) = 4k
when mass of each object = 20 kg , distance = 15 m
F = k (20 x 20)/(15)² = (1.8) k
when mass of each object = 10 kg , distance = 15 m
F = k (10 x 10)/(15)² = (0.44) k
hence the force is greatest when
two objects, each with a mass of 20 kg, separated by a distance of 10 m