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: Accepted)

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

class MainClass
{

    public static void Main(string[] args)
    {
        var _ = LnLngs();
        var N = _[0];
        var K = _[1];
        var result = 0;
        while (Pow(K, result) <= N)
        {
            result++;
        }
        print(result);
    }

    public static void print(object obj) { Console.WriteLine(obj); }
    public static long Gcd(long a, long b) { if (a > b) { var r = a % b; if (r == 0) return b; else return Gcd(b, r); } else { var r = b % a; if (r == 0) return a; else return Gcd(a, r); } }
    public static int Gcd(int a, int b) { if (a > b) { var r = a % b; if (r == 0) return b; else return Gcd(b, r); } else { var r = b % a; if (r == 0) return a; else return Gcd(a, r); } }
    public static int[] LnInts() { var vs = Console.ReadLine().Trim().Split(new[] { ' ' }, StringSplitOptions.RemoveEmptyEntries); var ins = new int[vs.Length]; for (int i = 0; i < vs.Length; i++) ins[i] = int.Parse(vs[i]); return ins; }
    public static int LnInt() { var vs = Console.ReadLine().Trim(); return int.Parse(vs); }
    public static long[] LnLngs() { var vs = Console.ReadLine().Trim().Split(new[] { ' ' }, StringSplitOptions.RemoveEmptyEntries); var ins = new long[vs.Length]; for (int i = 0; i < vs.Length; i++) ins[i] = long.Parse(vs[i]); return ins; }
    public static long LnLng() { var vs = Console.ReadLine().Trim(); return long.Parse(vs); }
    public static string[] LnStrs() { var vs = Console.ReadLine().Trim().Split(new[] { ' ' }, StringSplitOptions.RemoveEmptyEntries); return vs; }
    public static string LnStr() { var vs = Console.ReadLine().Trim(); return vs; }
public static List<T[]> AllPermutation<T>(params T[] array) where T : IComparable{var a = new List<T>(array).ToArray();var res = new List<T[]>();res.Add(new List<T>(a).ToArray());var n = a.Length;var next = true;while (next){next = false;int i;for (i = n - 2; i >= 0; i--){if (a[i].CompareTo(a[i + 1]) < 0) break;}if (i < 0) break;var j = n;do{j--;} while (a[i].CompareTo(a[j]) > 0);if (a[i].CompareTo(a[j]) < 0){var tmp = a[i];a[i] = a[j];a[j] = tmp;Array.Reverse(a, i + 1, n - i - 1);res.Add(new List<T>(a).ToArray());next = true;}}return res;}}