import kotlin.math.abs // editorial fun main() { val n = readLine()!!.toInt() var a = readLine()!!.split(" ").map { it.toLong() } if (a.sum() < 0) { a = a.map { -it } } a = a.sortedDescending() var (x, y) = listOf(0L, 0L) for (i in a.indices) { if (i % 2 == 0) x += a[i] else y += a[i] } println(abs(x) - abs(y)) }