eolymp
bolt
Try our new interface for solving problems
Problems

Forest

Forest

\includegraphics{https://static.e-olymp.com/content/8e/8ee583445e57a96de13c4e252e64b80ec6d404f2.jpg} \textbf{Morning in a pine forest. 1889.} \textit{Perhaps the most popular painting Shishkin - "Morning in a pine forest". In it he seeks to convey the charm of untouched wilderness, poetiziruya life of the forest.} \textit{Bears written by another artist, K.A.Savitsky. They turned out so well that even Sawicki signed with Shishkin in the picture. However, P.M.Tretyakov, buying a painting, took off his signature. It approved the authorship of one Shishkin. Indeed, in the film, said Patron, "ranging from design and ending with the execution, said all manner of painting, creative method, peculiar to Shishkin".} Consider a simple model of tree growth in a pine forest. All trees are divided into four groups: young seedlings (age group \textbf{0} to \textbf{15} years), young trees (\textbf{16} to \textbf{30} years), middle-aged trees (from \textbf{31} to \textbf{45} years) and old (over \textbf{45}). The duration of one time period is \textbf{15} years. In the problem is necessary to determine quantitative changes in populations of trees if: 1. A certain percentage of each group of trees are killed; 2. Surviving trees of one group moving into the next age group. Old trees are old; 3. Dead trees are replaced by young saplings. Thus, the number of trees in the forest remains intact. It is known that the original forest is composed of \textbf{n} young seedlings. Known percentage of trees that die over a period of time in each age group: \textbf{p_baby}, \textbf{p_young}, \textbf{p_\{middle-age\}}, \textbf{p_old}. Necessary to determine the average number of trees in each group after \textbf{15k} years. \InputFile Each line is a separate test and contains \textbf{6} integer values: \textbf{n} (\textbf{10} < \textbf{n} < \textbf{100000}), \textbf{k} (\textbf{1} ≤ \textbf{k} ≤ \textbf{100)}, \textbf{p_baby}_\{,\} \textbf{p_young}, \textbf{p_\{middle-age\}}, \textbf{p_old}. (\textbf{0} ≤ \textbf{p_baby}, \textbf{p_young}, \textbf{p_\{middle-age\}}, \textbf{p_old} ≤ \textbf{100}). \OutputFile For each test, bring in a separate row \textbf{4} of the value - the average number of trees in each group over \textbf{15k} years. All the numbers show a \textbf{6} characters after the decimal point.
Time limit 1 second
Memory limit 64 MiB
Input example #1
50000 1 10 20 30 40
50000 2 10 20 30 40
50000 3 10 20 30 40
50000 100 10 20 30 40
Output example #1
5000.000000 45000.000000 0.000000 0.000000
9500.000000 4500.000000 36000.000000 0.000000
12650.000000 8550.000000 3600.000000 25200.000000
12886.597938 11597.938144 9278.350515 16237.113402
Source Медведев М.Г. - Зимняя школа в Харькове 2009