Problem

Source: Bosnia and Herzegovina 2011

Tags: absolute value, algebra proposed, algebra



Numbers $1,2, ..., 2n$ are partitioned into two sequences $a_1<a_2<...<a_n$ and $b_1>b_2>...>b_n$. Prove that number \[W= |a_1-b_1|+|a_2-b_2|+...+|a_n-b_n|\] is a perfect square.