Problem I: 分割队伍

Problem I: 分割队伍

[Creator : ]
Time Limit : 1.000 sec  Memory Limit : 128 MiB

Description

给定一个长度为 lns="http://www.w3.org/1998/Math/MathML">N 的数列 lns="http://www.w3.org/1998/Math/MathML">A1,A2,A3,,AN,请找一个切割点,将它分成前后两部分,求出这两部分的和,请问应该如何切割,才能让这两个和的差距最小。输出这个最小的差距。

Input

  • 第一行,单个整数 lns="http://www.w3.org/1998/Math/MathML">n
  • 第二行,lns="http://www.w3.org/1998/Math/MathML">n 个整数 lns="http://www.w3.org/1998/Math/MathML">a1,a2,,an
  • 对于 lns="http://www.w3.org/1998/Math/MathML">30% 的数据,lns="http://www.w3.org/1998/Math/MathML">1n100
  • 对于 lns="http://www.w3.org/1998/Math/MathML">70% 的数据,lns="http://www.w3.org/1998/Math/MathML">1n10000
  • 对于 lns="http://www.w3.org/1998/Math/MathML">100% 的数据,lns="http://www.w3.org/1998/Math/MathML">1n100000
  • lns="http://www.w3.org/1998/Math/MathML">1ai10000



Output

  • 单个整数:表示前后两部分总和差距的最小值。

Sample Input Copy

3
100 1 1

Sample Output Copy

98

HINT

100-(1+1)