Given a set X of distinct positive integers, denote mindiff(X) as the minimum absolute difference of two distinct elements in X and maxdiff(X) as the maximum absolute difference of two distinct elements in X. If the size of X is strictly less than 2, define mindiff(X) and maxdiff(X) as 0.
Find the sum of mindiff
%20%5Ccdot)
maxdiff(T), where T varies over all possible subsets of S = {1, 2, ..., n}, modulo 10
9 + 7.