A pail containing 40 nails weighs 175 grams. The same pail with 20 nails weighs 95 grams. How much does the pail weigh? How much does each nail weigh?

(Source: Mathematics Teaching in the Middle School, Nov-Dec 1994)