fork(1) download
  1. #include <stdio.h>
  2.  
  3. int main()
  4. {
  5. int t=0;
  6. float a , b;
  7. float aChanges, bChanges;
  8. scanf("%f %f\n%f %f",&a,&b,&aChanges,&bChanges);
  9. if (b>a && bChanges>aChanges)
  10. {
  11. printf("-1");
  12. }
  13. else
  14. {
  15. while(a*aChanges<b*bChanges)
  16. {
  17. a=a*aChanges;
  18. b=b*bChanges;
  19. t=t+1;
  20. }
  21. printf("%d",t);
  22. }
  23. return 0;
  24. }
  25.  
Success #stdin #stdout 0s 5284KB
stdin
45
stdout
Standard output is empty