Discounting Only the Weekend Column
Riverbend Supply is running a weekend promotion. Its price table holds one line per product and three columns, always in this order: the Monday price, the Saturday price, the Sunday price. The promotion takes nothing off Monday, 10 percent off Saturday and 20 percent off Sunday. The same three discounts apply to every product in the table, and the table runs from one product to several thousand.
Task: Print the promotional table — every product's three prices, each with that day's discount already taken off.
Input
The first line holds a single integer n, the number of products. Each of the next n lines holds three prices separated by single spaces: Monday, Saturday, Sunday, in that order.
Output
n lines, one per product, in the input order. Each line holds that product's three prices in day order, separated by single spaces, each with two digits after the decimal point.
Example:
Input:
2
10 10 10
20 20 20
Output:
10.00 9.00 8.00
20.00 18.00 16.00
Sign in to solve this problem
Reading problems is free for everyone — solving them (Run, Submit, and tracking what you've solved) needs an account.
Sign in