#68Easy
Power of two
Time: 1 s · Memory: 256 MB
- Working with numbers
Statement
You are given a natural number . If , print , otherwise print .
Input format
A single integer ().
Output format
A single integer — or .
Examples
Input
128
Output
7
Input
100
Output
-1
Note
While is even, divide it by and count the divisions. If is left at the end, is a power of two. , so the answer is .
Numbers up to need long long in C++ and int64 in Go.
