Rosetta Problems

Maximum Profit

https://onlinejudge.u-aizu.ac.jp/problems/ALDS1_1_D