Am i missing something here? The task looks really simple, still I get wrong result in the tests. Can someone tell me what the trick is, or what am I doing wrong?
#include <iostream>
using namespace std;
int main()
{
double k,n,x1,y1;
scanf("%lf %lf",&k,&n);
int N,rjes;
rjes=0;
scanf("%d",&N);
for (int i=0;i<N;i++)
{
scanf("%lf %lf",&x1,&y1);
if ((x1>=0.0) && (y1==x1*k+n))rjes++;
}
printf("%d\n",rjes);
system("pause");
return 0;
}