Problem I
High Noon Language Showdown
In the Wild West, two keyboardslingers face off in a high-stakes programming duel. Each must select a programming language and an algorithm to solve a problem that’s tough as tumbleweed, to determine their fate. You’ve designed a problem for the two rivals, and want to make sure that algorithmic efficiency matters more than choosing a fast language. Specifically, suppose that one keyboardslinger opts for a fast programming language but a slow algorithm, performing $n^2$ steps for an input of size $n$; the other one, meanwhile, chooses a slower language (i.e., one whose steps are a constant factor slower) but a faster algorithm, executing $n \lceil \log _2 (n+1)\rceil $ steps for an input of size $n$. The challenge is to ascertain if, given an I/O limit $N$, the faster algorithm in the slower language can outpace the slower algorithm in the faster language.
Input
The input comprises a single line with two integers, $N$ and $K$ $(1 \leq N \leq 10\, 000, 1 \leq K \leq 1000)$. Here:
-
$N$ represents the I/O limit for $n$.
-
$K$ denotes the constant factor by which the fast algorithm must surpass the slow algorithm.
Output
If it’s possible to find an $n$ such that $1 \leq n \leq N$ and the slow algorithm takes at least $K$ times as many steps as the fast algorithm, output “Good to go!” Otherwise, output “Tweak the bounds!”
Sample Input 1 | Sample Output 1 |
---|---|
10 2 |
Good to go! |
Sample Input 2 | Sample Output 2 |
---|---|
5 2 |
Tweak the bounds! |
Sample Input 3 | Sample Output 3 |
---|---|
35 6 |
Good to go! |