Sum and product
Time limit2sMemory limit1024 MB
Given n, count the non-increasing sequences of n positive integers whose product equals their sum.
- Level
Medium6 of 10
- Topics
- Math, Number theory, Combinatorics
- Solved
- No attempts yet
Problem
Your math teacher has given the following task for homework: given a positive integer , find a sequence of positive integers such that
and .
You solve this task quickly and convince yourself that such a sequence always exists. Then you start wondering: given a positive integer , how many sequences have these properties?
Write a program that, for a given positive integer , counts the sequences of positive integers that satisfy and .
Input
The standard input has one line with one positive integer , the number of terms in each sequence.
Output
Print one line with the number of sequences that satisfy the conditions. Under the constraints below, the answer is finite and smaller than .