Barr the bear is bored. He grabs the nearest piece of paper and scribbles an equation:
a1 - a2 + a3 - a4 + ... + aN-1 - aN = x.
Naturally, N has to be even for the equation to hold. Then he takes his trusty random number generator and starts generating random integers. He records the first K such integers on a card, the next K integers on another card, and so on, until he has recorded K*N integers on N cards.
He decides to align the cards nicely with the variables, each card to 1 variable. Then he picks a number from each card to be the value of the respective variable in the equation. He wonders, how can he do this such that the value x is minimised?
He does not wonder for long. After 10 seconds, he realises, "This is trivial." Can you figure out his trivial solution?
4 2 -2 3 -5 -3 3 6 -10 7