Submission

Status:

PPPPPPPPP-

Subtask/Task Score:

90/100

Score: 90

User: un8qe_x3

Problemset: Fibonacci Croissant

Language: cpp

Time: 0.002 second

Submitted On: 2025-11-16 13:55:00

#include <bits/stdc++.h>
using namespace std;

long long f(const int a) {
    const long double phi = (1.0L + sqrtl(5.0L)) / 2.0L;
    const long double psi = (1.0L - sqrtl(5.0L)) / 2.0L;
    return static_cast<long long int>(roundl((powl(phi, a) - powl(psi, a)) / sqrtl(5.0L)));
}

int main() {
    int a;
    cin >> a;
    cout << f(a+2)-1;
}