Problem J1: Dog Treats
2020 · J1 · Original problem · DMOJProblem Description
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:
where is the number of small treats, is the number of medium treats and is the number of large treats.
If Barley’s happiness score is or greater then he is happy. Otherwise, he is sad. Determine whether Barley is happy or sad at the end of the day.
Input Specification
There are three lines of input. Each line contains a non-negative integer less than . The first line contains the number of small treats, , the second line contains the number of medium treats, , and the third line contains the number of large treats, , that Barley receives in a day.
Output Specification
If Barley’s happiness score is or greater, output happy. Otherwise, output sad.
Sample Input 1
3
1
0Output for Sample Input 1
sad
Explanation of Output for Sample Input 1
Barley’s happiness score is , so he will be sad.
Sample Input 2
3
2
1Output for Sample Input 2
happy
Explanation of Output for Sample Input 2
Barley’s happiness score is , so he will be happy.