## CCC '11 J2 - Who Has Seen The Wind

View as PDF

Points: 5
Time limit: 2.0s
Memory limit: 64M

Problem type
Allowed languages
Ada, Assembly, Awk, Brain****, C, C#, C++, COBOL, CommonLisp, D, Dart, F#, Forth, Fortran, Go, Groovy, Haskell, Intercal, Java, JS, Kotlin, Lisp, Lua, Nim, ObjC, OCaml, Octave, Pascal, Perl, PHP, Pike, Prolog, Python, Racket, Ruby, Rust, Scala, Scheme, Sed, Swift, TCL, Text, Turing, VB, Zig
##### 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 (in metres above the ground) at hour after launching her balloon is:

where is an integer value representing the humidity as a value between 0 and 100 inclusive.

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, , that Margaret is willing to wait. You can assume that the weather balloon touches ground when .

In order to do this, your program should use the formula to calculate the altitude when , , and so on, until the balloon touches the ground or is reached.

#### Input Specification

The input is two non-negative integers: , the humidity factor, followed by , the maximum number of hours Margaret will wait for the weather balloon to return to ground. You can assume and .

#### Output Specification

The output will be one of the following possibilities:

• The balloon does not touch ground in the given time.
• The balloon first touches ground at hour: T

where is a positive integer value representing the earliest hour when the balloon has altitude less than or equal to zero.

#### 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.

• commented on Sept. 14, 2020, 1:24 p.m.

Remember to start your loop at 1 or else it will just substitute in 0 into the formula and always output 0.

• commented on Feb. 4, 2020, 6:28 p.m.

Bruh I didn't know that you had to output the number of hours on a separate line, fml.

• commented on April 23, 2019, 5:21 p.m.

Is the output system?

• commented on April 24, 2019, 12:58 p.m.

yes

• commented on Aug. 21, 2018, 9:48 p.m.

Hello :D

• commented on Dec. 24, 2017, 12:10 a.m.

This comment is hidden due to too much negative feedback. Click here to view it.

• commented on Dec. 24, 2017, 12:10 a.m.

No.

• commented on Dec. 24, 2017, 12:14 a.m. edit 2

Also, it doesn't give any cash prizes

• commented on Jan. 6, 2015, 5:05 p.m.

This comment is hidden due to too much negative feedback. Click here to view it.

• commented on Jan. 6, 2015, 5:05 p.m.

STOP SOLVING I NEED TO BEAT YOU TT_TT

• commented on Jan. 6, 2015, 5:06 p.m.

This comment is hidden due to too much negative feedback. Click here to view it.

• commented on June 1, 2016, 12:56 p.m.

This comment is hidden due to too much negative feedback. Click here to view it.

• commented on June 2, 2016, 4:39 p.m. edited

This comment is hidden due to too much negative feedback. Click here to view it.

• commented on June 1, 2016, 4:11 p.m.

Yes.

• commented on June 2, 2016, 11:53 a.m.

This comment is hidden due to too much negative feedback. Click here to view it.