#K59827. Total Items with 'Buy n, Get x Free' Offer

    ID: 30951 Type: Default 1000ms 256MiB

Total Items with 'Buy n, Get x Free' Offer

Total Items with 'Buy n, Get x Free' Offer

In this problem, you are given an offer in a store: for every n items purchased, the store gives you x additional items for free. Your task is to calculate the total number of items a customer receives.

The total number of items is given by the formula:

$$ T = n + n \times x $$

You will be given several datasets. Each dataset consists of two integers n and x on a single line. The input terminates with a line containing "0 0", which should not be processed. For each dataset, output the computed total.

inputFormat

The input consists of multiple lines. Each line contains two space-separated integers n and x, where n represents the number of items to be bought and x represents the number of free items given for each n items purchased. The sequence of inputs ends with a line containing "0 0", which should not be processed.

outputFormat

For each valid dataset, output a line containing the total number of items the customer receives.

## sample
2 3
5 10
7 2
0 0
8

55 21

</p>