https://www.codechef.com/problems/MLINE

Whats wrong in this solution???

#include <bits/stdc++.h>
using namespace std;

#define endl ("\n")
#define pi (3.141592653589)
#define mod 1e9+7
#define ll long long
#define rfo(i, n) for(int i = n-1; i >=0; i–)
#define fo(i, n) for(int i = 0; i < n; i++)
#define fast ios_base::sync_with_stdio(false), cin.tie(0), cout.tie(0);

void solve();

int main() {
fast

int t = 1;
cin >> t;
while(t--) {
	solve();
}
return 0;

}
// write code here
void solve() {
ll n, m, c;
cin >> n >> m >> c;
ll p[n][2];
fo(i, n) {
fo(j, 2) {
cin >> p[i][j];
}
}
int ctr = 0;
fo(i, n) {
if (p[i][1] != m * p[i][0] + c)
for (int j = i+1; j < n; j++) {
if ((p[i][1] - m * p[i][0] - c) * (p[j][1] - m * p[j][0] - c) < 0)
{
ctr++;
}
}
}

cout << ctr << endl;

}`