The Inventory Problem: I. Case of Known Distributions of Demand