Wesley's Anger Contest 6 Problem 1 - Timbit Sales

View as PDF

Submit solution

Points: 3
Time limit: 1.0s
Memory limit: 256M

Problem type
Allowed languages
Ada, Assembly, Awk, Brain****, C, C#, C++, COBOL, CommonLisp, D, Dart, F#, Forth, Fortran, Go, Groovy, Haskell, Intercal, Java, JS, Kotlin, Lisp, Lua, Nim, ObjC, OCaml, Octave, Pascal, Perl, PHP, Pike, Prolog, Python, Racket, Ruby, Rust, Scala, Scheme, Sed, Swift, TCL, Text, Turing, VB, Zig

Lesley has spent the past year tracking her timbit sales. With so many different flavours, some are bound to sell more than others. In order to maximize her sales for the coming year, she keeps track of certain information on each timbit flavour. She tracks exactly N different flavours of timbits. For each flavour she tracks O, the original price, P, the new price, and C, the relative change in price. The relative change in price is computed using the formula C = \frac{P - O}{O} \times 100\%.

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 timbit flavour.

Can you help Lesley recover her data, specifically O, the original price of each timbit flavour?


For this problem, you will be required to pass all the samples in order to receive points.

1 \le N \le 10\,000

1 \le P \le 1000.00

-100.00 < C \le 1000.00

Input Specification

The first line contains a single integer N, the number of timbit flavours.

The following N lines each contain P and C, given to exactly 2 decimal places.

Output Specification

This problem is graded with a custom checker.

Output N lines, on each line O, the original price of the i^\text{th} timbit flavour. Ensure each line is terminated with a \n character and has no leading nor trailing spaces.

Your answer will be considered correct if it has an absolute or relative error of at most 10^{-5} from the reference solution. It is guaranteed that the absolute or relative error of the reference solution is much smaller than 10^{-5} from the optimal solution.

Sample Input

100.00 10.50
50.00 -50.75

Sample Output



There are no comments at the moment.