this hard version problem in version q le 200000A sequence integer call nice element arrange block like 3 3 3 4 1 1 Formally element equal equallet define difficulty sequence minimum possible number element change nice sequence however change element value x value y change element value x y for example 3 3 1 3 2 1 2 is not allow change 1 3 second 1 2 you need leave 1 untouched change valueyou give sequence integer a_1 a_2 ldot a_n q updateseach update form x change a_i x update independent change stay futureprint difficulty initial sequence sequence update