@ sunny i am not getting ur apporach
but i am thinking like this......
taking an array from and intilize it to n to n-r
a[1000];
int k=0;
for(int i=n;i>=n-r;i--)
a[k++]=i;
for(int y=n-r;y>1;y--)
for(j=0;j<k;j++)
if(a[j]%y==0)
{a[j]=a[j]/y;break;}
for example we take 7c3
so first array is intilize to {7,6,5,4}
then we check divisibilty by {3,2}
so 6 is divisible by 3 so put 6/3 back in array 2
so finally 7*2*5*2;
--
You received this message because you are subscribed to the Google Groups
"Algorithm Geeks" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/algogeeks?hl=en.