Minimize the cost

Company: Google_28thjuly

Difficulty: easy