Problem Given the integer n, output the smallest m such that nCm (the number of…
- User
Problem
Given the integer n, output the smallest m such that nCm (the number of combinations that choose m out of n different ones) is even.
Constraints
The input satisfies the following conditions.
- 1 ≤ n ≤ 1018
Input
The input is given in the following format.
n
Output
Output the minimum m such that nCm is an even number on one line.
Examples
Input
2
Output
1
Input
111
Output
16
Input
3
Output
4
Assistant
n = int(input()) for pos in range(64): if (n & (1 << pos)) == 0: print(1 << pos) exit() print(1 << 64)
Other models, same or similar prompt
Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.