title: Find Harmonic Mean Using Arithmetic Mean Geometric Mean
signature: class Solution {
  
      public Double findHarmonicMeanUsingArithmeticMeanGeometricMean(Integer a, Integer b) {
source_py: def find_harmonic_mean_using_arithmetic_mean_geometric_mean(a, b):
      AM = ((a + b) / 2)
      GM = math.sqrt((a * b))
      HM = ((GM * GM) / AM)
      return HM
source_cpp: double find_harmonic_mean_using_arithmetic_mean_geometric_mean(int a, int b) {
    double AM, GM, HM;
    AM = ( a + b ) / 2;
    GM = sqrt ( a * b );
    HM = ( GM * GM ) / AM;
    return HM;
  }
question_info.extension: java
question_info.entry_fn_name: findHarmonicMeanUsingArithmeticMeanGeometricMean
question_info.entry_cls_name: Solution
question_info.test_list: [{"idx": 0, "outputs": 65.43065693430657, "inputs": {"a": 54, "b": 83}}, {"idx": 1, "outputs": 48.0, "inputs": {"a": 42, "b": 56}}, {"idx": 2, "outputs": 20.16, "inputs": {"a": 63, "b": 12}}, {"idx": 3, "outputs": 30.4, "inputs": {"a": 19, "b": 76}}, {"idx": 4, "outputs": 45.054945054945065, "inputs": {"a": 41, "b": 50}}, {"idx": 5, "outputs": 11.030303030303031, "inputs": {"a": 7, "b": 26}}, {"idx": 6, "outputs": 40.444444444444436, "inputs": {"a": 39, "b": 42}}, {"idx": 7, "outputs": 18.773333333333333, "inputs": {"a": 11, "b": 64}}, {"idx": 8, "outputs": 87.86440677966101, "inputs": {"a": 96, "b": 81}}, {"idx": 9, "outputs": 23.47826086956522, "inputs": {"a": 15, "b": 54}}]
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, Double 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(54, 83, 65.43065693430657);
          System.out.println(String.format("%s%s","TEST-0...",result));    
      
          result = validateSolution(42, 56, 48.0);
          System.out.println(String.format("%s%s","TEST-1...",result));    
      
          result = validateSolution(63, 12, 20.16);
          System.out.println(String.format("%s%s","TEST-2...",result));    
      
          result = validateSolution(19, 76, 30.4);
          System.out.println(String.format("%s%s","TEST-3...",result));    
      
          result = validateSolution(41, 50, 45.054945054945065);
          System.out.println(String.format("%s%s","TEST-4...",result));    
      
          result = validateSolution(7, 26, 11.030303030303031);
          System.out.println(String.format("%s%s","TEST-5...",result));    
      
          result = validateSolution(39, 42, 40.444444444444436);
          System.out.println(String.format("%s%s","TEST-6...",result));    
      
          result = validateSolution(11, 64, 18.773333333333333);
          System.out.println(String.format("%s%s","TEST-7...",result));    
      
          result = validateSolution(96, 81, 87.86440677966101);
          System.out.println(String.format("%s%s","TEST-8...",result));    
      
          result = validateSolution(15, 54, 23.47826086956522);
          System.out.println(String.format("%s%s","TEST-9...",result));    
      
      }
  }
  
  class Driver{
      public boolean run(Integer a, Integer b, Double expected){
  
          PLACEHOLDER_CLS_NAME sol = new PLACEHOLDER_CLS_NAME();
          return validateSolution(sol.PLACEHOLDER_FN_NAME(a, b),expected);
      }
      
      public boolean validateSolution(Double actual, Double expected){
          return Math.abs(actual - expected) < 1e-09;
      }
  }
  
  
  // 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__