I've been trying this problem on spoj but not been able to come up with a optimal solution. The statement translates to — find number of ways to divide a number 'm' into 'n' distinct positive numbers.
1<=m,n<=10^6 also, m*n<=10^6
I was thinking of applying dp, but was stuck at it because it required all the numbers to be distinct. It is obvious that for all values of 'n' around 1400 and above, answer is 0.But that didn't help me in my approach.
Can dp be applied? Or could it be solved using other method?