2002 LSU Computer Science High School Programming Contest

Sponsored by Microsoft

Novice - Problem 4

 MAIN
  Home
  Schedule
  Registration
  Rules
  About
  Language
  Prizes
  
 RESULTS
  Problem Set
  Judge Data
  Solutions
  
 LINKS
  LSU
  Computer Science
  Contest Index
  HS 2001
  HS 2000
  ACM Intl PC
  PC2
 

Umbrella Bashing

As you've perhaps already noticed, Sam Slacker is a rather eccentric fellow. One of his more peculiar habits is that of the 'lucky umbrella'. On the day of any job interview, he can be found carrying around an umbrella, usually in pristine shape. However, when interviews don't go his way, he has been known to, ah, vent his frustration with repeated rapid contact between the umbrella and a hard object.

Since Sam isn't too keen on buying new umbrellas--to him, money not spent on food, video games, or bandwidth for his website is money wasted--he'd like to be able to figure out if he can vent his frustration and still have a usable umbrella at the end.

Description:

Sam is aware of how much damage that the umbrella can take when slammed against a hard object--heretofore referred to as its hit points or h, and after any given interview he knows just how hard he'll want to hit it against said hard object and how many times he'll have to do it before he calms down. The umbrellas follow a simple rule for determining the damage done to them: If a strike brings it to zero hit points or lower, it breaks; else, the hit only does half damage, rounded up. In other words, if a particular strike does 10 points of damage, but the umbrella still has 50 hit points left, the umbrella only takes 5 points of damage, leaving it with 45 hit points.

Any numerical data item n in this problem satisfies the statement 1 <= n <= 30000.

Input:

The first piece of data in the file is the number of frustrating interviews that Sam has gone on, represented by a non-negative integer. Each interview has three lines of data, each a non-negative integer on a separate line. The first piece of data is h, the number of hit points of the 'lucky umbrella' for that interview; the second piece of data is the number of points of damage that each strike can potentially cause; the third piece of data is the number of strikes that it will take before Sam calms down.

Output:

For each interview, print

	Interview x: The umbrella will remain intact.
if the umbrella can survive the beating that it will take after that interview, or print
	Interview x: The umbrella will break.
if the umbrella will not survive the smashing. x is the interview number, starting from 1.

Sample Input:

3		Number of frustrating interviews
90		Hit points of the first umbrella
10		Points of damage per hit for the first umbrella
5		Number of strikes for the first interview
1		Hit points of the second umbrella
7		Points of damage per hit for the second umbrella
3		Number of strikes for the second umbrella
10		Hit points of the third umbrella
5		Points of damage per hit for the third umbrella
3		Number of strikes for the third umbrella

Sample Output:

Interview 1: The umbrella will remain intact.
Interview 2: The umbrella will break.
Interview 3: The umbrella will break.



Return to Problem Index



 

The statements and opinions included in these pages are those of 2002 LSU Computer Science High School Programming Contest only. Any statements and opinions included in these pages are not those of Louisiana State University or the LSU Board of Supervisors.
Site maintained by: Isaac Traxler
© 2000,2001,2002    Last modified: Saturday, 26 February, 2005 14:40:39