This is my code....
#include<iostream>
#include<conio.h>
using namespace std;
int main()
{
int t,i,j,k,m,n,o,q=0,a,b,c;
cin>>n;
cin>>k;
i=n+1;
j=k-1;
for(a=n+1;a<=k-1;a++)
{
for(b=i;b<=j;b++)
{
m=a*b-n;
n=a-n;
o=b-n;
t=n*o;
c=m%t;
if(c==0)
{
m=0;
n=0;
o=0;
q++;
}
else
{
m=0;
n=0;
o=0;
break;
}
}
}
cout<<q;
getch();
return 0;
}
whats wrong with it?
Input:
Input will be two numbers by which I have to find the number of pairs (a,b) which will be considered the condition....
(a*b-n) is divisible by (a-n) and (b-n).
Like....
n=1 and k=5
The output will be....
2, because (2,2) and (3,3) are the expected pairs.