The Economics of Partisan Gerrymandering