Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <bits/stdc++.h>
- using namespace std;
- typedef long long ll;
- typedef long double ld;
- int main()
- {
- ll a, b, c, d;
- cin >> a >> b >> c >> d;
- vector <ll> a1, d1;
- for (int i = 2; i < a; i++){
- if (a % i == 0){
- a1.push_back(i);
- a1.push_back(-i);
- }
- }
- for (int i = 2; i < d; i++){
- if (d % i == 0){
- d1.push_back(i);
- d1.push_back(-i);
- }
- }
- ld temp, eps = 1e-7;
- for (int i = 0; i < a1.size(); i++)
- for (int j = 0; j < d1.size(); j++){
- temp = i * 1.0 / j;
- if (fabs(((a * temp + b) * temp + c) * temp + d) < eps){
- cout << "Yes" << endl;
- return 0;
- }
- }
- cout << "No" << endl;
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement