Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iomanip>
- #include <iostream>
- #include <functional>
- #include <algorithm>
- #include <math.h>
- #include <cmath>
- #include <string>
- #include <vector>
- #include<set>
- #include<map>
- #include <time.h>
- #include <fstream>
- using namespace std;
- typedef long long ll;
- typedef double d;
- int main(){
- int h1, h2;
- int a, b;
- cin >> h1 >> h2 >> a >> b;
- int v = h2 - h1;
- a = a ;
- b = b ;
- v = v - a * 8;
- if (v <= 0){
- cout << 0;
- return 0;
- }
- if (a <= b){
- cout << -1;
- return 0;
- }
- int test =0;
- for (int i = 0; i < 300000; i++){
- test-= b * 12;
- test += a * 12;
- if (test >= v){
- cout << i + 1;
- return 0;
- }
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement