



'''simple docstring'''







def 						snake_case__ (lowerCAmelCase_	):
    if not isinstance(lowerCAmelCase_					,  lowerCAmelCase_	):
        raise ValueError("Input series is not valid, valid series - [1, 2/3, 2]"	)
    if len(lowerCAmelCase_	) == 0:
        raise ValueError("Input list must be a non empty list"	)
    if len(lowerCAmelCase_	) == 1 and series[0] != 0:
        return True
    UpperCamelCase__      =			[]
    UpperCamelCase__      =			len(lowerCAmelCase_	)
    for i in range(0					,  lowerCAmelCase_	):
        if series[i] == 0:
            raise ValueError("Input series cannot have 0 as an element"	)
        rec_series.append(1 / series[i]	)
    UpperCamelCase__      =			rec_series[1] - rec_series[0]
    for index in range(2					,  lowerCAmelCase_	):
        if rec_series[index] - rec_series[index - 1] != common_diff:
            return False
    return True





def 						snake_case__ (lowerCAmelCase_	):
    if not isinstance(lowerCAmelCase_					,  lowerCAmelCase_	):
        raise ValueError("Input series is not valid, valid series - [2, 4, 6]"	)
    if len(lowerCAmelCase_	) == 0:
        raise ValueError("Input list must be a non empty list"	)
    UpperCamelCase__      =			0
    for val in series:
        answer += 1 / val
    return len(lowerCAmelCase_	) / answer


if __name__ == "__main__":
      import doctest

      doctest.testmod()









'''simple docstring'''







def 						snake_case__ (lowerCAmelCase_	):
    for i, _ in enumerate(lowerCAmelCase_	):
        if (i % 2 == 1) == (nums[i - 1] > nums[i]):
            UpperCamelCase__    ,  UpperCamelCase__      =			nums[i], nums[i - 1]

    return nums


if __name__ == "__main__":
      print('Enter the array elements:')
      lowercase__     :  Optional[int]    					=			list(map(int, input().split()))
      print('The unsorted array is:')
      print(array)
      print('Array after Wiggle sort:')
      print(wiggle_sort(array))




