Help Patra Bhaiya!
CodeChefOpen on judge ↗
There are K batches in the college and the batches are 0-indexed. A student can be of some ith batch where 0 ≤ i ≤ K - 1. N students from these K batches are standing in a queue for dinner in the dining hall. It is given that in a subsegment of size K of this queue, no two students belong to the same batch. Further, it is also known that eating capacity of a student from ith batch is F(i), where F
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