logo AlgoBeat OnlineJudge
登录 注册

#215351. [SWERC 2019] Pseudo-Random Number Generator

内存限制:2048 MiB 时间限制:300 ms 标准输入输出
题目类型:VJudge(洛谷) 评测方式:VJudge
上传者: 匿名

题目描述

Donald loves nature. Being a programmer, Donald writes programs to simulate the growth of trees or to build realistic 3D landscapes. For this purpose, Donald needs a good pseudo-random number generator. He devises the following method to produce an infinite sequence of 40-bit unsigned integers (the lines in green are comments).

On the last line, denotes the quotient of the Euclidean division of by and denotes the remainder of the Euclidean division of by .

As a very first test to decide if this is indeed a good pseudo-random number generator, Donald wishes to count the number of even values produced by this sequence, in order to check whether this is close enough to 50%. Your help will be welcome.

输入格式

The input consists of a single line, containing an integer .

输出格式

The output should contain a single line with a single integer corresponding to the number of even values in the sequence .

样例

样例输入 1

3

样例输出 1

2

样例输入 2

500000000

样例输出 2

250065867

数据范围与提示

Limits

The input satisfies .