title: Compute Average Two Numbers Without Overflow 1
signature: class Solution {
  
      public Integer computeAverageTwoNumbersWithoutOverflow1(Integer a, Integer b) {
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 );
  }
question_info.extension: java
question_info.entry_fn_name: computeAverageTwoNumbersWithoutOverflow1
question_info.entry_cls_name: Solution
question_info.test_list: [{"idx": 0, "outputs": 45, "inputs": {"a": 9, "b": 81}}, {"idx": 1, "outputs": 73, "inputs": {"a": 68, "b": 79}}, {"idx": 2, "outputs": 26, "inputs": {"a": 51, "b": 2}}, {"idx": 3, "outputs": 40, "inputs": {"a": 31, "b": 49}}, {"idx": 4, "outputs": 12, "inputs": {"a": 14, "b": 10}}, {"idx": 5, "outputs": 41, "inputs": {"a": 73, "b": 9}}, {"idx": 6, "outputs": 32, "inputs": {"a": 51, "b": 13}}, {"idx": 7, "outputs": 71, "inputs": {"a": 75, "b": 67}}, {"idx": 8, "outputs": 74, "inputs": {"a": 98, "b": 51}}, {"idx": 9, "outputs": 78, "inputs": {"a": 83, "b": 74}}]
question_info.test_code: import static java.util.Map.entry;  
  import java.util.*;
  import java.lang.*;
  // TESTING CODE 
  // ============================================
  class QuestionEvaluator {
      public static String validateSolution(Integer a, Integer b, Integer expected){
          try{
              Driver driver = new Driver();
              if (driver.run(a, b,expected)){
                  return "PASSED";
              }
              return "FAILED";
              
          } catch (Exception exception_obj){
              return exception_obj.getClass().getSimpleName();
          }
  
      }
      public static void main(String[] args) {
          String result;
          result = validateSolution(9, 81, 45);
          System.out.println(String.format("%s%s","TEST-0...",result));    
      
          result = validateSolution(68, 79, 73);
          System.out.println(String.format("%s%s","TEST-1...",result));    
      
          result = validateSolution(51, 2, 26);
          System.out.println(String.format("%s%s","TEST-2...",result));    
      
          result = validateSolution(31, 49, 40);
          System.out.println(String.format("%s%s","TEST-3...",result));    
      
          result = validateSolution(14, 10, 12);
          System.out.println(String.format("%s%s","TEST-4...",result));    
      
          result = validateSolution(73, 9, 41);
          System.out.println(String.format("%s%s","TEST-5...",result));    
      
          result = validateSolution(51, 13, 32);
          System.out.println(String.format("%s%s","TEST-6...",result));    
      
          result = validateSolution(75, 67, 71);
          System.out.println(String.format("%s%s","TEST-7...",result));    
      
          result = validateSolution(98, 51, 74);
          System.out.println(String.format("%s%s","TEST-8...",result));    
      
          result = validateSolution(83, 74, 78);
          System.out.println(String.format("%s%s","TEST-9...",result));    
      
      }
  }
  
  class Driver{
      public boolean run(Integer a, Integer b, Integer expected){
  
          PLACEHOLDER_CLS_NAME sol = new PLACEHOLDER_CLS_NAME();
          return validateSolution(sol.PLACEHOLDER_FN_NAME(a, b),expected);
      }
      
      public boolean validateSolution(Integer actual, Integer expected){
          return actual.equals(expected);
      }
  }
  
  
  // SOLUTION CODE
  // ============================================
  PLACEHOLDER_CODE_BODY
question_info.test_case_ids: 0 1 2 3 4 5 6 7 8 9
question_info.commands: java __FILENAME__