title: Compute Average Two Numbers Without Overflow 1
signature: compute_average_two_numbers_without_overflow_1 <- function(a, b) {
test_code: 
  
  
  # SOLUTION CODE
  # ============================================
  PLACEHOLDER_CODE_BODY
  
  # TESTING CODE 
  # ============================================
  validate_solution <- function(actual, expected) {
      toString(actual)==toString(expected)
  }
  
  driver <- function(a, b, expected){
      if (validate_solution(PLACEHOLDER_FN_NAME(a, b), expected)){
          "PASSED"
      } else{
          "FAILED"
      }
  }
  
  main <- function() {
      cat(sprintf("TEST-0...%s\n",driver(
          9L, 81L, 
          45L
      )))
  
      cat(sprintf("TEST-1...%s\n",driver(
          68L, 79L, 
          73L
      )))
  
      cat(sprintf("TEST-2...%s\n",driver(
          51L, 2L, 
          26L
      )))
  
      cat(sprintf("TEST-3...%s\n",driver(
          31L, 49L, 
          40L
      )))
  
      cat(sprintf("TEST-4...%s\n",driver(
          14L, 10L, 
          12L
      )))
  
      cat(sprintf("TEST-5...%s\n",driver(
          73L, 9L, 
          41L
      )))
  
      cat(sprintf("TEST-6...%s\n",driver(
          51L, 13L, 
          32L
      )))
  
      cat(sprintf("TEST-7...%s\n",driver(
          75L, 67L, 
          71L
      )))
  
      cat(sprintf("TEST-8...%s\n",driver(
          98L, 51L, 
          74L
      )))
  
      cat(sprintf("TEST-9...%s\n",driver(
          83L, 74L, 
          78L
      )))
  
  }
  
  main()
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 );
  }