Let us assume that a 50 gf weight produces an anticlockwise moment about the middle point ( 50 cm ).
Now, if a weight of 100 gf produces a clockwise moment about the middle point and d cm be the distance from the middle.
As we know, the principle of moments states that
Anticlockwise moment = Clockwise moment.
Therefore, a weight of 100gf will be suspended at a distance of 25cm to keep the ruler balanced.