Media.net Interview Question

Standard greedy arithmetic problems