malteklaes/cpp-code-code_search_net-style huggingface dataset:
#include <bits/stdc++.h>   using namespace std;   const int N = 200200;   int n;   long long b[N], c[N];   long long a[N];   int dg[32];   void solve() {     memset((dg), (0), sizeof(dg));     long long sum = 0, suma = 0;     for (int i = (int)0; i < (int)n; ++i) sum += b[i] + c[i];     suma = sum / (n + n);     bool flag = 1;     for (int i = (int)0; i < (int)n; ++i) {       a[i] = (b[i] + c[i] - suma) / n;       if (a[i] < 0) flag = 0;     }     if (!flag) {       cout <<  -1 ;       return;     }     for (int i = (int)0; i < (int)n; ++i) {       int t = 0;       for (long long x = a[i]; x; x >>= 1) dg[t++] += (x & 1);     }     for (int i = (int)0; i < (int)n; ++i) {       long long x = a[i], sumi = 0;       for (int j = (int)0; j < (int)32; ++j)         if ((x >> j) & 1) sumi += (1 << j) * dg[j];       if (sumi != b[i]) {         flag = 0;         break;       }     }     if (!flag) {       cout <<  -1 ;       return;     }     for (int i = (int)0; i < (int)n; ++i) {       long long x = a[i], sumi = 0;       for (int j = (int)0; j < (int)32; ++j) {         if ((x >> j) & 1)           sumi += (1 << j) * n;         else           sumi += (1 << j) * dg[j];       }       if (sumi != c[i]) {         flag = 0;         break;       }     }     if (!flag) {       cout <<  -1 ;       return;     }     for (int i = (int)0; i < (int)n; ++i) cout << a[i] <<    ;   }   int main() {     ios_base::sync_with_stdio(false);     cin.tie(0);     cin >> n;     for (int i = (int)0; i < (int)n; ++i) cin >> b[i];     for (int i = (int)0; i < (int)n; ++i) cin >> c[i];     solve();     return 0;   }
#include <bits/stdc++.h>   using namespace std;   const int INF = (1 << 30) - 1;   const long double EPS = 1e-9;   const long double PI = fabs(atan2(0.0, -1.0));   int get(int n) {     int res = 0;     for (int b = 0; n > 0; b++) {       if (n & 1) res = b;       n >>= 1;     }     return res;   }   int p[1000100];   void solve() {     int n;     cin >> n;     vector<bool> was(n + 1, false);     for (int i = n; i >= 0; i--) {       for (int k = 23; k >= 0; k--) {         int cur = (1 << k) - 1;         int add = cur - i;         if (add < 0 || add > n) continue;         if (was[add]) continue;         was[add] = true;         p[i] = add;         break;       }     }     printf(          %lld            n ,         n * 1LL * (n + 1));     for (int i = 0; i <= n; i++) {       if (i > 0) printf(   );       printf( %d , p[i]);     }     printf(  n );   }   int main() {     solve();     return 0;   }
#include <bits/stdc++.h>   using namespace std;   const int mod = 1e9 + 7;   int main() {     ios_base::sync_with_stdio(false);     cin.tie(NULL);     map<long long, long long> mp;     deque<long long> a;     long long n, k, d, m = 0;     cin >> n >> k;     for (auto i = 0; i < n; i++) {       cin >> d;       if (!mp[d]) {         mp[d] = 1;         a.push_front(d);         if (a.size() > k) {           mp[a.back()] = 0;           a.pop_back();         }       }     }     cout << a.size() <<   n ;     for (const auto val : a) cout << val <<    ;     return 0;   }
#include <bits/stdc++.h>   using namespace std;   using ll = long long;   template <typename T>   using v2 = vector<vector<T>>;   template <typename T>   inline v2<T> fill(int r, int c, const T& t) {     return v2<T>(r, vector<T>(c, t));   }   ll a, b, c, d;   const ll INF = 1e18;   ll nc2(ll n) { return (n * (n - 1)) / 2; }   ll diff(ll n) { return a - b * d * (nc2(n) - nc2(n - 1)); }   ll value(ll n) {     ll x = nc2(n);     if (b * x > INF / d) {       return -INF;     }     return a * n - b * d * x;   }   void solve() {     cin >> a >> b >> c >> d;     if (a > b * c) {       cout <<  -1 n ;     } else {       ll lo = 1;       ll hi = c;       ll ans = -INF;       while (lo <= hi) {         ll mid = (lo + hi) / 2;         if (diff(mid) <= 0) {           hi = mid - 1;         } else {           lo = mid + 1;         }         ans = max(ans, value(mid));       }       cout << ans <<   n ;     }   }   int main() {     ios_base::sync_with_stdio(false);     cin.tie(NULL);     int T;     cin >> T;     for (int i = 0; i < T; ++i) {       solve();     }     return 0;   }
#include <bits/stdc++.h>   using namespace std;   int n, l, r;   long long ans;   int pr[10000005];   int cnt[10000005];   void solve() {     n--;     for (int i = (1); i <= (10000000); i++) pr[i] = i;     for (int i = (2); i <= (10000000); i++)       if (pr[i] == i) {         for (int j = i + i; j <= 10000000; j += i) {           if (pr[j] == j) pr[j] = i;         }       }     for (int i = (l); i <= (r); i++) {       int temp = 1, num = i, tc = 0, tp = 1;       while (num > 1) {         int np = pr[num];         if (np == tp) {           tc++;           if (tc >= n) tc = 0;         } else {           for (int j = (1); j <= (tc); j++) temp *= tp;           tp = np;           tc = 1 % n;         }         num /= np;       }       for (int j = (1); j <= (tc); j++) temp *= tp;       cnt[temp]++;     }     for (int i = (1); i <= (r); i++) ans += 1LL * cnt[i] * (cnt[i] - 1);     printf( %lld n , ans);   }   int main() {     scanf( %d %d %d , &n, &l, &r);     if (n == 1)       printf( %d n , r - l + 1);     else       solve();     return 0;   }
#include <bits/stdc++.h>   using namespace std;   const int M = 200005;   int n, f[M], ans;   int tot, head[M], Next[M * 2], vet[M * 2], len[M * 2];   void add(int a, int b, int c) {     Next[++tot] = head[a], vet[tot] = b, len[tot] = c;     head[a] = tot;   }   void dfs1(int x, int pre) {     for (int i = head[x]; i; i = Next[i]) {       int y = vet[i], z = len[i];       if (y == pre) continue;       dfs1(y, x);       f[x] += f[y] + z;     }   }   void dfs2(int x, int pre) {     for (int i = head[x]; i; i = Next[i]) {       int y = vet[i], z = len[i];       if (y == pre) continue;       if (z)         z = -1;       else         z = 1;       f[y] = f[x] + z;       ans = min(ans, f[y]);       dfs2(y, x);     }   }   int main() {     scanf( %d , &n);     for (int i = 2; i <= n; i++) {       int a, b;       scanf( %d%d , &a, &b);       add(a, b, 0);       add(b, a, 1);     }     dfs1(1, 0);     ans = f[1];     dfs2(1, 0);     printf( %d n , ans);     for (int i = 1; i <= n; i++)       if (f[i] == ans) printf( %d  , i);     return 0;   }
#include <bits/stdc++.h>   using namespace std;   string s;   char ok[100] = { A ,  H ,  I ,  M ,  O ,  T ,  U ,  V ,  W ,  X ,  Y };   int main() {     while (cin >> s) {       if (s.length() == 1) {         int flag = 0;         for (int i = 0; i <= 10; i++) {           if (s[0] == ok[i]) {             puts( YES );             flag = 1;             break;           }         }         if (!flag) puts( NO );         continue;       } else {         int flag = 1, half = s.length() / 2, flag1 = 0;         int len = s.length();         for (int i = 0; i < half; i++) {           if (s[i] != s[len - 1 - i]) {             flag = 0;             break;           } else {             int x = 0;             for (int j = 0; j <= 10; j++) {               x += s[i] == ok[j];             }             if (x == 0) {               flag = 0;               break;             }           }         }         if (len % 2 == 1) {           for (int i = 0; i <= 10; i++) {             if (s[half] == ok[i]) {               flag1 = 1;               break;             }           }         } else           flag1 = 1;         printf( %s n , flag == 1 && flag1 == 1 ?  YES  :  NO );       }     }     return 0;   }
#include <bits/stdc++.h>   using namespace std;   map<long long int, long long int> m;   int main() {     long long int n;     cin >> n;     vector<long long int> v;     for (long long int i = 0; i < n; i++) {       long long int x;       cin >> x;       v.emplace_back(x);       m[x]++;     }     sort(v.begin(), v.end());     long long int ans = 0;     for (long long int i = 0; i < n; i++) {       ans = max(ans, m[v[i]]);     }     cout << ans;     return 0;   }
#include <bits/stdc++.h>   using namespace std;   int main() {     ios::sync_with_stdio(0), cin.tie(0), cout.tie(0);     int a = 0, b = 0, c = 0, sum1 = 0, d = 0;     cin >> a >> b >> c >> d;     for (; sum1 <= d;) {       sum1 += b;       a -= c;     }     if (a > 0)       cout <<  YES ;     else       cout <<  NO ;   }
#include <bits/stdc++.h>   using namespace std;   inline long long minOf(long long x, long long y) { return (x < y ? x : y); }   inline long long maxOf(long long x, long long y) { return (x > y ? x : y); }   char arr[50000000], *ptr;   long long ret;   string str;   inline long long get_int() {     bool isNeg = false;     ret = 0;     while (!((*ptr >=  0  && *ptr <=  9 ) || *ptr ==  - )) ptr++;     while ((*ptr >=  0  && *ptr <=  9 ) || *ptr ==  - ) {       if (*ptr ==  - )         isNeg = true;       else         ret = ret * 10 + (*ptr -  0 );       ptr++;     }     if (isNeg) ret = -ret;     return ret;   }   long long a[100005];   int bits[33];   int main() {     fread(arr, sizeof(char), 50000000, stdin);     ptr = arr;     int n = get_int();     for (int i = 0; i < 33; i++) bits[i] = -1;     for (int i = 0; i < n; i++) {       a[i] = get_int();       for (int j = 0; j < 32; j++) {         if (a[i] & (1 << j)) {           if (bits[j] == -1)             bits[j] = a[i];           else             bits[j] = a[i] & bits[j];         }       }     }     int k = 0;     vector<int> list;     int lk = 0;     for (int i = 32; i >= 0; i--) {       if (bits[i] != -1) {         for (int j = 0; j < 32; j++) {           if (bits[i] & (1 << j)) {             if (j > lk) lk = j;             break;           }         }       }     }     for (int j = 0; j < n; j++) {       if (a[j] & (1 << lk)) {         k++;         list.push_back(a[j]);       }     }     cout << k << endl;     for (int i = 0; i < k; i++) {       cout << list[i] <<    ;     }     return 0;   }
#include <bits/stdc++.h>   using namespace std;   vector<vector<unsigned long long>> g;   vector<bool> visited;   vector<unsigned long long> s;   void dfs(unsigned long long x) {     visited[x] = 1;     for (unsigned long long i : g[x])       if (!visited[i]) dfs(i);     s.push_back(x);   }   int main() {     unsigned long long n;     cin >> n;     vector<unsigned long long> v(n);     for (unsigned long long &i : v) cin >> i;     g.assign(n, vector<unsigned long long>());     visited.assign(n, 0);     for (unsigned long long i = 0; i < n; i++) {       for (unsigned long long j = 0; j < n; j++) {         if (v[i] * 2 == v[j]) {           g[i].push_back(j);         } else if (v[i] * 3 == v[j]) {           g[j].push_back(i);         }       }     }     for (unsigned long long i = 0; i < n; i++) {       if (!visited[i]) dfs(i);     }     while (!s.empty()) {       cout << v[s.back()] <<    ;       s.pop_back();     }   }
#include <bits/stdc++.h>   using namespace std;   const int N = 1000010;   int n, ans[N], cnt = 1;   vector<int> id[N], cur[N];   vector<int> g[N];   bool vis[N], done[N];   int sz[N], ns[N], ns2[N], comp_cnt, comp[N], allns = 0;   void DFS(int node) {     sz[comp_cnt]++;     vis[node] = true;     comp[node] = comp_cnt;     for (int i = 0; i < (int)g[node].size(); i++) {       if (!vis[g[node][i]]) {         DFS(g[node][i]);       }     }   }   void take(int idx, int needed) {     if (done[idx]) return;     done[idx] = true;     int u = cur[idx][0];     int v = cur[idx][1];     if (v % n == needed) swap(cur[idx][0], cur[idx][1]);     u = cur[idx][0];     v = cur[idx][1];     ns[comp[needed]] += cur[idx][0] / n;     allns += cur[idx][0] / n;     ns2[comp[needed]] += cur[idx][1] / n;     int a = id[v % n][0];     if (a == idx) a = id[v % n][1];     take(a, v % n);   }   int main() {     scanf( %d , &n);     if (n % 2 == 0) {       puts( First );       fflush(stdout);       if ((n / 2) % 2 == 0) {         ans[1] = ans[2] = cnt++;         ans[n + 1] = ans[n + 2] = cnt++;         for (int i = 3; i <= n; i++) {           ans[i] = ans[i + n] = cnt++;         }       } else {         int last[2] = {-1, -1};         for (int cur, i = 1; i <= 2 * n; i++) {           cur = (i & 1);           if (last[cur] == -1)             last[cur] = i;           else {             ans[i] = ans[last[cur]] = cnt++;             last[cur] = -1;           }         }       }       for (int i = 1; i <= 2 * n; i++) {         if (i > 1) putchar(   );         printf( %d , ans[i]);       }       puts(  );       fflush(stdout);       return 0;     }     puts( Second );     fflush(stdout);     for (int i = 1; i <= 2 * n; i++) {       scanf( %d , &ans[i]);       cur[ans[i]].push_back(i);       id[i % n].push_back(ans[i]);     }     for (int u, v, i = 1; i <= n; i++) {       u = cur[i][0] % n;       v = cur[i][1] % n;       g[u].push_back(v);       g[v].push_back(u);     }     for (int i = 0; i < n; i++) {       if (vis[i]) continue;       DFS(i);       comp_cnt++;     }     for (int i = 1; i <= n; i++) {       if (done[i]) continue;       take(i, cur[i][0] % n);     }     long long val = (long long)n * (n - 1) / 2;     val += (long long)allns * n;     val %= (2 * n);     if (val != 0) {       assert(val == n);       int good = -1;       for (int i = 0; i < comp_cnt; i++) {         if (abs(ns[i] - ns2[i]) % 2 == 1) {           good = i;           break;         }       }       assert(good != -1);       for (int i = 1; i <= n; i++) {         if (comp[cur[i][0] % n] == good) {           swap(cur[i][0], cur[i][1]);         }       }     }     for (int i = 1; i <= n; i++) {       if (i > 1) putchar(   );       printf( %d , cur[i][0]);     }     puts(  );     fflush(stdout);     return 0;   }
#include <bits/stdc++.h>   using namespace std;   int main() {     ios_base::sync_with_stdio(false);     cin.tie(NULL);     int n, m, i, j, k;     cin >> n >> m;     int a[101] = {0};     for (i = 0; i < m; i++) {       cin >> j;       a[j]++;     }     vector<int> v;     for (i = 1; i <= 100; i++) {       if (a[i] != 0) v.push_back(a[i]);     }     sort(v.rbegin(), v.rend());     j = m / n;     if (j == 0)       cout << j;     else {       for (i = j; i >= 1; i--) {         int x = 0;         for (k = 0; k < v.size(); k++) {           x += (v[k] / i);         }         if (x >= n) break;       }       cout << i;     }   }
#include <bits/stdc++.h>   template <class T>   inline void read(T &x) {     x = 0;     int f = 0;     char ch = getchar();     while (!isdigit(ch)) {       f |= ch ==  - ;       ch = getchar();     }     while (isdigit(ch)) {       x = (x << 1) + (x << 3) + (ch ^ 48);       ch = getchar();     }     x = f ? -x : x;     return;   }   std::vector<long long> r, g, b;   long long ans, nr, ng, nb, t, p;   void solve(std::vector<long long> a, std::vector<long long> b,              std::vector<long long> c) {     for (auto x : a) {       auto y = std::lower_bound(b.begin(), b.end(), x),            z = std::upper_bound(c.begin(), c.end(), x);       if (y == b.end() || z == c.begin()) continue;       --z;       ans = std::min(           ans, (x - *y) * (x - *y) + (*y - *z) * (*y - *z) + (x - *z) * (x - *z));     }   }   int main() {     read(t);     while (t--) {       ans = 9e18;       r.clear(), g.clear(), b.clear();       read(nr), read(ng), read(nb);       for (int i = 1; i <= nr; ++i) read(p), r.push_back(p);       for (int i = 1; i <= ng; ++i) read(p), g.push_back(p);       for (int i = 1; i <= nb; ++i) read(p), b.push_back(p);       std::sort(r.begin(), r.end()), std::sort(g.begin(), g.end()),           std::sort(b.begin(), b.end());       solve(r, g, b), solve(r, b, g), solve(g, r, b), solve(g, b, r),           solve(b, r, g), solve(b, g, r);       printf( %lld n , ans);     }     return 0;   }
#include <bits/stdc++.h>   using namespace std;   const int maxb = 20;   const int maxn = 300000 + 7;   int dp[maxn][maxb];   int n, q;   int seq[maxn];   int last[maxb];   void init() {     cin >> n >> q;     for (int i = (1); i <= (n); ++i) cin >> seq[i];   }   void solve() {     for (int i = (0); i < (maxb); ++i) dp[n + 1][i] = n + 1;     for (int i = (0); i < (maxb); ++i) last[i] = n + 1;     for (int i = (n); i >= (1); --i) {       for (int j = (0); j < (maxb); ++j) dp[i][j] = n + 1;       int now = seq[i];       for (int j = (0); j < (maxb); ++j) {         if ((now >> j) & 1) {           for (int k = (0); k < (maxb); ++k)             dp[i][k] = min(dp[i][k], dp[last[j]][k]);           dp[i][j] = i;           last[j] = i;         }       }     }     while (q--) {       int x, y;       cin >> x >> y;       int r = seq[y];       int ok = 0;       for (int j = (0); j < (maxb); ++j) {         if (((r >> j) & 1) && dp[x][j] <= y) {           ok = 1;           break;         }       }       if (ok)         cout <<  Shi n ;       else         cout <<  Fou n ;     }   }   int main(void) {     ios::sync_with_stdio(false);     cin.tie(0);     init();     solve();     return 0;   }
#include <bits/stdc++.h>   const int maxn = 2e3 + 5;   using namespace std;   int arr[maxn];   int dp[maxn][maxn];   int check(int x, int lef, int rig) { return (lef <= x && x <= rig ? 1 : 0); }   int main() {     int n, h, l, r;     scanf( %d %d %d %d , &n, &h, &l, &r);     for (int i = 1; i <= n; i++) {       scanf( %d , &arr[i]);     }     memset((dp), (-1), sizeof(dp));     dp[0][0] = 0;     for (int i = 1; i <= n; i++) {       for (int j = 0; j < h; j++) {         if (dp[i - 1][j] != -1) {           dp[i][(j + arr[i]) % h] =               max(dp[i - 1][j] + check((j + arr[i]) % h, l, r),                   dp[i][(j + arr[i]) % h]);           dp[i][(j + arr[i] - 1) % h] =               max(dp[i - 1][j] + check((j + arr[i] - 1) % h, l, r),                   dp[i][(j + arr[i] - 1) % h]);         }       }     }     int ans = -1;     for (int i = 0; i < h; i++) {       ans = max(ans, dp[n][i]);     }     printf( %d n , ans);     return 0;   }
#include <bits/stdc++.h>   using namespace std;   int main() {     long long int n;     cin >> n;     if (n == 0)       cout << 1;     else {       switch (n % 4) {         case 0:           cout << 6 << endl;           break;         case 1:           cout << 8 << endl;           break;         case 2:           cout << 4 << endl;           break;         case 3:           cout << 2 << endl;           break;       }     }     return 0;   }
#include <bits/stdc++.h>   using namespace std;   const long long max_n = INT_MAX - 1000000;   long long dp[30][30001];   pair<int, int> par[30][30001];   int main() {     ios_base::sync_with_stdio(0), cin.tie(0), cout.tie(0);     int t;     cin >> t;     while (t--) {       long long n, m, k;       cin >> n >> m >> k;       if (n > m) swap(n, m);       map<char, long long> mp;       string ss =   ;       for (long long i = 0; i < k; i++) {         char a;         cin >> a;         mp[a]++;         ss += a;       }       vector<int> vv;       for (auto i : mp) {         vv.push_back(i.second);       }       long long ans = LONG_MAX;       for (int i1 = 0; i1 < vv.size(); i1++) {         vector<int> v = vv;         v.erase(v.begin() + i1);         v.insert(v.begin(), vv[i1]);         for (long long i = 0; i < v.size(); i++) {           for (long long j = 0; j <= m; j++) {             dp[i][j] = max_n;           }         }         for (int i = 0; i < v.size(); i++) {           for (long long j = 1; j <= m; j++) {             if (i == 0) {               if (j <= v[i]) {                 dp[i][j] = v[i];               }             } else {               if (dp[0][j] == max_n) {                 if (j <= v[i]) {                   dp[i][j] = v[i] + v[0];                   dp[i][j] = min(dp[i - 1][j], dp[i][j]);                 } else {                   dp[i][j] = min(dp[i - 1][j], dp[i - 1][j - v[i]] + v[i]);                 }               } else {                 dp[i][j] = dp[0][j];               }             }           }         }         if (v[0] - (dp[v.size() - 1][n] - n) >= 0)           ans = min(ans, (v[0] - (dp[v.size() - 1][n] - n)) *                              max((long long)0,                                  (dp[v.size() - 1][n] - n - (k - n - m))));         if (v[0] - (dp[v.size() - 1][m] - m) >= 0)           ans = min(ans, (v[0] - (dp[v.size() - 1][m] - m)) *                              max((long long)0,                                  (dp[v.size() - 1][m] - m - (k - n - m))));       }       cout << ans <<   n ;     }     return 0;   }
#include <bits/stdc++.h>   using namespace std;   long long mod = 1000000007LL;   int n, l;   long long a[102], b[102];   long long dp[2 * 3002][102][2];   int main() {     while (cin >> n >> l) {       for (int i = 0; i < n; ++i) {         cin >> a[i] >> b[i];       }       memset(dp, 0, sizeof(dp));       for (int i = 0; i < n; ++i) {         dp[a[i]][i][0] = 1LL;         if (a[i] != b[i]) {           dp[b[i]][i][1] = 1LL;         }       }       for (int i = 1; i <= l; ++i) {         for (int j = 0; j < n; ++j) {           if (dp[i][j][0]) {             for (int k = 0; k < n; ++k) {               if (k != j) {                 if (a[k] == b[j]) {                   dp[i + b[j]][k][0] = (dp[i + b[j]][k][0] + dp[i][j][0]) % mod;                 } else if (b[k] == b[j]) {                   dp[i + b[j]][k][1] = (dp[i + b[j]][k][1] + dp[i][j][0]) % mod;                 }               }             }           }           if (dp[i][j][1]) {             for (int k = 0; k < n; ++k) {               if (k != j) {                 if (a[k] == a[j]) {                   dp[i + a[j]][k][0] = (dp[i + a[j]][k][0] + dp[i][j][1]) % mod;                 } else if (b[k] == a[j]) {                   dp[i + a[j]][k][1] = (dp[i + a[j]][k][1] + dp[i][j][1]) % mod;                 }               }             }           }         }       }       long long ans = 0LL;       for (int i = 0; i < n; ++i) {         ans = (ans + dp[l][i][0]) % mod;         ans = (ans + dp[l][i][1]) % mod;       }       cout << ans << endl;     }     return 0;   }
#include <bits/stdc++.h>   int x[1000], y[1000];   using namespace std;   int main() {     int n, counter = 0;     cin >> n;     for (int i = 0; i < n; i++) {       cin >> x[i] >> y[i];       if (x[i] != y[i]) {         cout <<  rated ;         return 0;       }     }     for (int i = 0; i < n; i++) {       if (x[i] < x[i + 1]) {         cout <<  unrated ;         return 0;       }     }     cout <<  maybe ;     return 0;   }
#include <bits/stdc++.h>   using namespace std;   int main() {     int n;     while (cin >> n) {       vector<int> a(n);       for (int i = 0; i < n; scanf( %d , &a[i++]))         ;       sort(a.begin(), a.end());       bool ok = 0;       for (int i = 0; i < n; i++) {         if (a[i] != i + 1) {           cout << i + 1 << endl;           ok = 1;           break;         }       }       if (!ok) cout << n + 1 << endl;     }     return 0;   }
#include <bits/stdc++.h>   using namespace std;   int a0, a1, n, ans, table[500];   int getans(int);   int main() {     scanf( %d%d%d , &a0, &a1, &n);     printf( %d n , getans(n));     return 0;   }   int getans(int an) {     if (an == 0) return a0;     if (an == 1) return a1;     return getans(an - 1) + getans(an - 2);   }