12372 - Packing for Holiday

Mr. Bean used to have a lot ofproblems packing his suitcase for holiday. So he is very careful for thiscoming holiday. He is more serious this time because he is going to meet his fiancéeand he is also keeping frequent communication with you as a programmer friendto have suggestions. He gets confused when he buys a gift box for his fiancéebecause he can't decide whether it will fit in his suitcase or not. Sometimes abox doesn't fit in his suitcase in one orientation and after rotating the boxto a different orientation it fits in the suitcase. This type of behavior makeshim puzzled.

 

So to make things much simpler hebought another suitcase having same length, width and height, which is 20inches. This measurement is taken from inside of the box. So a box which haslength, width and height of 20 inches will just fit in this suitcase. He alsodecided to buy only rectangular shaped boxes and keep a measuring tape in hispocket. Whenever he chooses one gift box, which must be rectangular shaped, hequickly measures the length, width and height of the box. But still he can'tdecide whether it will fit in his suitcase or not. Now he needs your help.Please write a program for him which calculates whether a rectangular box fitsin his suitcase or not provided the length, width and height of the box. Notethat, sides of the box must be parallel to the sides of the suitcase.

 

Input

Input starts with an integer T (T ≤ 100), which indicatesthe number of test cases.

 

Each of the next T line containsthree integers L, W andH (1 ≤ L, W, H ≤ 50) denoting the length,width and height of a rectangular shaped box.

 

Output

For each test case, output asingle line. If the box fits in the suitcase in any orientation having thesides of the box is parallel to the sides of the suitcase, this line will be“Case #: good”, otherwise it willbe “Case #: bad”. In youroutput# will be replacedby the case number.

 

Please see the sample input and sample output for exactformat.

 

SampleInput                               Output for Sample Input

2

20 20 20

1 2 21

                                                    Case 1: good

                                                    Case 2: bad

#include<stdio.h>
int main()
{
	int t,l,w,h,count=1;
	scanf("%d",&t);
	while(t--)
	{
		scanf("%d%d%d",&l,&w,&h);
		printf("Case %d: ",count++);
		if(l<=20&&w<=20&&h<=20) puts("good");
		else puts("bad");
	}
	return 0;
}

  • 1
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值