Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include<iostream>
- #include<vector>
- long long x1, y1, x2, y2, n;
- using namespace std;
- int main(){
- cin >> x1 >> y1;
- cin >> x2 >> y2;
- cin >> n;
- int k = 0;
- while (n--){
- long long a, b, c;
- cin >> a >> b >> c;
- 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))
- k++;
- }
- cout << k;
- }
Advertisement
Add Comment
Please, Sign In to add comment