Problem J1: Cupcake Party
Problem Description
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 Specification
The input consists of two lines.
• The first line contains an integer R ≥ 0, representing the number of regular boxes.
• The second line contains an integer S ≥ 0, 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 2 × 8 + 5 × 3 which equals 31. Since there are 28 students, there are 3 cupcakes left over.

文章包含一系列的数学和逻辑问题,如分配纸杯蛋糕以确定剩余数量,计算运动员的评分系统,解析竖琴调音指令,评估团队表现以及在有限空间内规划无树区域建泳池。这些问题都需要解决问题和策略规划的技巧来解决。
最低0.47元/天 解锁文章
1676

被折叠的 条评论
为什么被折叠?



