Answer: (15!)2.
Let us define pairs (ai,bi) such that {ai,bi}={pi,i} and ai≥bi. Then for every i=1,…,30 we have ∣pi−i∣=ai−bi and
i=1∑30∣pi−i∣=i=1∑30(ai−bi)=i=1∑30ai−i=1∑30bi.
It is clear that the sum ∑i=130ai−∑i=130bi is maximal when
{a1,a2,…,a30}={16,17,…,30} and {b1,b2,…,b30}={1,2,…,15}
and the maximal value equals 2(16+⋯+30−1−⋯−15)=450. The number of such permutations is (15!)2.