https://szkopul.edu.pl/problemset/problem/98e_K-Vvcg5TnMG4-hXTNsFG/site/?key=statement

Here’s my try :

```
#include <bits/stdc++.h>
#define int long long
#define vi vector<int>
using namespace std;
void setIO() {
cin.tie(0)->ios_base::sync_with_stdio(0);
}
void solve() {
vi dp(1000000001);
dp[1] = 1;
dp[2] = 2;
for(int i = 3;i <= 1000000000;++i) dp[i] = dp[i-1]+dp[i-2];
int m,n,x = 0,y;
cin >> m;
for(int i = 1;i <= m;++i) {
cin >> y;
x += y*dp[i];
}
cin >> n;
for(int i = 1;i <= n;++i) {
cin >> y;
x += y*dp[i];
}
auto it = upper_bound(dp.begin(),dp.end(),x);
int k = distance(dp.begin(),it);
vi res(k);
for(int i = k-1;i >= 0;--i) {
if(dp[i] > x) continue;
x -= dp[i];
res[i] = 1;
}
cout << k;
for(auto &x : res) cout << ' ' << x;
}
int32_t main() {
setIO();
solve();
return 0;
}
```

I don’t know why am I getting segmentation fault(run time error) but i m not going out of the bound anywhere or anything wrong