fork download
  1. #include <iostream>
  2. #include <vector>
  3. using namespace std;
  4. int main() {
  5. long long x1, y1, x2, y2;
  6. cin >> x1 >> y1 >> x2 >> y2;
  7. int n;
  8. cin >> n;
  9. int brojac = 0;
  10. long long dx_prava = x2 - x1;
  11. long long dy_prava = y2 - y1;
  12.  
  13. for (int i = 0; i < n; i++) {
  14. long long x, y;
  15. cin >> x >> y;
  16. long long dx_tacka = x - x1;
  17. long long dy_tacka = y - y1;
  18. if (dy_tacka * dx_prava == dy_prava * dx_tacka) {
  19. brojac++;
  20. }
  21. }
  22. cout << brojac << endl;
  23.  
  24. return 0;
  25. }
Success #stdin #stdout 0s 5316KB
stdin
Standard input is empty
stdout
0