Find number of distinct arrays of length n such that their poduct is less than or equal to P

Viewed 14

You are given a number (N) and Product (P). Find number of distinct arrays of length N where sum of all its elements is less than or equal to P. The Elements of the array should be non decreasing order i.e., A[0]<=A[1]<=....<=A[N-1].

Two arrays A,B are said to be different if any for any k (0<=k<N) A[k]!=B[k].

Constrainsts:

1<=N<=3 1<=P<=2*10^10

0 Answers
Related