hoj3152-Dice 等比数列求和取模
http://acm.hit.edu.cn/hoj/problem/view?id=3152 Dice My Tags (Edit) Source : Time limit : 1 sec Memory limit : 128 M Submitted : 82, Accepted : 18 You have a dice with M faces, each face contains a distinct number. Your task is to calculate the expected number of tosses until a number facing up for consecutive N times. We assume when we tossing the dice, each face will occur randomly and uniformly. Input Each test cases contains only one line with two integers M, N. (1<=M, N<=100000000) Output For each test case, display a single line with the answer to the question above, the answer maybe very