


'''simple docstring'''







import doctest
from collections import deque

import numpy as np


class 			__lowerCamelCase			:
    """simple docstring"""


    def __init__(  self      :							List[Any]):
           _A					:     Any     = [2, 1, 2, -1]
           _A					:     Optional[int]     = [1, 2, 3, 4]


    def        A   (  self      :							int):
           _A					:     Any     = len(self.first_signal)
           _A					:     Any     = len(self.second_signal)

           _A					:     Union[str, Any]     = max(SCREAMING_SNAKE_CASE				,							SCREAMING_SNAKE_CASE)

           # create a zero matrix of max_length x max_length
           _A					:     Union[str, Any]     = [[0] * max_length for i in range(SCREAMING_SNAKE_CASE)]

           # fills the smaller signal with zeros to make both signals of same length
           if length_first_signal < length_second_signal:
                  self.first_signal += [0] * (max_length - length_first_signal)
           elif length_first_signal > length_second_signal:
                  self.second_signal += [0] * (max_length - length_second_signal)
           for i in range(SCREAMING_SNAKE_CASE):
                  _A					:     str     = deque(self.second_signal)
                  rotated_signal.rotate(SCREAMING_SNAKE_CASE)
                  for j, item in enumerate(SCREAMING_SNAKE_CASE):
                         matrix[i][j] += item

        # multiply the matrix with the first signal
           _A					:     Union[str, Any]     = np.matmul(np.transpose(SCREAMING_SNAKE_CASE)				,							np.transpose(self.first_signal))

           # rounding-off to two decimal places
           return [round(SCREAMING_SNAKE_CASE				,							2) for i in final_signal]


if __name__ == "__main__":
   doctest.testmod()










'''simple docstring'''







def 				lowerCAmelCase__	(    lowerCamelCase					:      int  ,lowerCamelCase					:      list[int]  ,lowerCamelCase					:      int       ):

       def count_of_possible_combinations(lowerCamelCase					:      int       ) -> int:
              if target < 0:
                     return 0
              if target == 0:
                     return 1
              return sum(count_of_possible_combinations(target - item       ) for item in array       )

       return count_of_possible_combinations(lowerCamelCase       )






def 				lowerCAmelCase__	(    lowerCamelCase					:      int  ,lowerCamelCase					:      list[int]  ,lowerCamelCase					:      int       ):

       def count_of_possible_combinations_with_dp_array(
           lowerCamelCase					:      int  ,lowerCamelCase					:      list[int]       ) -> int:
              if target < 0:
                     return 0
              if target == 0:
                     return 1
              if dp_array[target] != -1:
                     return dp_array[target]
              _A					:     Optional[Any]     = sum(
                  count_of_possible_combinations_with_dp_array(target - item  ,lowerCamelCase       )
                  for item in array       )
              _A					:     List[str]     = answer
              return answer

       _A					:     Optional[int]     = [-1] * (target + 1)
       return count_of_possible_combinations_with_dp_array(lowerCamelCase  ,lowerCamelCase       )






def 				lowerCAmelCase__	(    lowerCamelCase					:      int  ,lowerCamelCase					:      list[int]  ,lowerCamelCase					:      int       ):
       _A					:     Dict     = [0] * (target + 1)
       _A					:     List[str]     = 1

       for i in range(1  ,target + 1       ):
              for j in range(lowerCamelCase       ):
                     if i - array[j] >= 0:
                            dp_array[i] += dp_array[i - array[j]]

       return dp_array[target]


if __name__ == "__main__":
   import doctest

   doctest.testmod()
   A				:					Dict    						=			3
   A				:					Union[str, Any]    						=			5
   A				:					Union[str, Any]    						=			[1, 2, 5]
   print(combination_sum_iv(n, array, target))






