Need help with solving a problem
Problem: https://www.spoj.com/problems/TWOPROF/ My Code: https://pastebin.ubuntu.com/p/tXgffKZmpw/