Canadian Coding Competition(CCC) 2022 Junior 题解

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

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.

Problem J2: Fergu

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值