#C11056. Team Formation Counting
Team Formation Counting
Team Formation Counting
Given a positive integer \(P\) representing the number of programmers, your task is to determine the number of distinct ways to form teams such that each team has at least 1 member and no team has more than 5 members. Every programmer must be included in exactly one team.
The problem can be solved using dynamic programming. Let \(dp[i]\) be the number of ways to form teams with \(i\) programmers. The recurrence relation is given by:
$$dp[i] = \sum_{j=1}^{5} dp[i-j]$$ for \(i \ge 1\) with the initial condition \(dp[0] = 1\).
Compute \(dp[P]\) for the given \(P\).
inputFormat
The input is a single integer \(P\) which represents the total number of programmers.
outputFormat
Output a single integer, the number of distinct team formations such that every programmer is assigned to a team, and each team has at most 5 members.
## sample1
1
</p>