Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # Auto-generated code below aims at helping you parse
- # the standard input according to the problem statement.
- read N
- for (( i=0; i<N; i++ )); do
- read P[$i]
- done
- readarray -t sorted < <(for a in "${P[@]}"; do echo "$a"; done | sort)
- lowest=$((P[0]-P[1]))
- lowest=$((lowest**2))
- lowest='echo "sqrt($lowest)" | bc -l'
- for(( i=0; i<N; i++ )); do
- y=$((P[i]-P[i+1]))
- y=$((y**2))
- y='echo "sqrt($y)" | bc -l'
- if [ $lowest -gt $y ] ; then
- lowest=$((P[i]))
- fi
- done
- echo $((lowest))
- # Write an action using echo
- # To debug: echo "Debug messages..." >&2
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement