Generation of Combinatorial Objects · Application: Dynamic Programming (Optional)
Lesson 5
Programming problem.
Write a program that reads an integer \(2 \le n \le 10\) and outputs all the ways to represent \(n\) as a sum of positive integers. Two ways that differ only in the order of summands (e.g., \(1+3\) and \(3+1\)) are considered the same.
Public samples
Input
1
Expected output
1