Generation of Combinatorial Objects · Application: Dynamic Programming (Optional)

Lesson 5

Nikolai Chukhin · Alexander S. Kulikov

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.

1 point
Public samples
Public sample 1
Input
1
Expected output
1