The coin exchange problem