title: Compute Average Two Numbers Without Overflow 1
signature: func computeAverageTwoNumbersWithoutOverflow1(a int, b int) int {
test_code: package main
  
  import (
      "fmt"
      "reflect"
      "math"
      "sort"
  )
  
  // SOLUTION CODE
  // ===================================
  PLACEHOLDER_CODE_BODY
  
  // TESTING CODE
  // ===================================
  func validateSolution(actual int, expected int) bool {
      return reflect.DeepEqual(actual,expected)
  }
  
  func driver(a int, b int, expected int) string {
      if validateSolution(PLACEHOLDER_FN_NAME(a, b),expected) {
              return "PASSED"
      }
      return "FAILED"
  
  }
  
  func main() {
  
      // Use imports to avoid undefined errors
      var _ = reflect.DeepEqual
      _ = math.Abs
      _ = sort.Sort
      result := ""
      result = driver(9, 
  	81, 45)
      fmt.Printf("TEST-0...%s\n", result)
      
      result = driver(68, 
  	79, 73)
      fmt.Printf("TEST-1...%s\n", result)
      
      result = driver(51, 
  	2, 26)
      fmt.Printf("TEST-2...%s\n", result)
      
      result = driver(31, 
  	49, 40)
      fmt.Printf("TEST-3...%s\n", result)
      
      result = driver(14, 
  	10, 12)
      fmt.Printf("TEST-4...%s\n", result)
      
      result = driver(73, 
  	9, 41)
      fmt.Printf("TEST-5...%s\n", result)
      
      result = driver(51, 
  	13, 32)
      fmt.Printf("TEST-6...%s\n", result)
      
      result = driver(75, 
  	67, 71)
      fmt.Printf("TEST-7...%s\n", result)
      
      result = driver(98, 
  	51, 74)
      fmt.Printf("TEST-8...%s\n", result)
      
      result = driver(83, 
  	74, 78)
      fmt.Printf("TEST-9...%s\n", result)
      
          
  }
source_py: def compute_average_two_numbers_without_overflow_1(a, b):
      return (((a // 2) + (b // 2)) + (((a % 2) + (b % 2)) // 2))
source_cpp: int compute_average_two_numbers_without_overflow_1(int a, int b) {
    return ( a / 2 ) + ( b / 2 ) + ( ( a % 2 + b % 2 ) / 2 );
  }