1786:数轴旅行-1

文件提交:无需freopen 内存限制:128 MB 时间限制:1.000 S
评测方式:普通裁判 命题人:
提交:2 解决:2

题目描述

在数轴上,一共有 lns="http://www.w3.org/1998/Math/MathML"> 个景点,坐标分别为lns="http://www.w3.org/1998/Math/MathML">1,2,3,....,

你初始在lns="http://www.w3.org/1998/Math/MathML">=0位置,每次你可以往左 lns="http://www.w3.org/1998/Math/MathML"> 个单位或往右 lns="http://www.w3.org/1998/Math/MathML"> 个单位,请问为了访问到每一个景点,lns="http://www.w3.org/1998/Math/MathML"> 最大可以取到多少?

输入

输入共两行:

第一行,一个正整数 n

第二行,n 个整数 x1,x2,x3....xn

1<=n<=105 , -109 <=xi<=109

输出

输出一行,表示答案

样例输入-1 复制

3
-2 4 10

样例输出-1 复制

2