# Does the awards budget cut problem support a sub $O(n\log n)$ time solution?

There's a famous problem these days in the interview prep community (particularly in PRAMP) called the awards budget cut problem.

The problem gives you an input of $$n$$ integers called grants $$g_1 ... g_n$$ along with an integer budget $$B$$. We are then asked to find an integer $$C$$ (which we refer to as the cap) which has the following property:

$$C$$ minimizes the number grants $$g_i$$ that are greater than it WHILE also ensuring that $$\sum_{g_i} \lbrace{ \min(g_i, c)\rbrace} \le B$$

Note that the value $$C$$ is not necessarily unique, there are multiple values that satisfy the condition above. Any such value is desirable.

Now theres a pretty simple $$O(n \log n)$$ solution to this, which involves sorting the grants-array and then identifying the largest grant (usually through binary search or linear serach) such that the sum of all grants capped at this value end up being less than the budget.

Now the question is, is it possible to asymptotically do better? I'm reminded of the median problem which has a very similar "relative-cut" definition and whose optimal algorithm for a while always required sorting but then the exotic median-medians algorithm revealed that one could actually pull off $$O(n)$$ time.

I am very suspicious that a similar exotic awards grant algorithm should exist here.

• Just as a note, integers can be sorted faster than $O(n \log n)$ (Yijie and Thorup. "Integer Sorting in 0 (n sqrt (log log n)) Expected Time and Linear Space." FOCS. 2002.), so that gives a better algorithm :). Though I quess that in this context the relevant question is if we have some clever $O(n)$ algorithm. Jan 23, 2021 at 21:10