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

hide comments
jukerburg10: 2019-08-09 03:41:58

can anyone give me some corner cases? my code works correctly,,,still got WA

bagas_tr98: 2016-11-08 16:10:01

This should be a tutorial or basic. Please review the problem.

chrele: 2016-11-08 09:59:16

stfu jason. dont do something like that. you act like a faggot. respect other people will you?? many people are using this site for learing

jwilyandi19: 2016-11-07 11:20:58

Please move back this problem into tutorial.

Last edit: 2016-11-08 11:15:44

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