Masha and Minions
Masha has $N$ minions. Each minion has two characteristics: power $a$ and endurance $b$. Masha thinks that a non-empty set of minions $\{m_1, m_2, \dots, m_k\}$ with characteristics $(a_{m_1},b_{m_1}), (a_{m_2},b_{m_2}), \dots, (a_{m_k},b_{m_k})$ is *good* if the mean endurance of this set doesn't exceed the minimum power in it, i.e. if $min(a_{m_1}, a_{m_2}, \dots, a_{m_k}) \ge (b_{m_1}+b_{m_2}+\
HINT LADDERno hints yet
L1 Observation
L2 Technique
L3 Approach
L4 Pseudo-code
🔒
L5 Full solution
L5 unlocks only if you insist twice
solution.cppC++17
CodeSearch Tutor
Hints, not spoilers — it won’t hand over the full solution unless you insist.
Sign in to chat with the tutor and save your progress.
Sign in to start