Peter 的糖
该比赛已结束,您无法在比赛模式下递交该题目。您可以点击“在题库中打开”以普通模式查看和递交本题。
Background
Warm reminder: Smoking is harmful to your health; please do not attempt to smoke!
Problem Description
Peter has cigarettes. Each time he finishes a cigarette, he keeps the butt. () butts can be exchanged for one new cigarette. How many cigarettes can Peter smoke in total?
Unlike some brain teasers, Peter cannot borrow cigarette butts from another dimension and return them after smoking.
Input Format
Each test case consists of one line containing two integers ().
Output Format
For each test case, output one line containing one integer, the total number of cigarettes.
4 3
5
10 3
14
Hint
For of the testdata, .
Translated by ChatGPT 5