title: Finding Power Prime Number P N
signature: function finding_power_prime_number_p_n(n, p)
test_code: using Printf
  
  # SOLUTION CODE
  # ============================================
  PLACEHOLDER_CODE_BODY
  
  # TESTING CODE 
  # ============================================
  function validate_solution(actual, expected)
      return abs(actual - expected) < 1e-09
  end
  
  function driver(n, p, expected)
      try
  
          if validate_solution(PLACEHOLDER_FN_NAME(n, p), expected)
              return "PASSED";
          end
          return "FAILED";
      catch exception_obj
          return string(Base.typename(typeof(exception_obj)).wrapper);
      end
  end
  
  function main()
      
      result = driver(49, 30, 1.6333333333333333);
      @printf("TEST-0...%s\n",result);
      
      result = driver(80, 25, 3.2);
      @printf("TEST-1...%s\n",result);
      
      result = driver(10, 9, 1.1111111111111112);
      @printf("TEST-2...%s\n",result);
      
      result = driver(81, 57, 1.4210526315789473);
      @printf("TEST-3...%s\n",result);
      
      result = driver(11, 4, 2.75);
      @printf("TEST-4...%s\n",result);
      
      result = driver(45, 34, 1.3235294117647058);
      @printf("TEST-5...%s\n",result);
      
      result = driver(86, 90, 0.0);
      @printf("TEST-6...%s\n",result);
      
      result = driver(27, 78, 0.0);
      @printf("TEST-7...%s\n",result);
      
      result = driver(80, 60, 1.3333333333333333);
      @printf("TEST-8...%s\n",result);
      
      result = driver(97, 31, 3.129032258064516);
      @printf("TEST-9...%s\n",result);
      
  end
  
  main()
source_py: def finding_power_prime_number_p_n(n, p):
      ans = 0
      temp = p
      while (temp <= n):
          ans += (n / temp)
          temp = (temp * p)
      return ans
source_cpp: int finding_power_prime_number_p_n(int n, int p) {
    int ans = 0;
    int temp = p;
    while ( temp <= n ) {
      ans += n / temp;
      temp = temp * p;
    }
    return ans;
  }