input: from typing import List
  
  def minimum_sum_of_subarray_costs(nums: List[int]) -> int:
      """
      Given an array of integers nums with length n,
  
      The cost of a subarray is determined by its first element. For instance, the cost of [1,2,3] is 1, and that of [3,4,1] is 3.
  
      The task is to split nums into 3 separate 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
  