an array a_1 a_2 ldot a_n good subsegment 1 leq l leq r leq n follow hold a_l a_l 1 ldot a_r frac12a_l a_r cdot r l 1 you give array integer a_1 a_2 ldot a_n in operation replace element array real number find minimum number operation need array good