#include #include #include #include #include using namespace std; long long arr[100]; int main() { memset(arr, 0, sizeof(arr)); long long s = 0; int t; long long n; scanf("%d", &t); int i; int j; for (i = 0; i < t; ++i) { scanf("%I64d", &n); arr[1] = 1; arr[2] = 2; s = 3; for (j = 3; s <= n; ++j) { arr[j] = arr[j - 1] + arr[j - 2]; s += arr[j]; } printf("%d\n", j - 2); } return 0; }