Logarithms P90133


Statement
 

pdf   zip

thehtml

Write a program that computes logarithms in several bases.

Input

Input consists of a sequence of pairs of natural numbers b and n, such that b≥ 2 and n≥ 1.

Output

For every pair, print ⌊ logb n ⌋.

Public test cases
  • Input

    2 8
    2 9
    2 15
    2 16
    3 6
    10 1
    10 10
    10 100
    10 1000
    

    Output

    3
    3
    3
    4
    1
    0
    1
    2
    3
    
  • Information
    Author
    Salvador Roura
    Language
    English
    Translator
    Carlos Molina
    Original language
    Catalan
    Other languages
    Catalan
    Official solutions
    C++ Java Pascal Python
    User solutions
    C C++ Haskell Java Python