问题2869--An easy problem

2869: An easy problem

[命题人 : ]
时间限制 : 1.000 sec  内存限制 : 64 MB

题目描述

Define f(n) for positive integers n by recurrence (1) f(1) = 1; (2) f(2*n) = f(n) (3) f(2n+1) = f(n)+f(n+1); The problem is given n, you should tell us whether it is an even number or an odd number.

输入

The input consists of multiple test cases. Each test case contains 1 integer n (1 <= n <= 1000,000,000)

输出

For each test case, if f(n) is an even number just output 0 otherwise 1 on a single line.

样例输入 Copy

1
3
11

样例输出 Copy

1
0
1

来源/分类