crowulll

Untitled

Aug 18th, 2020
154
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.39 KB | None | 0 0
  1. #include<iostream>
  2. #include<vector>
  3. long long x1, y1, x2, y2, n;
  4. using namespace std;
  5. int main(){
  6.     cin >> x1 >> y1;
  7.     cin >> x2 >> y2;
  8.     cin >> n;
  9.     int k = 0;
  10.     while (n--){
  11.         long long a, b, c;
  12.         cin >> a >> b >> c;
  13.         if ((a*x1 + b*y1 + c > 0 && a*x2 + b*y2 + c < 0) || (a*x1 + b*y1 + c < 0 && a*x2 + b*y2 + c > 0))
  14.             k++;
  15.     }
  16.     cout << k;
  17. }
  18.  
Advertisement
Add Comment
Please, Sign In to add comment