Geometric Mean Inequality
You are given an array $A$ of length $N$ containing the elements $-1$ and $1$ only. Determine if it is possible to rearrange the array $A$ in such a way that $A_i$ is **not** the geometric mean of $A_{i-1}$ and $A_{i+1}$, for all $i$ such that $2 \leq i \leq N-1$. $Y$ is said to be the geometric mean of $X$ and $Z$ if $Y^2 = X \cdot Z$. ### Input - The first line contains a single integer $T$ -
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