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()) pos = 0 while (n & 1) == 1: pos += 1 n >>= 1 print(1 << pos)
Other models, same or similar prompt
Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.