fork(1) download
  1. #include <iostream>
  2. #include <math.h>
  3. using namespace std;
  4.  
  5. int main() {
  6. double k,p,s,n; int y;
  7. cin>>k>>p>>s>>n;
  8. if ((k<=0)||(p<=0)||(s<=0)||(n<=0)) {cout<<"Неверные денные";}
  9. else {
  10. y = ceil(log(n*s/k)/log(p));
  11. cout<<y;
  12. }
  13. }
Success #stdin #stdout 0s 3460KB
stdin
6	10	20	700
stdout
4