input: from typing import List
  
  def min_cost_to_partition_array(nums: List[int]) -> int:
      """
      You are provided with an array of integers called nums containing n elements.
  
      The cost of any array is represented by the value of its first element. For instance, the cost of [1,2,3] is 1 while the cost of [3,4,1] is 3.
  
      Your task is to partition nums into 3 non-overlapping contiguous subarrays.
  
      Return the smallest possible total cost of these subarrays.
  
      Examples:
      >>> nums = [1,2,3,12]
      6
      >>> nums = [5,4,3]
      12
      >>> nums = [10,3,1,1]
      12
  
      Constraints:
      3 <= n <= 50
      1 <= nums[i] <= 50
      """
output:     n = len(nums)
      min_cost = float('inf')
  
      for i in range(1, n - 1):
          for j in range(i + 1, n):
              cost = nums[0] + nums[i] + nums[j]
              min_cost = min(min_cost, cost)
  
      return min_cost