시간 제한 | 메모리 제한 | 제출 | 정답 | 맞힌 사람 | 정답 비율 |
---|---|---|---|---|---|
2 초 | 1024 MB | 76 | 5 | 3 | 37.500% |
Your math teacher has given the following task for homework: given a positive integer n, find a sequence of positive integers a1, a2, a3,…….., an, such that
a1 × a2 × a3 × … × an = a1 + a2 + a3 + … + an and a1 ≥ a2 ≥ a3 ≥……..≥ an
You quickly solve this task and by doing so, you convince yourself that such a sequence always exists but then you start thinking about the question: "Given a positive integer n, what is the number of sequences with the above properties?"
Write the program, which for a given positive integer n finds the number of sequences of positive integers a1, a2, a3,…….., an, such that
a1 × a2 × a3 × … × an = a1 + a2 + a3 + … + an and a1 ≥ a2 ≥ a3 ≥……..≥ an
From one line of the standard input, read one positive integer n – the count of the numbers in the sequences.
On one line of the standard output, the program has to write the found number of sequences. We know, it can be proven that given the constraints below, the answer is a finite number smaller than 1018.
번호 | 배점 | 제한 |
---|---|---|
1 | 5 | n ≤ 10 |
2 | 10 | n ≤ 1 000 000 |
3 | 10 | n ≤ 100 000 000 |
4 | 10 | n ≤ 1 000 000 000 |
5 | 20 | n ≤ 10 000 000 000 |
6 | 45 | n ≤ 100 000 000 000 |
2
1
There is only one sequence with the specified properties and it is (2, 2).
8
2
The two sequences are (8, 2, 1, 1, 1, 1, 1, 1) and (3, 2, 2, 1, 1, 1, 1, 1).