title: Find Harmonic Mean Using Arithmetic Mean Geometric Mean
signature: double findHarmonicMeanUsingArithmeticMeanGeometricMean(int a, int b) {
test_code: #include <algorithm>
  #include <assert.h>
  #include <cstdlib>
  #include <iostream>
  #include <map>
  #include <set>
  #include <string>
  #include <tuple> 
  #include <unordered_map>
  #include <vector>
  #include <math.h>
  #include <cmath>
  #include <bits/stdc++.h>
  #include <numeric>
  #include <functional>
  
  using namespace std;
  
  // SOLUTION CODE
  // ============================================
  PLACEHOLDER_CODE_BODY
  
  // TESTING CODE 
  // ============================================
  bool validateSolution(double actual, double expected){
      return abs(actual - expected) < 1e-09;
  }
  
  string driver(int a, int b, double expected){
      try
      {
          if (validateSolution(PLACEHOLDER_FN_NAME(a, b), expected)){
              return "PASSED";
          }
          return "FAILED";
      }
      catch (const std::overflow_error& exception_obj)
      {
          return typeid(exception_obj).name();
      }
      catch (const std::runtime_error& exception_obj)
      {
          return typeid(exception_obj).name();
      }
      catch (const std::exception& exception_obj)
      {
          return typeid(exception_obj).name();
      }
      catch (...)
      {
          return "UNK_ERROR";
      }
  }
  
  int main() {
      string result = "";
  
      result = driver(54, 83, 65.43065693430657); 
      cout << "TEST-" << 0 << "..."
           <<  result
           << "\n";
  
      result = driver(42, 56, 48.0); 
      cout << "TEST-" << 1 << "..."
           <<  result
           << "\n";
  
      result = driver(63, 12, 20.16); 
      cout << "TEST-" << 2 << "..."
           <<  result
           << "\n";
  
      result = driver(19, 76, 30.4); 
      cout << "TEST-" << 3 << "..."
           <<  result
           << "\n";
  
      result = driver(41, 50, 45.054945054945065); 
      cout << "TEST-" << 4 << "..."
           <<  result
           << "\n";
  
      result = driver(7, 26, 11.030303030303031); 
      cout << "TEST-" << 5 << "..."
           <<  result
           << "\n";
  
      result = driver(39, 42, 40.444444444444436); 
      cout << "TEST-" << 6 << "..."
           <<  result
           << "\n";
  
      result = driver(11, 64, 18.773333333333333); 
      cout << "TEST-" << 7 << "..."
           <<  result
           << "\n";
  
      result = driver(96, 81, 87.86440677966101); 
      cout << "TEST-" << 8 << "..."
           <<  result
           << "\n";
  
      result = driver(15, 54, 23.47826086956522); 
      cout << "TEST-" << 9 << "..."
           <<  result
           << "\n";
  
      return 0;
  }
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;
  }