Charting Exponential Growth on a Log Scale
Kestrel Media charts weekly sign-ups for a product that is spreading by word of mouth. On an ordinary vertical axis the early weeks are flattened against the bottom and only the last few weeks are readable, so the axis is scaled logarithmically — an axis on which equal multiplications become equal steps, and steady multiplying growth appears as a straight line. The note beside the chart states whether the growth really is steady. It is counted as steady when every week's reading is the same multiple of the week before it as the very first pair was, allowing each of those multiples to differ from the first by less than 0.01. A gap of exactly 0.01 is not close enough.
Task: Print whether the growth is steady.
Input
The first line holds an integer n, the number of weekly readings. Each of the next n lines holds one reading, in week order. Every reading is positive.
Output
One line holding True if every multiple is within 0.01 of the first one, and False otherwise, written exactly as Python writes a boolean.
Example:
Input:
4
10
20
40
80
Output:
True
Sign in to solve this problem
Reading problems is free for everyone — solving them (Run, Submit, and tracking what you've solved) needs an account.
Sign in