Canadian Computing Competition: 2011 Stage 1, Junior #2
Margaret has looked at the wind floating over the prairies for a long
time. After these observations, she has created a formula that will
describe the altitude of a weather balloon launched from her house. In
particular, her equation predicts the altitude
where
Margaret is curious at what the earliest hour is (if any) that her
weather balloon will hit the ground after launch, so long as it is no
more than the maximum time,
In order to do this, your program should use the formula to calculate
the altitude when
Input Specification
The input is two non-negative integers:
Output Specification
If the balloon does not touch the ground in the given time, then output
The balloon does not touch ground in the given time.
Otherwise, output
The balloon first touches ground at hour:
T
where
Sample Input 1
30
10
Output for Sample Input 1
The balloon first touches ground at hour:
6
Sample Input 2
70
10
Output for Sample Input 2
The balloon does not touch ground in the given time.
Comments
This question may seem daunting, but it can be solved with a for loop and boollean variable. Good Luck!!!
this is so sigma
If
gets bigger, shouldn't 
get bigger as well?
The term with the highest power in this polynomial is
, which has a negative coefficient. Therefore, 
will eventually decrease and become negative if 
is sufficiently large. The value of 
does not affect this trend.
Since the original data were weak, three additional test cases were added, and all submissions were rejudged.