Slimes

AtCoder
IDabc248_b
Time2000ms
Memory256MB
Difficulty
There are $A$ slimes. Each time Snuke shouts, the slimes multiply by $K$ times. In order to have $B$ or more slimes, at least how many times does Snuke need to shout? ## Constraints * $1 \leq A \leq B \leq 10^9$ * $2 \leq K \leq 10^9$ * All values in input are integers. ## Input Input is given from Standard Input in the following format: $A$ $B$ $K$ [samples]
Samples
Input #1
1 4 2
Output #1
2

We start with one slime. After Snuke's first shout, we have two slimes; after his second shout, we have four slimes. Thus, he needs to shout at least twice to have four or more slimes.
Input #2
7 7 10
Output #2
0

We have seven slimes already at the start.
Input #3
31 415926 5
Output #3
6
API Response (JSON)
{
  "problem": {
    "name": "Slimes",
    "description": {
      "content": "There are $A$ slimes. Each time Snuke shouts, the slimes multiply by $K$ times. In order to have $B$ or more slimes, at least how many times does Snuke need to shout?",
      "description_type": "Markdown"
    },
    "platform": "AtCoder",
    "limit": {
      "time_limit": 2000,
      "memory_limit": 262144
    },
    "difficulty": "None",
    "is_remote": true,
    "is_sync": true,
    "sync_url": null,
    "sign": "abc248_b"
  },
  "statements": [
    {
      "statement_type": "Markdown",
      "content": "There are $A$ slimes.\nEach time Snuke shouts, the slimes multiply by $K$ times.\nIn order to have $B$ or more slimes, at least how many times does Snuke need to shout?\n\n## Constraints\n\n*   $1 \\leq A \\l...",
      "is_translate": false,
      "language": "English"
    }
  ]
}
Full JSON Raw Segments