#P8400. Cake Distribution Problem

    ID: 21577 Type: Default 1000ms 256MiB

Cake Distribution Problem

Cake Distribution Problem

In a kindergarten, there are $$28$$ children and therefore $$28$$ cakes are needed. There are two types of boxes available for storing cakes: a large box that can hold $$8$$ cakes, and a small box that can hold $$3$$ cakes. You are given two integers: n representing the number of large boxes and m representing the number of small boxes. All the cakes from these boxes are used to give each child one cake. Your task is to calculate the number of cakes remaining after every child has received one cake.

The total number of cakes is computed as:

$$\text{Total cakes} = 8 \times n + 3 \times m$$

The answer is:

$$\text{Remaining cakes} = (8 \times n + 3 \times m) - 28$$

inputFormat

The input consists of a single line containing two space-separated integers: n (the number of large boxes) and m (the number of small boxes).

outputFormat

Output a single integer representing the number of cakes remaining after each of the 28 children has received one cake.

sample

4 0
4