title: Number Jump Required Given Length Reach Point Form D 0 Origin 2D Plane
signature: double numberJumpRequiredGivenLengthReachPointFormD0Origin2DPlane(int a, int b, int d) {
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, int d, double expected){
      try
      {
          if (validateSolution(PLACEHOLDER_FN_NAME(a, b, d), 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(35, 8, 77, 3.1714285714285713); 
      cout << "TEST-" << 0 << "..."
           <<  result
           << "\n";
  
      result = driver(85, 55, 33, 2.0); 
      cout << "TEST-" << 1 << "..."
           <<  result
           << "\n";
  
      result = driver(22, 23, 64, 3.739130434782609); 
      cout << "TEST-" << 2 << "..."
           <<  result
           << "\n";
  
      result = driver(8, 43, 29, 2.0); 
      cout << "TEST-" << 3 << "..."
           <<  result
           << "\n";
  
      result = driver(12, 64, 11, 2.0); 
      cout << "TEST-" << 4 << "..."
           <<  result
           << "\n";
  
      result = driver(58, 25, 26, 2.0); 
      cout << "TEST-" << 5 << "..."
           <<  result
           << "\n";
  
      result = driver(65, 4, 28, 2.0); 
      cout << "TEST-" << 6 << "..."
           <<  result
           << "\n";
  
      result = driver(10, 95, 55, 2.0); 
      cout << "TEST-" << 7 << "..."
           <<  result
           << "\n";
  
      result = driver(23, 13, 54, 3.3043478260869565); 
      cout << "TEST-" << 8 << "..."
           <<  result
           << "\n";
  
      result = driver(5, 50, 71, 2.4); 
      cout << "TEST-" << 9 << "..."
           <<  result
           << "\n";
  
      return 0;
  }
source_py: def number_jump_required_given_length_reach_point_form_d_0_origin_2d_plane(a, b, d):
      temp = a
      a = min(a, b)
      b = max(temp, b)
      if (d >= b):
          return (((d + b) - 1) / b)
      if (d == 0):
          return 0
      if (d == a):
          return 1
      return 2
source_cpp: int number_jump_required_given_length_reach_point_form_d_0_origin_2d_plane(int a, int b, int d) {
    int temp = a;
    a = min ( a, b );
    b = max ( temp, b );
    if ( d >= b ) return ( d + b - 1 ) / b;
    if ( d == 0 ) return 0;
    if ( d == a ) return 1;
    return 2;
  }