Submit | All submissions | Best solutions | Back to list |
FLOG - Find Log |
You are given a base B and a number N. You have to find X such that LogB(N) = X.
Input
The first line of input consists of the number of test cases T <= 100. The following T lines contain the two integers base B and number N. 0 <= B, N <= 1018.
Output
Print the test case number then X with 5 decimal places (see the example for the exact format). If X doesn't exist, print "Math Error!". Print a new line for each test case.
Example
Input: 3 2 8 4 16 9 27 Output: Case 1: 3.00000 Case 2: 2.00000 Case 3: 1.50000
Added by: | RaYHan |
Date: | 2016-06-26 |
Time limit: | 0.5s-1s |
Source limit: | 50000B |
Memory limit: | 1536MB |
Cluster: | Cube (Intel G860) |
Languages: | All except: ASM64 GOSU |
Resource: | Own Problem |
hide comments