Alex_tz307

School-CCC Hyperloop Direct - Level 3

Oct 28th, 2020
126
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.47 KB | None | 0 0
  1. #include <bits/stdc++.h>
  2.  
  3. using namespace std;
  4.  
  5. ifstream fin("text.in");
  6. ofstream fout("text.out");
  7.  
  8. int main() {
  9.     int x1, x2, Y;
  10.     fin >> x1 >> x2 >> Y;
  11.     double u1 = atan2(Y, x1), u2 = atan2(Y, x2);
  12.     int T;
  13.     fin >> T;
  14.     while(T--) {
  15.         int x, y;
  16.         fin >> x >> y;
  17.         double u = atan2(y, x);
  18.         if(u < min(u1, u2) || u > max(u1, u2) || (y < Y && Y > 0) || (y > Y && Y < 0))
  19.             fout << x << ' ' << y << ' ';
  20.     }
  21. }
  22.  
Advertisement
Add Comment
Please, Sign In to add comment