in probability theory follow paradox call Benfords law know in list random number take real source number start digit 1 occur number start digit that s simple form lawhaving read Codeforces Hedgehog got intrigue statement wishes thoroughly explore he find follow similar problem interesting particular N random variable ith integer value segment LiRi number segment equiprobable it mean value ith quantity equal integer number give interval LiRi probability 1RiLi1The Hedgehog want know probability event digit K value equal in word let consider set fix value random variable leave digit MSD significant digit value then let count time digit 1 encounter encounter K cent n value set value call good you find probability set value give random variable good