title: Compute Average Two Numbers Without Overflow 1
signature: function computeAverageTwoNumbersWithoutOverflow1($a, $b) {
test_code: <?php
  
  
  // SOLUTION CODE 
  // ============================================
  PLACEHOLDER_CODE_BODY
  
  // TESTING CODE 
  // ============================================
  function validateSolution($actual, $expected){
      return serialize($actual) == serialize($expected);
  }
  
  function driver($a, $b, $expected){
      try{
        if (validateSolution(PLACEHOLDER_FN_NAME($a, $b), $expected)){
          return "PASSED";
        }
        return "FAILED";
      }
      catch (Exception $exception_obj) {
        return get_class($exception_obj);
      }
  }
  
  function main(){
      printf("TEST-0...%s\n",driver(
        9, 81, 
        45));
      
      printf("TEST-1...%s\n",driver(
        68, 79, 
        73));
      
      printf("TEST-2...%s\n",driver(
        51, 2, 
        26));
      
      printf("TEST-3...%s\n",driver(
        31, 49, 
        40));
      
      printf("TEST-4...%s\n",driver(
        14, 10, 
        12));
      
      printf("TEST-5...%s\n",driver(
        73, 9, 
        41));
      
      printf("TEST-6...%s\n",driver(
        51, 13, 
        32));
      
      printf("TEST-7...%s\n",driver(
        75, 67, 
        71));
      
      printf("TEST-8...%s\n",driver(
        98, 51, 
        74));
      
      printf("TEST-9...%s\n",driver(
        83, 74, 
        78));
      
  }
  
  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 );
  }