SP13591 FCTRHELL - Factor y Hell

Description

N/A

Input Format

The input begins with the number T of test cases in a single line. In each of the next T lines there are three integers : N, B, E.

Output Format

For each test case, print the number of zeros at the end of Factorial(N) written in base B×10^E.