title: Finding Power Prime Number P N
signature: function findingPowerPrimeNumberPN($n, $p) {
test_code: <?php
  
  
  // SOLUTION CODE 
  // ============================================
  PLACEHOLDER_CODE_BODY
  
  // TESTING CODE 
  // ============================================
  function validateSolution($actual, $expected){
      return abs($actual - $expected) < 1e-09;
  }
  
  function driver($n, $p, $expected){
      try{
        if (validateSolution(PLACEHOLDER_FN_NAME($n, $p), $expected)){
          return "PASSED";
        }
        return "FAILED";
      }
      catch (Exception $exception_obj) {
        return get_class($exception_obj);
      }
  }
  
  function main(){
      printf("TEST-0...%s\n",driver(
        49, 30, 
        1.6333333333333333));
      
      printf("TEST-1...%s\n",driver(
        80, 25, 
        3.2));
      
      printf("TEST-2...%s\n",driver(
        10, 9, 
        1.1111111111111112));
      
      printf("TEST-3...%s\n",driver(
        81, 57, 
        1.4210526315789473));
      
      printf("TEST-4...%s\n",driver(
        11, 4, 
        2.75));
      
      printf("TEST-5...%s\n",driver(
        45, 34, 
        1.3235294117647058));
      
      printf("TEST-6...%s\n",driver(
        86, 90, 
        0.0));
      
      printf("TEST-7...%s\n",driver(
        27, 78, 
        0.0));
      
      printf("TEST-8...%s\n",driver(
        80, 60, 
        1.3333333333333333));
      
      printf("TEST-9...%s\n",driver(
        97, 31, 
        3.129032258064516));
      
  }
  
  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;
  }