Check out example codes for "dinamica02 pbinfo". It will help you in understanding the concepts better.

Code Example 1

#include <iostream>

using namespace std;

#define MOD 777013

int n;
long long s[2], nr;

int main()
{
    cin >> n;
    s[0] = 26; s[1] = 26 * 26;
    for (int i = 3; i <= n; ++ i)
    {
        nr = (s[1] * 25 + s[0] * 25) % MOD;
        s[0] = s[1];
        s[1] = nr;
    }
    cout << nr;
    return 0;
}

Learn ReactJs, React Native from akashmittal.com