1. 程式人生 > >【CodeForces - 199A】【 Hexadecimal's theorem 】

【CodeForces - 199A】【 Hexadecimal's theorem 】

題目:

Recently, a chaotic virus Hexadecimal advanced a new theorem which will shake the Universe. She thinks that each Fibonacci number can be represented as sum of three not necessary different Fibonacci numbers.

Let's remember how Fibonacci numbers can be calculated. F0 = 0, F1 = 1, and all the next numbers are F

i = Fi - 2 + Fi - 1.

So, Fibonacci numbers make a sequence of numbers: 0, 1, 1, 2, 3, 5, 8, 13, ...

If you haven't run away from the PC in fear, you have to help the virus. Your task is to divide given Fibonacci number n by three not necessary different Fibonacci numbers or say that it is impossible.

Input

The input contains of a single integer n (0 ≤ n < 109) — the number that should be represented by the rules described above. It is guaranteed that n is a Fibonacci number.

Output

Output three required numbers: ab and c. If there is no answer for the test you have to print "I'm too stupid to solve this problem" without the quotes.

If there are multiple answers, print any of them.

Examples

Input

3

Output

1 1 1

Input

13

Output

2 3 8

解題報告:水題,給定咱們一個斐波那契數,問它是否能夠拆分成三個斐波那契數的和,我的做法是進行特判,當n是小於等於2

的時候只能是0 0 n 大於二的時候是可以將前一項繼續拆分為兩個斐波那契數的和,所以公式就是num[i]=num[i-2]+num[i-2]+num[i-3];雖然和給出的樣例不是很一致,但是卻符合條件,所以能A

ac程式碼:

#include<iostream>
#include<cstdio>
#include<cstdlib>
#include<algorithm>
#include<queue>
#include<cmath>
#include<cstring>
using namespace std;

const int maxn=1e5+10000;
int num[maxn];
void db()
{
	num[0]=num[1]=1;
	for(int i=2;i<=maxn;i++)
	{
		num[i]=num[i-1]+num[i-2];
		if(num[i]>1e9)
			break;
	}
}
int main()
{
	int n;
	db();
	while(scanf("%d",&n)!=EOF)
	{
		if(n<=2)
		{
			printf("0 0 %d\n",n);
		}
		else
		{
			int i;
			for(i=1;i<n;i++)
				if(num[i]==n)
					break;
			printf("%d %d %d\n",num[i-3],num[i-2],num[i-2]);
		}
	}
}