AtCoder Beginner Contest 128
翻译中…
Problem Statement
翻译中…
We have $A$ apples and $P$ pieces of apple.
翻译中…
We can cut an apple into three pieces of apple, and make one apple pie by simmering two pieces of apple in a pan.
翻译中…
Find the maximum number of apple pies we can make with what we have now.
翻译中…
Constraints
翻译中…
- All values in input are integers.
$0 \leq A, P \leq 100$
翻译中…
Input
翻译中…
Input is given from Standard Input in the following format:
翻译中…
A P
翻译中…
Output
翻译中…
Print the maximum number of apple pies we can make with what we have.
翻译中…
样例
Input #1
1 3
Output #1
3
We can first make one apple pie by simmering two of the three pieces of apple. Then, we can make two more by simmering the remaining piece and three more pieces obtained by cutting the whole apple.
Input #2
0 1
Output #2
0
We cannot make an apple pie in this case, unfortunately.
Input #3
32 21
Output #3
58
题目信息
题面与样例版权归 AtCoder 及出题人所有;中文翻译由 AI 生成(CI 管线),如有出入请以原文为准。