#abc215b. B - log2(N)

B - log2(N)

Score : 200200 points

问题描述

给定一个正整数 NN,找出满足 2kN2^k \le N 的最大整数 kk

以上为通义千问 qwen-max 翻译,仅供参考。

Problem Statement

Given a positive integer NN, find the maximum integer kk such that 2kN2^k \le N.

Constraints

  • NN is an integer satisfying 1N10181 \le N \le 10^{18}.

Input

Input is given from Standard Input in the following format:

NN

Output

Print the answer as an integer.

Sample Input 1

6

Sample Output 1

2
  • k=2k=2 satisfies 22=462^2=4 \le 6.
  • For every integer kk such that k3k \ge 3, 2k>62^k > 6 holds.

Therefore, the answer is k=2k=2.

Sample Input 2

1

Sample Output 2

0

Note that 20=12^0=1.

Sample Input 3

1000000000000000000

Sample Output 3

59

The input value may not fit into a 3232-bit integer.

update @ 2024/3/10 09:32:37