Type: Default 1000ms 256MiB

求和

You cannot submit for this problem because the contest is ended. You can click "Open in Problem Set" to view this problem in normal mode.

Description

给出nn个数a1a2ana1,a2,…,an,求两个数相加的绝对值的最小值,即求ai+aj|ai+aj| 的最小值,其中ii不等于jj

Input Format

第1行1个正整数 nn 。接下来1行n个整数,表示a1a2ana1,a2,…,an,每两个数之间用一个空格隔开。

Output Format

一行一个整数,表示答案。

5
-2 6 7 7 -8
1

Hint

【数据规模】

对于40%的数据满足:$n≤10^3,-10^6 ≤a_i≤10^6$。

对于80%的数据满足:$n≤10^5,-10^6≤a_i≤10^6$。

对于100%的数据满足:$n≤10^6,-10^6≤a_i≤10^6$。