A . Add More Zero (log 求解 )

There is a youngster known for amateur propositions concerning several mathematical hard problems.

Today he is going to prepare a thought-provoking problem on a specific type of supercomputer which has the ability to support calculating operations for integers between 00 and (2m1)(2m−1) (inclusive).

As a young man born with ten fingers, he loves the powers of 1010 so much, which results in his eccentricity that he always ranges integers he would like to use from 11 to 10k10k (inclusive).

For ease of processing, all integers he would probably use in this interesting problem ought to be as computable as this supercomputer could.

Given the positive integer mm, your task is to determine maximum possible integer kkthat is suitable for the specific supercomputer.

Input

The input contains multiple (about 105105) test cases.

Each test case in only one line contains an integer mm (1m1051≤m≤105).

Output

For each test case, output "Case #x: y" in one line (without quotes), where xxindicates the case number starting from 11, and yy denotes the answer to the corresponding case.

Example

Input
1
64
Output
Case #1: 0
Case #2: 19


#include <iostream>
#include <algorithm>
#include <cstdio>
#include <string>
#include <cstring>
#include <cstdlib>
#include <map>
#include <vector>
#include <set>
#include <queue>
#include <stack>
#include <cmath>
typedef long long lli;
using namespace std;
const int  mxn = 1e9;
#define TLE std::ios::sync_with_stdio(false);   cin.tie(NULL);   cout.tie(NULL);   cout.precision(10);
multiset<int> v;
multiset<int> :: iterator it ;
int a[100+5];

int main()
{
    TLE;
    int n,cnt=1;
    while(cin>>n)
    {
        cout<<"Case #"<<cnt++<<": ";
        cout<< (int)(n*(log10(2) ) )<<endl;
    }

}

 

posted @ 2019-10-04 22:21  __MEET  阅读(153)  评论(0编辑  收藏  举报