"""simple docstring"""




def 							SCREAMING_SNAKE_CASE     (			_lowerCamelCase						:       list	)       ->      bool:
  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"""	)
  if len(_lowerCamelCase	) == 1:
    return True
  _lowerCAmelCase						:       Dict  			=     series[1] - series[0]
  for index in range(len(_lowerCamelCase	) - 1	):
    if series[index + 1] - series[index] != common_diff:
      return False
  return True





def 							SCREAMING_SNAKE_CASE     (			_lowerCamelCase						:       list	)       ->      float:
  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"""	)
  _lowerCAmelCase						:       Union[str, Any]  			=     0
  for val in series:
    answer += val
  return answer / len(_lowerCamelCase	)


if __name__ == "__main__":
     import doctest

     doctest.testmod()








import unittest

from knapsack import knapsack as k





class   __a			(    unittest.TestCase      ):
 def 		SCREAMING_SNAKE_CASE__   (   self )					->				Tuple:




        '''simple docstring'''
        lowercase__:   List[Any]  			=   0
        lowercase__:   List[Any]  			=   [0]
        lowercase__:   str  			=   [0]
        lowercase__:   Tuple  			=   len(lowerCAmelCase__ )
        self.assertEqual(k.knapsack(lowerCAmelCase__				, lowerCAmelCase__				, lowerCAmelCase__				, lowerCAmelCase__ )				, 0 )

        lowercase__:   Optional[Any]  			=   [60]
        lowercase__:   Dict  			=   [10]
        lowercase__:   str  			=   len(lowerCAmelCase__ )
        self.assertEqual(k.knapsack(lowerCAmelCase__				, lowerCAmelCase__				, lowerCAmelCase__				, lowerCAmelCase__ )				, 0 )
 def 		SCREAMING_SNAKE_CASE__   (   self )					->				Union[str, Any]:




        '''simple docstring'''
        lowercase__:   Union[str, Any]  			=   3
        lowercase__:   List[str]  			=   [1, 2, 3]
        lowercase__:   Union[str, Any]  			=   [3, 2, 1]
        lowercase__:   Union[str, Any]  			=   len(lowerCAmelCase__ )
        self.assertEqual(k.knapsack(lowerCAmelCase__				, lowerCAmelCase__				, lowerCAmelCase__				, lowerCAmelCase__ )				, 5 )
 def 		SCREAMING_SNAKE_CASE__   (   self )					->				List[Any]:




        '''simple docstring'''
        lowercase__:   Optional[Any]  			=   50
        lowercase__:   str  			=   [60, 100, 120]
        lowercase__:   Any  			=   [10, 20, 30]
        lowercase__:   List[Any]  			=   len(lowerCAmelCase__ )
        self.assertEqual(k.knapsack(lowerCAmelCase__				, lowerCAmelCase__				, lowerCAmelCase__				, lowerCAmelCase__ )				, 220 )


if __name__ == "__main__":
 unittest.main()


