Advertisement
jeff69

Untitled

Mar 25th, 2016
71
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.68 KB | None | 0 0
  1. #include <iomanip>
  2. #include <iostream>
  3. #include <functional>
  4. #include <algorithm>
  5. #include <math.h>
  6. #include <cmath>
  7. #include <string>
  8. #include <vector>
  9. #include<set>
  10. #include<map>
  11. #include <time.h>
  12. #include <fstream>
  13. using namespace std;
  14. typedef long long ll;
  15.  
  16. typedef double d;
  17.  
  18.  
  19.  
  20. int main(){
  21. int h1, h2;
  22. int a, b;
  23. cin >> h1 >> h2 >> a >> b;
  24. int v = h2 - h1;
  25. a = a ;
  26. b = b ;
  27.  
  28.  
  29. v = v - a * 8;
  30. if (v <= 0){
  31. cout << 0;
  32. return 0;
  33. }
  34. if (a <= b){
  35. cout << -1;
  36. return 0;
  37. }
  38.  
  39. int test =0;
  40. for (int i = 0; i < 300000; i++){
  41. test-= b * 12;
  42. test += a * 12;
  43. if (test >= v){
  44. cout << i + 1;
  45. return 0;
  46. }
  47. }
  48.  
  49. return 0;
  50.  
  51.  
  52. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement