#include <iostream>
using namespace std;
int main()
{
int n, i;
setlocale(LC_ALL, "Russian");
cout << "\nN = ";
cin >> n;
unsigned long long* x = new unsigned long long [n];
x[1] = 1;
x[2] = 1;
x[3] = 1;
for (i = 4; i <= n; i++)
x[i] = x[i - 1] + x[i - 3];
cout << "\nX [" << n << "] = " << x [n] << endl;
getchar;
}
#include <iostream>
using namespace std;
int main()
{
int n, i;
setlocale(LC_ALL, "Russian");
cout << "\nN = ";
cin >> n;
unsigned long long* x = new unsigned long long [n];
x[1] = 1;
x[2] = 1;
x[3] = 1;
for (i = 4; i <= n; i++)
x[i] = x[i - 1] + x[i - 3];
cout << "\nX [" << n << "] = " << x [n] << endl;
getchar;
}