title: Triangular Matchstick Number
signature: function triangular_matchstick_number(x)
test_code: using Printf
  
  # SOLUTION CODE
  # ============================================
  PLACEHOLDER_CODE_BODY
  
  # TESTING CODE 
  # ============================================
  function validate_solution(actual, expected)
      return abs(actual - expected) < 1e-06
  end
  
  function driver(x, expected)
      try
  
          if validate_solution(PLACEHOLDER_FN_NAME(x), expected)
              return "PASSED";
          end
          return "FAILED";
      catch exception_obj
          return string(Base.typename(typeof(exception_obj)).wrapper);
      end
  end
  
  function main()
      
      result = driver(6, 63.0);
      @printf("TEST-0...%s\n",result);
      
      result = driver(25, 975.0);
      @printf("TEST-1...%s\n",result);
      
      result = driver(15, 360.0);
      @printf("TEST-2...%s\n",result);
      
      result = driver(30, 1395.0);
      @printf("TEST-3...%s\n",result);
      
      result = driver(17, 459.0);
      @printf("TEST-4...%s\n",result);
      
      result = driver(80, 9720.0);
      @printf("TEST-5...%s\n",result);
      
      result = driver(27, 1134.0);
      @printf("TEST-6...%s\n",result);
      
      result = driver(13, 273.0);
      @printf("TEST-7...%s\n",result);
      
      result = driver(12, 234.0);
      @printf("TEST-8...%s\n",result);
      
      result = driver(67, 6834.0);
      @printf("TEST-9...%s\n",result);
      
  end
  
  main()
source_py: def triangular_matchstick_number(x):
      return (((3 * x) * (x + 1)) / 2)
source_cpp: int triangular_matchstick_number(int x) {
    return ( 3 * x * ( x + 1 ) ) / 2;
  }