#C8972. Stabilizing Light Energy
Stabilizing Light Energy
Stabilizing Light Energy
You are given a number of mirrors, each with an initial light energy and a reflectivity percentage. The light that hits a mirror is partially reflected and diminishes by a fixed percentage each time, which creates an infinite geometric series. The final stabilized energy for each mirror can be calculated using the formula:
\( E_{stabilized} = \frac{E}{1 - \frac{r}{100}} \)
where \(E\) is the initial energy and \(r\) is the reflectivity percentage. Round the result to the nearest integer.
Note: All inputs are provided via standard input (stdin) and your output should be printed to standard output (stdout) as space-separated integers representing the final stabilized energies of each mirror.
inputFormat
The first line contains a single integer n representing the number of mirrors.
The second line contains n space-separated integers, where the i-th integer represents the initial energy in front of the i-th mirror.
The third line contains n space-separated integers, where the i-th integer represents the reflectivity percentage of the i-th mirror.
outputFormat
Output a single line containing n space-separated integers, where each integer is the stabilized light energy (rounded to the nearest integer) in front of the corresponding mirror.
## sample3
100 200 300
50 50 50
200 400 600