




def 						lowerCAmelCase		(		_lowerCAmelCase							:   str						,							_lowerCAmelCase							:   str	):




 """simple docstring"""







 UpperCAmelCase__							 =						int(__lowerCAmelCase	)

 # Initialize Result
 UpperCAmelCase__							 =						[]

 # Traverse through all denomination
 for denomination in reversed(__lowerCAmelCase	):
  # Find denominations
  while int(__lowerCAmelCase	) >= int(__lowerCAmelCase	):
   total_value -= int(__lowerCAmelCase	)
   answer.append(__lowerCAmelCase	)  # Append the "answers" array

 return answer


# Driver Code
if __name__ == "__main__":
  _lowerCAmelCase						:   Any		=   []
  _lowerCAmelCase						:   List[str]		=   "0"

  if (
      input("Do you want to enter your denominations ? (yY/n): ").strip().lower()
      == "y"
  ):
    _lowerCAmelCase						:   Optional[int]		=   int(input("Enter the number of denominations you want to add: ").strip())

    for i in range(0, n):
      denominations.append(int(input(F'''Denomination {i}: ''').strip()))
    _lowerCAmelCase						:   Any		=   input("Enter the change you want to make in Indian Currency: ").strip()
  else:
    # All denominations of Indian Currency if user does not enter
    _lowerCAmelCase						:   Union[str, Any]		=   [1, 2, 5, 1_0, 2_0, 5_0, 1_0_0, 5_0_0, 2_0_0_0]
    _lowerCAmelCase						:   Any		=   input("Enter the change you want to make: ").strip()

  if int(value) == 0 or int(value) < 0:
    print("The total value cannot be zero or negative.")

  else:
    print(F'''Following is minimal change for {value}: ''')
    _lowerCAmelCase						:   List[Any]		=   find_minimum_change(denominations, value)
    # Print result
    for i in range(len(answer)):
      print(answer[i], end=" ")











import torch

from transformers import AutoModel
class 			_UpperCamelCase      (				torch.nn.Module		):
      def __init__(			self   :str ,      lowerCamelCase   :Tuple="sayef/fsner-bert-base-uncased"      )     ->			int:
       super(lowerCamelCase ,      self      ).__init__()

       UpperCAmelCase__							 =						AutoModel.from_pretrained(lowerCamelCase ,      return_dict=lowerCamelCase      )
       UpperCAmelCase__							 =						torch.nn.CosineSimilarity(3 ,      1e-08      )
       UpperCAmelCase__							 =						torch.nn.Softmax(dim=1      )
      def 	UpperCAmelCase_						(			self   :Union[str, Any] ,      **lowerCamelCase   :Tuple      )     ->			Dict:
       return self.bert(**lowerCamelCase      ).last_hidden_state
      def 	UpperCAmelCase_						(			self   :Any ,      lowerCamelCase   :Union[str, Any]      )     ->			Union[str, Any]:
       return token_embeddings.sum(2 ,      keepdim=lowerCamelCase      )
      def 	UpperCAmelCase_						(			self   :Dict ,      lowerCamelCase   :List[Any] ,      lowerCamelCase   :int ,      lowerCamelCase   :Union[str, Any]=1      )     ->			Dict:
       return self.softmax(T * self.cos(lowerCamelCase ,      lowerCamelCase      )      )







      def 	UpperCAmelCase_						(			self   :Union[str, Any] ,      lowerCamelCase   :Any ,      lowerCamelCase   :Any      )     ->			Union[str, Any]:
       UpperCAmelCase__							 =						W_supports["sizes"].tolist()
       UpperCAmelCase__							 =						W_supports["start_token_id"].item()
       UpperCAmelCase__							 =						W_supports["end_token_id"].item()

       del W_supports["sizes"]
       del W_supports["start_token_id"]
       del W_supports["end_token_id"]

       UpperCAmelCase__							 =						self.BERT(**lowerCamelCase      )
       UpperCAmelCase__							 =						self.BERT(**lowerCamelCase      )

       UpperCAmelCase__							 =						None
       UpperCAmelCase__							 =						None

       UpperCAmelCase__							 =						W_supports["input_ids"] == start_token_id
       UpperCAmelCase__							 =						W_supports["input_ids"] == end_token_id

       for i, size in enumerate(lowerCamelCase      ):
        if i == 0:
         UpperCAmelCase__							 =						0
        else:
         UpperCAmelCase__							 =						support_sizes[i - 1]

        UpperCAmelCase__							 =						S[s : s + size][start_token_masks[s : s + size]]
        UpperCAmelCase__							 =						S[s : s + size][end_token_masks[s : s + size]]

        UpperCAmelCase__							 =						torch.matmul(q[i] ,      s_start.T      ).sum(1      ).softmax(0      )
        UpperCAmelCase__							 =						torch.matmul(q[i] ,      s_end.T      ).sum(1      ).softmax(0      )

        if p_starts is not None:
         UpperCAmelCase__							 =						torch.vstack((p_starts, p_start)      )
         UpperCAmelCase__							 =						torch.vstack((p_ends, p_end)      )
        else:
         UpperCAmelCase__							 =						p_start
         UpperCAmelCase__							 =						p_end

       return p_starts, p_ends





