

"""simple docstring"""





def     _A    (    UpperCamelCase_	:			int = 4000000)      ->		int:
   '''simple docstring'''


   if n <= 1:
      return 0
   __lowercase								=		0
   __lowercase								=		2
   __lowercase								=		0
   while 4 * b + a <= n:
      __lowercase						,__lowercase								=		b, 4 * b + a
      count += a
   return count + b


if __name__ == "__main__":
   print(F"{solution() = }")







"""simple docstring"""





def     _A    (    UpperCamelCase_	:			list)      ->		list:
   '''simple docstring'''


   for i, _ in enumerate(UpperCamelCase_):
      if (i % 2 == 1) == (nums[i - 1] > nums[i]):
         __lowercase						,__lowercase								=		nums[i], nums[i - 1]

   return nums


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




