ACM (You are given a sequence a 1 , a 2 ,…, a n a1,a2,…,an consisting of n n integers.)
Youaregivenasequencea1,a2,…,ana1,a2,…,anconsistingofnnintegers.Youmayperformthefollowingoperationonthissequence:chooseanyelementandeitherincreaseordecreaseitbyone.Calculatetheminimumpossibledifference