#include <iostream>
using namespace std;
struct Point {
double x;
double y;
Point() : x(0), y(0) {}
bool belongs(double a, double b)const {
auto x = fabs(this->x);
auto y = -b * x - a * this->y + a * b;
return y >= 0;
}
double radius()const {
return sqrt(x * x + y * y);
}
};
double real(const char* msg) {
cout << msg;
double value;
cin >> value;
cin.ignore(cin.rdbuf()->in_avail());
return value;
}
Point point(const char* name) {
Point p;
cout << name;
p.x = real("x: "
cout << name;
p.y = real("y: "
return p;
}
int main() {
auto a = fabs(real("a: ");
auto b = real("b: "
if (b <= 0) exit(0);
auto p = point("A"
if (p.y <= 0 && p.radius() <= a) puts("Yes!"
else if (p.belongs(a, b)) puts("Yes!"
else puts("No!"
system("pause > nul"
}
using namespace std;
struct Point {
double x;
double y;
Point() : x(0), y(0) {}
bool belongs(double a, double b)const {
auto x = fabs(this->x);
auto y = -b * x - a * this->y + a * b;
return y >= 0;
}
double radius()const {
return sqrt(x * x + y * y);
}
};
double real(const char* msg) {
cout << msg;
double value;
cin >> value;
cin.ignore(cin.rdbuf()->in_avail());
return value;
}
Point point(const char* name) {
Point p;
cout << name;
p.x = real("x: "
cout << name;
p.y = real("y: "
return p;
}
int main() {
auto a = fabs(real("a: ");
auto b = real("b: "
if (b <= 0) exit(0);
auto p = point("A"
if (p.y <= 0 && p.radius() <= a) puts("Yes!"
else if (p.belongs(a, b)) puts("Yes!"
else puts("No!"
system("pause > nul"
}