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

19602번 - Dog Treats 다국어

시간 제한메모리 제한제출정답맞힌 사람정답 비율
2 초 512 MB36283067292484.460%

문제

Barley the dog loves treats. At the end of the day he is either happy or sad depending on the number and size of treats he receives throughout the day. The treats come in three sizes: small, medium, and large. His happiness score can be measured using the following formula:

1 × S + 2 × M + 3 × L

where S is the number of small treats, M is the number of medium treats and L is the number of large treats.

If Barley’s happiness score is 10 or greater then he is happy. Otherwise, he is sad. Determine whether Barley is happy or sad at the end of the day.

입력

There are three lines of input. Each line contains a non-negative integer less than 10. The first line contains the number of small treats, S, the second line contains the number of medium treats, M, and the third line contains the number of large treats, L, that Barley receives in a day.

출력

If Barley’s happiness score is 10 or greater, output happy. Otherwise, output sad.

제한

예제 입력 1

3
1
0

예제 출력 1

sad

Barley’s happiness score is 1 × 3 + 2 × 1 + 3 × 0 = 5, so he will be sad.

예제 입력 2

3
2
1

예제 출력 2

happy

Barley’s happiness score is 1 × 3 + 2 × 2 + 3 × 1 = 10, so he will be happy.

힌트

출처

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

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

출처

대학교 대회

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

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