A polynomial time algorithm for a deterministic joint pricing and inventory model