#C2048. Fish Population Growth
Fish Population Growth
Fish Population Growth
You are given an aquarium with N types of fish. Initially, each fish type has exactly 1 fish. At each second, every fish produces K offspring (regardless of its type), and these offspring belong to the same fish type as the parent. After T seconds, your task is to calculate the number of fish for each type. The growth of the fish can be formally expressed by the formula:
\(\text{population} = 1 + K \times T\)
Note that the list of fish types is provided only for the sake of input format and does not affect the calculation. Make sure to read from standard input and write the result to standard output.
inputFormat
The input is provided via standard input and consists of 4 lines:
- An integer N representing the number of fish types.
- N space-separated integers representing the fish types (this list is not used in the calculation).
- An integer T representing the total time in seconds.
- An integer K representing the number of offspring produced by each fish type per second.
outputFormat
Output a single line containing N space-separated integers. Each integer is the number of fish of that type after T seconds, computed using the formula:
\(1 + K \times T\)
## sample3
1 2 3
2
2
5 5 5