#include <stdio.h>
int dp[1000001];

int bottom_up (int n) {
    dp[0]=1;
    dp[1]=1;
    for(int i=2; i<=n; i++) {
        dp[i]=(dp[i-1]+dp[i-2])%15746;
    }
    return dp[n];
}

int main() {
    int n;
    scanf("%d",&n);
    printf("%d",bottom_up(n));
    return 0;
}

Embed on website

To embed this project on your website, copy the following code and paste it into your website's HTML: