Logo
(追記) (追記ここまで)

24568번 - Cupcake Party 다국어

시간 제한메모리 제한제출정답맞힌 사람정답 비율
1 초 1024 MB80685559534769.011%

문제

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.

입력

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 the number of cupcakes that are left over.

제한

예제 입력 1

2
5

예제 출력 1

3

The total number of cupcakes is 2 × 8 + 5 × 3 which equals 31. Since there are 28 students, there are 3 cupcakes left over.

예제 입력 2

2
4

예제 출력 2

0

The total number of cupcakes is 2 × 8 + 4 × 3 which equals 28. Since there are 28 students, there are no cupcakes left over.

힌트

출처

Olympiad > Canadian Computing Competition & Olympiad > 2022 > CCC 2022 Junior Division 1번

(追記) (追記ここまで)

출처

대학교 대회

  • 사업자 등록 번호: 541-88-00682
  • 대표자명: 최백준
  • 주소: 서울시 서초구 서초대로74길 29 서초파라곤 412호
  • 전화번호: 02-521-0487 (이메일로 연락 주세요)
  • 이메일: contacts@startlink.io
  • 통신판매신고번호: 제 2017-서울서초-2193 호

AltStyle によって変換されたページ (->オリジナル) /