You are given three integers a, b, and n. Your task is to determine the number of positive integers x∈[1,109] such that axx is an n-digit number of base b.
Input format
The input contains many test cases. Each test case is represented in a new line. Every line contains three integers, a, n, and b (1≤a,n≤109,2≤b≤10)
Note: There are at most 1000 test cases.
Output format
For each test case, print the answer.
The input contains 2 testcases.
x=3 meets the first condition
x=1 and 2 meet the second one.