Yet Another Average Problem
CodeChefOpen on judge ↗
We are given an array of integers $A_1, A_2,...,A_N$ and an integer $X$. For each $i$ from $1$ to $N$, we need to find the **first** $j$ ($i \lt j$) such that average of all elements in range $i$ to $j$ is strictly less than the given integer $X$. ### Input - First line will contain $T$, number of testcases. Then the testcases follow. - The first line of each test case contains $N$ and $X$. - Th
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