#P1421. Maximum Pens Purchase Problem
Maximum Pens Purchase Problem
Maximum Pens Purchase Problem
A class teacher has given Xiaoyu the task of buying as many signing pens as possible from a stationery shop. It is known that the price of a single pen is 1 yuan and 9 jiao (i.e., \(1\,\text{yuan}\,9\,\text{jiao}\)). Xiaoyu is given an amount of money represented as a yuan and b jiao (i.e., \(a\,\text{yuan}\,b\,\text{jiao}\)). Given that one yuan is equivalent to 10 jiao, calculate the maximum number of pens that can be bought.
You can use the formula:
[ \text{Number of pens} = \left\lfloor \frac{10a + b}{19} \right\rfloor, ]
where \(\lfloor x \rfloor\) denotes the floor function.
inputFormat
The input consists of two space-separated integers: a
and b
, representing the amount of money Xiaoyu has (in yuan and jiao respectively).
outputFormat
Output a single integer, which is the maximum number of pens that can be bought.
sample
2 0
1