#include #include #include using namespace std; #define ll long long #define MAXN 1000000000000000000 ll num1[100000],num2[100000]; int k; mapmp; int work(ll n){ ll a=1,p; int ans=2; ll b=2,x=n; if(n<=2)return 1; else if(n==3) return 2; else{ x-=3; for(int i=0;x>0;i++){ p=a+b; x-=p; if(x<=0)break; a=b; b=p; ans++; } if(x==0)return ans+1; else return ans; } } int main(){ int t; ll n; scanf("%d",&t); while(t--){ cin>>n; printf("%d\n",work(n)); } }