Given a positive integer A,
find and return the length of the longest sequence a, …, a[k] of positive integers such that:
The sum of all a[i] is A. For each valid i, a[i] < a[i+1]. For each valid i, a[i] divides a[i+1].
The only argument given is integer A.
Return the length of the longest sequence satisfying the above conditions.
1 <= A <= 2*10^9
Input 1: A = 15 Output 1: 4 (1, 2, 4, 8) Input 2: A = 34 Output 2: 4 (1, 3, 6, 24)
NOTE: You only need to implement the given function. Do not read input, instead use the arguments to the function. Do not print the output, instead return values as specified. Still have a doubt? Checkout Sample Codes for more details.