Problem:
Score : 200 points

Problem Statement

Given is an integer N. Find the number of digits that N has in base K.

Notes

For information on base-K representation, see Positional notation - Wikipedia.

Constraints

All values in input are integers.

1 \leq N \leq 10^9

2 \leq K \leq 10

Input

Input is given from Standard Input in the following format:

N K

Output

Print the number of digits that N has in base K.

Sample Input 1

11 2

Sample Output 1

4

In binary, 11 is represented as 1011.

Sample Input 2

1010101 10

Sample Output 2

7

Sample Input 3

314159265 3

Sample Output 3

18

Solution in C# (Mono 4.6.2.0) (judge verdict: Wrong Answer)

using System;
using System.Text;
using System.Collections.Generic;
using static System.Math;
using System.Linq;
using static System.Array;

namespace ConsoleApp2
{
    class Program
    {
        static string[] S;
        static long H;
        static long W;
        static long K;
        static void Main(string[] args)
        {
            var HWK = Console.ReadLine().Split(' ').Select(x => int.Parse(x)).ToArray();
            H = HWK[0];
            W = HWK[1];
            var ans = 0;
            while(H == 0){
              H = (H/W);
              ans++;
            }
          
            Console.WriteLine(ans); 
        }

        static long Cul(int i)
        {
            if (i == 6)
            {
                var r = 8;
            }
            var used = new bool[W];
            var tmp = Convert.ToString(i, 2).Reverse<char>().ToArray();
            var top = 0;
            var end = 0;
            var ans = 0;
            for (int j = 0; j < tmp.Length; j++)
            {
                if(tmp[j] == '1')
                {
                    ans++;
                    var sum = 0;
                    for (int k = 0; k < W; k++)
                    {
                        if (used[k])
                        {
                            sum = 0;
                        }
                        var tmp2 = 0;
                        for (int l = top;  l <= end;  l++)
                        {
                            if (S[l][k] == '1')
                            {
                                tmp2++;
                            }
                                
                        }

                        if (sum + tmp2 > K)
                        {
                            if (tmp2 > K) return H * W;
                            sum = tmp2;
                            if (!used[k])
                            {
                                ans++;
                                used[k] = true;
                            }
                            
                        }
                        else
                        {
                            sum += tmp2;
                        }
                    }
                    top = end + 1;
                }
                end++;
            }

            var sum2 = 0;
            end = (int)H - 1;
            for (int k = 0; k < W; k++)
            {
                if (used[k])
                {
                    sum2 = 0;
                }
                var tmp2 = 0;
                for (int l = top; l <= end; l++)
                {
                    if (S[l][k] == '1') tmp2++;
                }

                if (sum2 + tmp2 > K)
                {
                    if (tmp2 > K) return H * W;
                    sum2 = tmp2;
                    if (!used[k])
                    {
                        ans++;
                        used[k] = true;
                    }
                }
                else
                {
                    sum2 += tmp2;
                }
            }
            return ans;
        }

    }
}