this hard version problem the difference constraintsyou give rectangular n times m matrix in choose column cyclically shift element column you perform operation time want possibly zero you perform operation column multiple timesafter cyclical shift compute row maximal value suppose ith row equal r_i what maximal possible value r_1r_2ldotsr_n