CF690A2.Collective Mindsets (medium)

普及/提高-

通过率:0%

AC君温馨提醒

该题目为【codeforces】题库的题目,您提交的代码将被提交至codeforces进行远程评测,并由ACGO抓取测评结果后进行展示。由于远程测评的测评机由其他平台提供,我们无法保证该服务的稳定性,若提交后无反应,请等待一段时间后再进行重试。

题目描述

Way to go! Heidi now knows how many brains there must be for her to get one. But throwing herself in the midst of a clutch of hungry zombies is quite a risky endeavor. Hence Heidi wonders: what is the smallest number of brains that must be in the chest for her to get out at all (possibly empty-handed, but alive)?

The brain dinner night will evolve just as in the previous subtask: the same crowd is present, the N1N-1 zombies have the exact same mindset as before and Heidi is to make the first proposal, which must be accepted by at least half of the attendees for her to survive.

输入格式

The only line of input contains one integer: NN , the number of attendees ( 1<=N<=109)1<=N<=10^{9}) .

输出格式

Output one integer: the smallest number of brains in the chest which allows Heidi to merely survive.

输入输出样例

  • 输入#1

    1
    

    输出#1

    0
    
  • 输入#2

    3
    

    输出#2

    1
    
  • 输入#3

    99
    

    输出#3

    49
    
首页