SPOJ PROBLEM EIDSALAMI2

Revision en1, by prrateekk, 2016-08-17 22:46:55

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?

Tags spoj

History

 
 
 
 
Revisions
 
 
  Rev. Lang. By When Δ Comment
en2 English prrateekk 2016-08-18 00:30:46 375
en1 English prrateekk 2016-08-17 22:46:55 596 Initial revision (published)