#include<bits/stdc++.h>
using namespace std;
long long fib[100]={0},i;
map<unsigned long long,long long>mp;
void fibonacci()
{
fib[0]=1;
fib[1]=1;
for(i=2;i<91;i++)
{
fib[i]=fib[i-2]+fib[i-1];
mp[fib[i]]=i;
}
}
main()
{
long long n;
fibonacci();
while(cin>>n)
{
long ar[100]={0},k=0;
cout<<n<<endl;
for(i=90;i>=0;i--)
{
if(n<=0)
break;
else if(fib[i]<=n)
{
ar[k++]=i;
n-=fib[i];
}
}
for(i=0;i<k;i++)
{
cout<<ar[i]<<" ";
}
cout<<endl;
for(i=0;i<k;i++)
{
cout<<fib[ar[i]]<<" ";
}
cout<<endl<<endl;
}
}
using namespace std;
long long fib[100]={0},i;
map<unsigned long long,long long>mp;
void fibonacci()
{
fib[0]=1;
fib[1]=1;
for(i=2;i<91;i++)
{
fib[i]=fib[i-2]+fib[i-1];
mp[fib[i]]=i;
}
}
main()
{
long long n;
fibonacci();
while(cin>>n)
{
long ar[100]={0},k=0;
cout<<n<<endl;
for(i=90;i>=0;i--)
{
if(n<=0)
break;
else if(fib[i]<=n)
{
ar[k++]=i;
n-=fib[i];
}
}
for(i=0;i<k;i++)
{
cout<<ar[i]<<" ";
}
cout<<endl;
for(i=0;i<k;i++)
{
cout<<fib[ar[i]]<<" ";
}
cout<<endl<<endl;
}
}
কোন মন্তব্য নেই:
একটি মন্তব্য পোস্ট করুন