ONLY ONE NUMBER LEFT
Easy
Execution time limit is 1 second
Runtime memory usage limit is 64 megabytes
Petryk Pyatochkin has decided to remove all odd numbers and numbers at odd positions from a sequence of natural numbers ranging from 1 to N. He starts by eliminating all odd numbers, followed by numbers at odd positions, and continues this process until only one number is left. What is this final number?
Input
A natural number N (N=2…2^63
).
Output
The last remaining number.
Examples
Input #1
Answer #1
Submissions 2K
Acceptance rate 22%