New Financial Year
InterviewTime limit1sMemory limit512 MB
Given the new price P and the percent change C for each flavor, recover the original price O using the formula C = 100(P-O)/O.
- Level
Easy2 of 10
- Topics
- Math, Implementation, Array
- Solved
- No attempts yet
Problem
Naomi has spent the past year tracking her doughnut sales. With so many different flavours, some are bound to sell more than others. To maximize her sales for the coming year, she keeps track of certain information on each flavour. She tracks exactly different flavours of doughnuts. For each flavour, she tracks , the original price, , the new price, and , the relative change in price. The relative change in price is computed using the formula .
Unfortunately, during one of her late nights, while analyzing her clipboard of data, she spilled coffee over the entire section of the page that keeps track of the original price of each doughnut flavour.
Can you help Lesley recover her data, specifically , the original price of each doughnut flavour?
Input
The first line contains a single integer , the number of doughnut flavours ().
Each of the following lines describes one flavour and contains two real numbers and (, ), given to exactly 2 decimal places.
Output
Output lines. On line , print , the original price of the -th doughnut flavour, with absolute or relative error at most .