Page 1 of 1

12372 - Packing for Holiday

Posted: Tue Nov 22, 2011 5:05 pm
by outsbook
if L >20 or W>20 or H>20 then bad
else good

12372 - Packing for Holiday

Posted: Sun Nov 17, 2013 2:01 pm
by DanDanR
Hey guys,
this is the easiest problem ever. As I understand it Mr. Bean has got a suitcase with 20x20x20 inches in size. So just check whether any of the dimensions of the gift box is >20 inxhes -> doesn't fit. Else -> does fit. Why do I keep getting wrong answer, am I confusing sth here? It does work perfectly with the given sample input. Can somebody help me out?
Thanks!

Ma code so far

Code: Select all

import java.util.*;

public class Main {

	public static void main(String[] args) {
		// TODO Auto-generated method stub

		int i, t;
		int h, l, w;
		final int maxDimension = 20;
		Scanner sc = new Scanner(System.in);
		
		t = sc.nextInt();
		for(i=0; i<t; i++) {
			l = sc.nextInt();
			w = sc.nextInt();
			h = sc.nextInt();
			
			if((h > maxDimension) || (l > maxDimension) || (w > maxDimension))
				System.out.println("Case " + i + ": bad");
			else
				System.out.println("Case " + i + ": good");
		}
		sc.close();
		return;
	}
}
:

Re: 12372 - Packing for holiday - easiest problem ever, no A

Posted: Mon Nov 18, 2013 6:41 pm
by AbdAllah Boda
u have forgotten to display a new line after each test case :D