Problem list
Log in
#r03580 · CCC 2022 Junior

Cupcake Party

Bronze V 2.0 s 256 MB

A regular box of cupcakes holds 8 cupcakes, while a small box holds 3 cupcakes. There are 28 students in a class and a total of at least 28 cupcakes. Your job is to determine how many cupcakes will be left over if each student gets one cupcake.

Input

The input consists of two lines.

  • The first line contains an integer $R\geq 0$, representing the number of regular boxes.

  • The second line contains an integer $S \geq 0$, representing the number of small boxes.

Output

Output the number of cupcakes that are left over.

Constraints

$R\geq 0$ $S \geq 0$

Example 1

Input
2
5
Output
3

The total number of cupcakes is $2\times8 + 5\times3$ which equals 31. Since there are 28 students, there are 3 cupcakes left over.

Example 2

Input
2
4
Output
0

The total number of cupcakes is $2\times8 + 4\times3$ which equals 28. Since there are 28 students, there are no cupcakes left over.

Source
CCC 2022 Junior
Appears in
Not part of a ladder, contest or set yet.
Accepted 0 Submissions 0 Acceptance 0% Solvers 0

Discussion

Threads about this problem. Spoilers are collapsed; wrap hints in ||double bars||.

No discussion yet. Start a thread if something here needs explaining.

Recent submissions Open with filters
Code