Nooby and Shiv Mangal
CodeChefOpen on judge ↗
Nooby gives Shiv Mangal an array A1,A2,A3,......,An He asks him to find an integer M between P and Q(both inclusive), such that, min {|Ai-M|, 1≤ i≤ N} is maximised. If there are multiple solutions, print the smallest one. Input The first line contains N. The next line contains space separated N integers, and denote the array A. The third line contains two space separated integers denoting P and
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