Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <cmath>
- #include <iomanip>
- #include <cstdio>
- #include <algorithm>
- #include <vector>
- #include <string>
- #include <cstring>
- #include <set>
- #include <map>
- #include <ctime>
- #include <cstdlib>
- using namespace std;
- const int N = 210000;
- int i;
- double x, y, z, a, b, c, d;
- int main()
- {
- freopen("input.txt","r",stdin);
- freopen("output.txt","w",stdout);
- cin >> a >> b >> c >> d;
- for (i = 1; i < 10000001; i ++)
- {
- {
- x = i / a;
- y = i / b;
- z = i / c;
- if (x + y + z + d == i)
- return cout << i, 0;
- }
- }
- cout << - 1;
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement