307065: CF1296B. Food Buying
Memory Limit:256 MB
Time Limit:1 S
Judge Style:Text Compare
Creator:
Submit:0
Solved:0
Description
Food Buying
题意翻译
你有 $s$ ($s\leq 10^9$)元钱用于买零食。 超市有优惠活动,每次消费 $x$ 元可以返还价值 $\dfrac{x}{10}$ (向下取整) 元的代金券。代金券下次购物时才可以使用。 询问你用这 $s$ 元最多可以买到价值多少元的物品? 附:每个测点 $t$ 组询问($t\leq 10^4$)。题目描述
Mishka wants to buy some food in the nearby shop. Initially, he has $ s $ burles on his card. Mishka can perform the following operation any number of times (possibly, zero): choose some positive integer number $ 1 \le x \le s $ , buy food that costs exactly $ x $ burles and obtain $ \lfloor\frac{x}{10}\rfloor $ burles as a cashback (in other words, Mishka spends $ x $ burles and obtains $ \lfloor\frac{x}{10}\rfloor $ back). The operation $ \lfloor\frac{a}{b}\rfloor $ means $ a $ divided by $ b $ rounded down. It is guaranteed that you can always buy some food that costs $ x $ for any possible value of $ x $ . Your task is to say the maximum number of burles Mishka can spend if he buys food optimally. For example, if Mishka has $ s=19 $ burles then the maximum number of burles he can spend is $ 21 $ . Firstly, he can spend $ x=10 $ burles, obtain $ 1 $ burle as a cashback. Now he has $ s=10 $ burles, so can spend $ x=10 $ burles, obtain $ 1 $ burle as a cashback and spend it too. You have to answer $ t $ independent test cases.输入输出格式
输入格式
The first line of the input contains one integer $ t $ ( $ 1 \le t \le 10^4 $ ) — the number of test cases. The next $ t $ lines describe test cases. Each test case is given on a separate line and consists of one integer $ s $ ( $ 1 \le s \le 10^9 $ ) — the number of burles Mishka initially has.
输出格式
For each test case print the answer on it — the maximum number of burles Mishka can spend if he buys food optimally.
输入输出样例
输入样例 #1
6
1
10
19
9876
12345
1000000000
输出样例 #1
1
11
21
10973
13716
1111111111