EQUAL THINGS
CodeChefOpen on judge ↗
Bhavya loves when things are equal! He sees an array of size $N$ consisting integers. Now he wants to make all integers equal but condition is that at each step he could choose only two elements of array (suppose a[i], a[j] ) and increase an element by one(a[i]=a[i]+1) and decrease the other element by 1(a[j]=a[j]-1).He can perform this step infinite times. He wants to know how many maximum elemen
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