Discount solution codechef – Alice buys a toy with a selling price of 100 rupees. There is a discount of x percent on the toy. Find the amount Alice needs to pay for it.
[Solution] Discount solution codechef
- The first line of input will contain a single integer T, denoting the number of test cases.
- The first and only line of each test case contains a single integer, x — the discount on the toy.
For each test case, output on a new line the price that Alice needs to pay.
- 1 \leq T \leq 100
- 0 \leq x \lt 100
Discount solution codechef
4 5 9 11 21
95 91 89 79
Discount solution codechef Explanation
Test case 1: The discount is 5 percent, i.e. 5 rupees. So, Alice will have to pay 100-5=95 rupees.