Upsolving classical competitive programming greedy problems