You are given an integer sequence 1,2,-,n1,2,-,n. You have to divide it into two sets AA and BB in such a way that each element belongs to exactly one set and |sum(A)−sum(B)||sum(A)−sum(B)| is minimum possible. The value |x||x| is the absolute value…