Given an array of integers and a value, return the position of the element that is closest in value to the given value. If there is more than one, return the position of the first one. Return -1 if the array is empty.