## CCC '22 J1 - Cupcake Party

View as PDF

Points: 3
Time limit: 1.0s
Memory limit: 1G

Problem type
##### Canadian Computing Competition: 2022 Stage 1, Junior #1

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

#### Input Specification

The input consists of two lines.

• The first line contains an integer , representing the number of regular boxes.
• The second line contains an integer , representing the number of small boxes.

#### Output Specification

Output the number of cupcakes that are left over.

#### Sample Input 1

2
5

#### Output for Sample Input 1

3

#### Explanation of Output for Sample Input 1

The total number of cupcakes is which equals . Since there are students, there are cupcakes left over.

#### Sample Input 2

2
4

#### Output for Sample Input 2

0

#### Explanation of Output for Sample Input 2

The total number of cupcakes is which equals . Since there are students, there are no cupcakes left over.

• commented on March 22, 2024, 8:51 a.m.

it is very hard

• commented on March 21, 2024, 1:42 p.m.

me too guys😁😎

• commented on Feb. 19, 2024, 8:10 p.m.

i remember at the start of the year when I didn't know any coding I couldn't even do this question lol

• commented on Feb. 21, 2024, 2:34 p.m.

wow me too