暑假第一周 T

来源:互联网 发布:.net cms 源码 编辑:程序博客网 时间:2024/06/05 03:13

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 = 0F1 = 1, and all the next numbers are Fi = Fi - 2 + Fi - 1.

So, Fibonacci numbers make a sequence of numbers: 011235813, ...

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.

Example
Input
3
Output
1 1 1
Input
13
Output
2 3 8

//T
#include <iostream>
using namespace std;
int main()
{
    int i;
    int a[100100];
    a[0]=0,a[1]=1;
    for(i=2;i<100100;i++){
        a[i]=a[i-1]+a[i-2];
    }
    int n;
    while(cin>>n){
    for(i=0;i<100100;i++){
        if(a[i]==n){
                if(n==0){
                    cout<<a[0]<<" "<<a[0]<<" "<<a[0]<<endl;
                    break;
                }else if(n==1){
                    cout<<a[0]<<" "<<a[0]<<" "<<a[1]<<endl;
                    break;
                }else if(n==2){
                    cout<<a[0]<<" "<<a[1]<<" "<<a[1]<<endl;
                    break;
                }else if(n==3){
                    cout<<a[1]<<" "<<a[1]<<" "<<a[1]<<endl;
                    break;
                }
                else if(n>3){
                cout<<a[i-4]<<" "<<a[i-3]<<" "<<a[i-1]<<endl;
                break;
                }
        }
    }
    }
    return 0;
}

原创粉丝点击