a830: Dog Treats
Tags :
Accepted rate : 46人/46人 ( 100% ) [非即時]
評分方式:
Strictly

最近更新 : 2022-10-16 18:02

Content

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 x S + 2 x M + 3 x 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.

Input

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.

Output

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

Sample Input #1
3
1
0
Sample Output #1
sad
Sample Input #2
3
2
1
Sample Output #2
happy
測資資訊:
記憶體限制: 64 MB
公開 測資點#0 (6%): 1.0s , <1K
公開 測資點#1 (6%): 0.6666666666666666s , <1K
公開 測資點#2 (6%): 0.6666666666666666s , <1K
公開 測資點#3 (6%): 0.6666666666666666s , <1K
公開 測資點#4 (6%): 0.6666666666666666s , <1K
公開 測資點#5 (7%): 0.6666666666666666s , <1K
公開 測資點#6 (7%): 0.6666666666666666s , <1K
公開 測資點#7 (7%): 0.6666666666666666s , <1K
公開 測資點#8 (7%): 0.6666666666666666s , <1K
公開 測資點#9 (7%): 0.6666666666666666s , <1K
公開 測資點#10 (7%): 0.6666666666666666s , <1K
公開 測資點#11 (7%): 0.6666666666666666s , <1K
公開 測資點#12 (7%): 0.6666666666666666s , <1K
公開 測資點#13 (7%): 0.6666666666666666s , <1K
公開 測資點#14 (7%): 0.6666666666666666s , <1K
Hint :
Tags:
出處:
[管理者:
cplei@g.puic... (李振邦Lei Chan Pon...)
]


ID User Problem Subject Hit Post Date
611
1365536-1@g.... (J wang with a J)
a830
262 2023-02-24 10:33