#include <iostream>
#include <vector>
using namespace std;
class Fibonacci {
public:
static vector<int> generateFibonacci(int n) {
vector<int> fibSeries;
int a = 0, b = 1;
for (int i = 0; i < n; i++) {
fibSeries.push_back(a);
int next = a + b;
a = b;
b = next;
}
return fibSeries;
}
};
int main() {
int n = 10;
vector<int> fibSeries = Fibonacci::generateFibonacci(n);
for (int num : fibSeries) {
cout << num << " ";
}
return 0;
}
I2luY2x1ZGUgPGlvc3RyZWFtPgojaW5jbHVkZSA8dmVjdG9yPgp1c2luZyBuYW1lc3BhY2Ugc3RkOwoKY2xhc3MgRmlib25hY2NpIHsKcHVibGljOgogICAgc3RhdGljIHZlY3RvcjxpbnQ+IGdlbmVyYXRlRmlib25hY2NpKGludCBuKSB7CiAgICAgICAgdmVjdG9yPGludD4gZmliU2VyaWVzOwogICAgICAgIGludCBhID0gMCwgYiA9IDE7CiAgICAgICAgCiAgICAgICAgZm9yIChpbnQgaSA9IDA7IGkgPCBuOyBpKyspIHsKICAgICAgICAgICAgZmliU2VyaWVzLnB1c2hfYmFjayhhKTsKICAgICAgICAgICAgaW50IG5leHQgPSBhICsgYjsKICAgICAgICAgICAgYSA9IGI7CiAgICAgICAgICAgIGIgPSBuZXh0OwogICAgICAgIH0KICAgICAgICAKICAgICAgICByZXR1cm4gZmliU2VyaWVzOwogICAgfQp9OwoKaW50IG1haW4oKSB7CiAgICBpbnQgbiA9IDEwOwogICAgdmVjdG9yPGludD4gZmliU2VyaWVzID0gRmlib25hY2NpOjpnZW5lcmF0ZUZpYm9uYWNjaShuKTsKICAgIAogICAgZm9yIChpbnQgbnVtIDogZmliU2VyaWVzKSB7CiAgICAgICAgY291dCA8PCBudW0gPDwgIiAiOwogICAgfQogICAgCiAgICByZXR1cm4gMDsKfQo=