title: Sum K Th Group Odd Positive Numbers
signature: fun sumKThGroupOddPositiveNumbers(k: Int): Int {
source_py: def sum_k_th_group_odd_positive_numbers(k):
      cur = int(((k * (k - 1)) + 1))
      sum = 0
      while k:
          sum += cur
          cur += 2
          k = (k - 1)
      return sum
source_cpp: int sum_k_th_group_odd_positive_numbers(int k) {
    int cur = ( k * ( k - 1 ) ) + 1;
    int sum = 0;
    while ( k -- ) {
      sum += cur;
      cur += 2;
    }
    return sum;
  }
question_info.test_list: [{"idx": 0, "outputs": 753571, "inputs": {"k": 91}}, {"idx": 1, "outputs": 140608, "inputs": {"k": 52}}, {"idx": 2, "outputs": 474552, "inputs": {"k": 78}}, {"idx": 3, "outputs": 132651, "inputs": {"k": 51}}, {"idx": 4, "outputs": 274625, "inputs": {"k": 65}}, {"idx": 5, "outputs": 59319, "inputs": {"k": 39}}, {"idx": 6, "outputs": 74088, "inputs": {"k": 42}}, {"idx": 7, "outputs": 1728, "inputs": {"k": 12}}, {"idx": 8, "outputs": 175616, "inputs": {"k": 56}}, {"idx": 9, "outputs": 941192, "inputs": {"k": 98}}]
question_info.extension: kts
question_info.test_code: package main
  
  import kotlin.text.*
  import kotlin.math.*
  
  
  // SOLUTION CODE
  // ===================================
  PLACEHOLDER_CODE_BODY
  
  // TESTING CODE
  // ===================================
  fun validateSolution(actual:Int, expected:Int):Boolean{
    return actual.equals(expected)
  }
  fun driver(k: Int, expected:Int):String {
      try{
        if (validateSolution(PLACEHOLDER_FN_NAME(k), expected)) {
                return "PASSED"
        }
        return "FAILED"
      } catch (e: Exception){
        return e::class.simpleName as String
      }
  
  }
  
  fun main() {
      var result: String = ""
      result = driver(91, 753571)
      println("TEST-0...${result}")
      
      result = driver(52, 140608)
      println("TEST-1...${result}")
      
      result = driver(78, 474552)
      println("TEST-2...${result}")
      
      result = driver(51, 132651)
      println("TEST-3...${result}")
      
      result = driver(65, 274625)
      println("TEST-4...${result}")
      
      result = driver(39, 59319)
      println("TEST-5...${result}")
      
      result = driver(42, 74088)
      println("TEST-6...${result}")
      
      result = driver(12, 1728)
      println("TEST-7...${result}")
      
      result = driver(56, 175616)
      println("TEST-8...${result}")
      
      result = driver(98, 941192)
      println("TEST-9...${result}")
      
          
  }
  
  main()
question_info.entry_fn_name: sumKThGroupOddPositiveNumbers
question_info.entry_cls_name: Solution
question_info.test_case_ids: 0 1 2 3 4 5 6 7 8 9
question_info.commands: kotlinc -script __FILENAME__ -no-reflect -nowarn