Skip to main content
Tuesday (24.11.2026) at 20:00: ALGOR Contest: Round #4 (Special Challenge) starts!

~/algor $ cat problems/bit-32-bitni-teskari

Reverse 32 bits

Easy 1000 ms 128 MB 25%
Share

A number $0 \le n \lt 2^{32}$ is given. Write it in binary with exactly $32$ bits (padding with zeros on the left), reverse the order of the bits and print the resulting number in decimal. For example, $6 = 00\ldots0110_{2}$ becomes $0110\ldots00_{2} = 1610612736$.

32 bits in cells; each bit is moved by an arrow to its mirrored position

Input

One integer $n$.

Output

One integer — the number with its bits reversed.

Note

$0 \le n \lt 2^{32}$

Examples

Input #1
6
Output #1
1610612736
Input #2
1
Output #2
2147483648

Sign in to submit a solution

Signing up is free and takes a minute.