output_description: Print Alice's score minus Bob's score when both players take the optimal
  strategy to maximize their scores.
  
  * * *
input_description: Input is given from Standard Input in the following format:
  
      
      
      N
      a_1 a_2 a_3 ... a_N
attempt: #include <iostream>
  #include <cstdio>
  #include <string>
  #include <vector>
  #include <iterator>  // std::back_inserter()
  #include <algorithm>  // std::copy()
  #include <functional>  // std::greater<T>()
  #include <utility>  // std::swap()
  #include <numeric>  // accumulate(ALL(vec), 0)  0 は初期値
  #include <cmath>
  #include <climits>  // INT_MIN
  #include <cctype>  // std::isdigit()
  using namespace std;
  
  #define ALL(obj) (obj).begin(), (obj).end()
  #define REP(i, n) for (int i=0; i < (int)(n); i++)  // 0 ~ n-1
  #define REPN(i, n) for (int i=1; i <= (int)(n); i++)  // 1 ~ n
  #define MIN(vec) min_element(ALL((vec)))  // イテレータのため、値を取り出すときは * を先頭につける
  #define MAX(vec) max_element(ALL((vec)))
  #define IDX(vec, element_iter) distance((vec).begin(), element_iter)
  #define SUM(vec) accumulate(ALL((vec)), 0)  // 0 は初期値
  #define COPY(vec1, vec2) copy(ALL(vec1), back_inserter(vec2))  // vec1をvec2にコピーする vec2は空にしておく必要あり
  typedef long long ll;
  
  const int MOD = 1000000007;  // 1 000 000 007
  
  
  int main() {
      cin.tie();
      ios::sync_with_stdio(false);
  
      // input
      int N;
      cin >> N;
      vector<int> vec(N);
      REP(i, N) cin >> vec.at(i);
      
      // calculation
      int A = 0, B = 0;
      sort(vec.begin(), vec.end(), greater<int>());  // int big -> small
      
      for (int j = 0; j < N; ++j) {
          if (j%2 == 0) {
              A += vec[j];
          } else{
              B += vec[j];
          }
      }
      
      cout << A - B << "\n";
      
      return 0;
  }
  
problem_description: Statement
  
  We have N cards. A number a_i is written on the i-th card.  
  Alice and Bob will play a game using these cards. In this game, Alice and Bob
  alternately take one card. Alice goes first.  
  The game ends when all the cards are taken by the two players, and the score
  of each player is the sum of the numbers written on the cards he/she has
  taken. When both players take the optimal strategy to maximize their scores,
  find Alice's score minus Bob's score.
samples: [{"input": "2\n    3 1", "output": "2\n    \n\nFirst, Alice will take the card with 3. Then, Bob will take the card with 1.\nThe difference of their scores will be 3 \\- 1 = 2.\n\n* * *"}, {"input": "3\n    2 7 4", "output": "5\n    \n\nFirst, Alice will take the card with 7. Then, Bob will take the card with 4.\nLastly, Alice will take the card with 2. The difference of their scores will\nbe 7 \\- 4 \\+ 2 = 5. The difference of their scores will be 3 \\- 1 = 2.\n\n* * *"}, {"input": "4\n    20 18 2 18", "output": "18"}]