Skip to content

Commit

Permalink
Add 20206.cpp
Browse files Browse the repository at this point in the history
  • Loading branch information
Hiyabye committed Jun 18, 2024
1 parent 59a07c8 commit fa1b63c
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions 20xxx/20206.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
#include <iostream>
using namespace std;

bool solve(void) {
int a, b, c; cin >> a >> b >> c;
int x1, x2, y1, y2; cin >> x1 >> x2 >> y1 >> y2;

int p1 = a * x1 + b * y1 + c;
int p2 = a * x1 + b * y2 + c;
int p3 = a * x2 + b * y1 + c;
int p4 = a * x2 + b * y2 + c;

return ((p1 <= 0) && (p2 <= 0) && (p3 <= 0) && (p4 <= 0)) || ((p1 >= 0) && (p2 >= 0) && (p3 >= 0) && (p4 >= 0));
}

int main(void) {
ios::sync_with_stdio(false);
cin.tie(nullptr);

cout << (solve() ? "Lucky" : "Poor");
return 0;
}

0 comments on commit fa1b63c

Please sign in to comment.