Population of Robots
Easy
Execution time limit is 1 second
Runtime memory usage limit is 64 megabytes
Population refers to a group of individuals of the same species living in a specific area, capable of interbreeding, sharing a common origin and genetic makeup, and somewhat isolated from other populations of the same species (definition sourced from Wikipedia, not directly related to the task).
Consider a scenario where A
robots produce C
robots each year, and B
robots produce D
robots each year. Initially, there are N
robots. Your task is to determine the maximum number of robots that can exist after K
years.
Input
The input consists of six integers: A, B, C, D, N, K
, where each value satisfies 1 ≤ A, B, C, D, N, K ≤ 10
.
Output
The output should be a single integer representing the maximum number of robots possible after K
years.
Examples
Input #1
Answer #1
Submissions 2K
Acceptance rate 20%