malteklaes/cpp-code-code_search_net-style huggingface dataset:
#include <bits/stdc++.h>   using namespace std;   vector<pair<double, double>> v[4];   double x[3], y[3], r[3];   void add_point(int p, double x, double y) {     for (int t = 0; t < v[p].size(); t++)       if (fabs(x - v[p][t].first) < 1e-7 && fabs(y - v[p][t].second) < 1e-7)         return;     v[p].push_back(make_pair(x, y));   }   int main() {     int n, ans = 0;     cin >> n;     for (int i = 0; i < n; i++) cin >> x[i] >> y[i] >> r[i];     for (int i = 0; i < n; i++) {       for (int j = 0; j < n; j++) {         double a = 2 * (x[j] - x[i]), b = 2 * (y[j] - y[i]),                c = (a * a + b * b) / 4 + r[i] * r[i] - r[j] * r[j];         double d = a * a + b * b, x0 = a * c / d + x[i], y0 = b * c / d + y[i],                md = r[i] * r[i] * d - c * c;         if (i == j || md < 0) continue;         b *= sqrt(md) / d, a *= sqrt(md) / d;         for (int k = 0, p[3] = {3, i, j}; k < 3; k++)           add_point(p[k], x0 + b, y0 - a), add_point(p[k], x0 - b, y0 + a);       }       ans += v[i].size() ? v[i].size() : 1;     }     cout << ans + 2 - (v[3].size() ? v[3].size() : 1) << endl;     return 0;   }
#include <bits/stdc++.h>   using namespace std;   const long long Mod = 1000000007;   long long fp(long long a, long long k) {     long long res = 1;     while (k) {       if (k & 1) res = res * a % Mod;       a = a * a % Mod;       k >>= 1;     }     return res;   }   int main() {     long long n, m;     scanf( %I64d%I64d , &n, &m);     long long res = (m == 1 ? n + 1                             : ((m * fp(2 * m - 1, n) - fp(m, n)) % Mod + Mod) *                                   fp(m - 1, Mod - 2) % Mod);     printf( %I64d , res);     return 0;   }
#include <bits/stdc++.h>   using namespace std;   const long long inf = 1e9 + 7;   void solve() {     long long n, m;     cin >> n >> m;     if (m == 1) {       long long a = n * (n - 1) / 2;       cout << a <<     << a << endl;     } else {       long long aux = n - (m - 1);       long long maxi = aux * (aux - 1) / 2;       long long mini = 0;       aux = n / m;       long long left = n - m * aux;       if (left != 0) {         mini = (aux + 1) * aux / 2 * left + (m - left) * (aux * (aux - 1)) / 2;       } else {         mini = (aux * (aux - 1)) / 2 * m;       }       cout << mini <<     << maxi << endl;     }   }   int main() {     ios::sync_with_stdio(0);     cin.tie(0);     int t = 1;     while (t--) {       solve();     }     return 0;   }
#include <bits/stdc++.h>   using namespace std;   const int N = 25;   long long n, ans[N];   pair<int, int> arr[N];   int main() {     ios::sync_with_stdio(0), cin.tie(0), cout.tie(0);     cin >> n;     for (int i = 0; i < n; i++) cin >> arr[i].first, arr[i].second = i;     sort(arr, arr + n);     for (int i = 0; i < n; i++) ans[arr[(i + 1) % n].second] = arr[i].first;     for (int i = 0; i < n; i++) cout << ans[i] <<    ;     return 0;   }
#include <bits/stdc++.h>   using namespace std;   long long int gcd(long long int a, long long int b) {     return b == 0 ? a : gcd(b, a % b);   }   inline long long int lbt(long long int x) { return x & -x; }   inline void fail() {     cout <<  -1  << endl;     exit(0);   }   int main() {     long long int a, b, c, d, e, f, h, x(0);     cin >> a >> b >> c >> d;     e = a * b;     f = c * d;     h = gcd(e, f);     e /= h, f /= h;     if (e == 1) {       while (c % 3 == 0 && f != lbt(f)) ++x, c /= 3, c <<= 1, f /= 3, f <<= 1;       while (d % 3 == 0 && f != lbt(f)) ++x, d /= 3, d <<= 1, f /= 3, f <<= 1;       ;     } else if (f == 1) {       while (a % 3 == 0 && e != lbt(e)) ++x, a /= 3, a <<= 1, e /= 3, e <<= 1;       while (b % 3 == 0 && e != lbt(e)) ++x, b /= 3, b <<= 1, e /= 3, e <<= 1;       ;     } else if (e == lbt(e)) {       h = f;       while (h % 3 == 0) h /= 3;       if (h != 1) fail();       ;       while (c % 3 == 0 && f != lbt(f)) ++x, c /= 3, c <<= 1, f /= 3, f <<= 1;       while (d % 3 == 0 && f != lbt(f)) ++x, d /= 3, d <<= 1, f /= 3, f <<= 1;       ;     } else if (f == lbt(f)) {       h = e;       while (h % 3 == 0) h /= 3;       if (h != 1) fail();       ;       while (a % 3 == 0 && e != lbt(e)) ++x, a /= 3, a <<= 1, e /= 3, e <<= 1;       while (b % 3 == 0 && e != lbt(e)) ++x, b /= 3, b <<= 1, e /= 3, e <<= 1;       ;     } else       fail();     while ((~c & 1) && e < f) ++x, c >>= 1, f >>= 1;     while ((~d & 1) && e < f) ++x, d >>= 1, f >>= 1;     ;     while ((~a & 1) && f < e) ++x, a >>= 1, e >>= 1;     while ((~b & 1) && f < e) ++x, b >>= 1, e >>= 1;     ;   FINAL:     cout << x << endl << a <<     << b << endl << c <<     << d << endl;   }
#include <bits/stdc++.h>   using namespace std;   long long n, l, r;   long long gerar(long long n) {     if (n == 0) {       return 0;     }     return 2 * gerar(n / 2) + 1;   }   long long solve(long long esq, long long dir, long long l, long long r,                   long long valor) {     long long mid = (esq + dir) / 2;     long long res = 0;     if (valor == 1) {       return 1;     }     if (valor == 0) {       return 0;     }     if (mid >= l && mid <= r) {       res += valor % 2ll;     }     if (mid - 1 >= l) {       res += solve(esq, mid - 1, l, r, valor / 2ll);     }     if (mid + 1 <= r) {       res += solve(mid + 1, dir, l, r, valor / 2ll);     }     return res;   }   int main() {     scanf( %lld %lld %lld , &n, &l, &r);     long long qtd = gerar(n);     printf( %lld n , solve(1, qtd, l, r, n));   }
#include <bits/stdc++.h>   using namespace std;   long long add(long long a, long long b) {     a += b;     if (a >= 998244353) {       a -= 998244353;     }     return a;   }   long long sub(long long a, long long b) {     a -= b;     if (a < 0) {       a += 998244353;     }     return a;   }   long long mul(long long a, long long b) { return (a * b) % 998244353; }   void add_self(long long& a, long long b) { a = add(a, b); }   void sub_self(long long& a, long long b) { a = sub(a, b); }   void mul_self(long long& a, long long b) { a = mul(a, b); }   const long long MAXN = 200010;   long long fpower(long long x, long long y, long long p) {     long long res = 1;     x = x % p;     while (y > 0) {       if (y & 1) res = (res * x) % p;       y = y >> 1;       x = (x * x) % p;     }     return res;   }   int main() {     long long x, y;     cin >> x >> y;     cout << fpower(2, x + y, 998244353) <<   n ;     return 0;   }
#include <bits/stdc++.h>   using namespace std;   int num[500005];   int maps[500005];   int to[500005];   int main() {     ios::sync_with_stdio(0);     int n, m;     int l, r;     scanf( %d%d , &n, &m);     for (int i = 1; i <= n; i++) {       scanf( %d , &num[i]);       to[num[i]] = i;     }     for (int i = 1; i <= m; i++) {       scanf( %d%d , &l, &r);       if (to[r] < to[l]) {         int tmp = r;         r = l;         l = tmp;       }       maps[to[r]] = max(to[l], maps[to[r]]);     }     l = 1;     long long ans = 0;     for (int i = 1; i <= n; i++) {       if (maps[i] >= l) l = maps[i] + 1;       ans += i - l + 1;     }     cout << ans << endl;   }
#include <bits/stdc++.h>   using namespace std;   int main() {     int t;     cin >> t;     while (t--) {       long long n, k;       cin >> n >> k;       long long i = 1, cnt = 0;       while (i < k && i < n) {         cnt++;         i = i * 2;       }       if (i < n) {         cnt += (n - i) / k;         if ((n - i) % k) cnt++;       }       cout << cnt << endl;     }     return 0;   }
#include <bits/stdc++.h>   using namespace std;   using UL = unsigned int;   using ULL = unsigned long long;   using LL = long long;   int N;   int CB[300000];   int CN[300000];   int Bbuf = 0, Nbuf = 0;   int F(int cn, int cb) {     int ans = 0;     for (int i = 0; i < (N); i++) {       ans = max(ans, abs(cn - CN[i]));       ans = max(ans, abs(cb - CB[i]));       ans = max(ans, abs((cn - CN[i]) - (cb - CB[i])));     }     return ans;   }   int FF(int cb) {     int lN, rN;     lN = -1;     rN = 500010;     if (cb == 0) lN = 0;     while (lN + 2 < rN) {       int m1N = (lN + lN + rN) / 3, m2N = (lN + rN + rN) / 3;       if (F(m1N, cb) < F(m2N, cb))         rN = m2N;       else         lN = m1N;     }     Nbuf = lN + 1;     return F(Nbuf, cb);   }   int main() {     cin >> N;     for (int i = 0; i < (N); i++) {       CB[i] = CN[i] = 0;       string S;       cin >> S;       for (char c : S)         if (c ==  B )           CB[i]++;         else if (c ==  N )           CN[i]++;     }     int lB, rB;     lB = -1;     rB = 500010;     while (lB + 2 < rB) {       int m1B = (lB + lB + rB) / 3, m2B = (lB + rB + rB) / 3;       if (FF(m1B) < FF(m2B))         rB = m2B;       else         lB = m1B;     }     Bbuf = lB + 1;     FF(Bbuf);     printf( %d n , F(Nbuf, Bbuf));     for (int i = 0; i < (Bbuf); i++) printf( B );     for (int i = 0; i < (Nbuf); i++) printf( N );     printf(  n );     return 0;   }
#include <bits/stdc++.h>   using namespace std;   set<int> S;   int n, a[500005], b[500005], q[500005], r;   int main() {     scanf( %d , &n);     n *= 2;     int tot = 0;     for (int i = 1; i <= n; i++) {       char c = getchar();       while (c !=  +  && c !=  - ) c = getchar();       if (c ==  + )         q[++r] = ++tot, b[i] = 0;       else {         int x;         scanf( %d , &x);         b[i] = x;         if (!r) return puts( NO ), 0;         a[q[r]] = x;         r--;       }     }     if (r) return puts( NO ), 0;     tot = 0;     for (int i = 1; i <= n; i++) {       if (!b[i]) {         ++tot;         S.insert(a[tot]);       } else {         int p = (*S.begin());         S.erase(S.begin());         if (p != b[i]) return puts( NO ), 0;       }     }     puts( YES );     for (int i = 1; i <= n / 2; i++) printf( %d  , a[i]);   }
#include <bits/stdc++.h>   using namespace std;   int main() {     int t;     scanf( %d , &t);     while (t--) {       int n;       scanf( %d , &n);       int a[n], b[n];       for (int i = 0; i < n; i++) scanf( %d%d , &a[i], &b[i]);       if (a[0] < b[0])         printf( NO n );       else {         int f = 1;         for (int i = 1; i < n; i++) {           if (a[i] < a[i - 1] || b[i] < b[i - 1]) {             f = 0;             break;           }           if (a[i] - a[i - 1] < b[i] - b[i - 1]) {             f = 0;             break;           }         }         if (f)           printf( YES n );         else           printf( NO n );       }     }     return 0;   }
#include <bits/stdc++.h>   using namespace std;   const double pi = acos(-1.0);   const int inf = (int)1e9;   struct vert {     int to, z, num;   };   struct ans {     int x, y, z;   };   const int N = (int)(1e5) + 5;   int n, m;   vector<vert> g[N];   vector<int> d(N, inf);   vector<int> dp(N, inf);   vector<int> pr(N, -1);   vector<bool> road(N);   void go() {     queue<int> q;     q.push(0);     d[0] = 0;     while (!q.empty()) {       int v = q.front();       q.pop();       for (int i = 0; i < (int)g[v].size(); ++i) {         int to = g[v][i].to;         if (d[to] == inf) {           d[to] = d[v] + 1;           q.push(to);         }       }     }   }   void getAns() {     queue<int> q;     q.push(n - 1);     dp[n - 1] = 0;     while (!q.empty()) {       int v = q.front();       q.pop();       for (int i = 0; i < (int)g[v].size(); ++i) {         int to = g[v][i].to;         int z = 1 - g[v][i].z;         if (d[to] + 1 == d[v]) {           if (dp[to] > dp[v] + z) {             dp[to] = dp[v] + z;             pr[to] = v;           }           q.push(to);         }       }     }   }   int main() {     cin >> n >> m;     vert p;     int kol = 0;     for (int i = 0; i < m; ++i) {       int x, y, z;       scanf( %d %d %d , &x, &y, &z);       --x;       --y;       p.z = z;       p.num = i;       if (z == 0) {         ++kol;       }       p.to = y;       g[x].push_back(p);       p.to = x;       g[y].push_back(p);     }     go();     getAns();     vector<ans> out;     ans a;     int v = 0;     for (int to = pr[0]; to != -1; to = pr[to]) {       vert now;       for (int k = 0; k < g[v].size(); ++k) {         if (g[v][k].to == to) {           now = g[v][k];           break;         }       }       road[now.num] = true;       if (now.z == 0) {         a.x = v + 1;         a.y = to + 1;         a.z = 1;         out.push_back(a);       }       v = to;     }     for (int i = 0; i < n; ++i) {       for (int j = 0; j < (int)g[i].size(); ++j) {         if (road[g[i][j].num]) {           continue;         }         if (g[i][j].z == 1) {           a.x = i + 1;           a.y = g[i][j].to + 1;           a.z = 0;           road[g[i][j].num] = true;           out.push_back(a);         }       }     }     cout << out.size() <<   n ;     for (int i = 0; i < out.size(); ++i) {       cout << out[i].x <<     << out[i].y <<     << out[i].z <<   n ;     }     return 0;   }
#include <bits/stdc++.h>   using namespace std;   int a[110], b[110];   int main() {     int n;     cin >> n;     for (int i = 1; i <= n; ++i) cin >> a[i];     sort(a + 1, a + 1 + n);     int aa = a[n];     cin >> n;     for (int i = 1; i <= n; ++i) cin >> b[i];     sort(b + 1, b + 1 + n);     int bb = b[n];     cout << aa <<     << bb << endl;   }
#include <bits/stdc++.h>   using namespace std;   const int INF = 0x3f3f3f3f;   const long long LINF = 0x3f3f3f3f3f3f3f3f;   int v[1010];   bool compare(pair<int, int> a, pair<int, int> b) {     if (a.second != b.second) return a.second > b.second;     if (v[a.first] != v[b.first]) return v[a.first] < v[b.first];     return a.first < b.first;   }   int main() {     ios_base::sync_with_stdio(0);     cin.tie(0);     int n;     cin >> n;     for (int i = 0; i < n; i++) cin >> v[i];     vector<pair<int, int> > ret;     for (int i = 0; i < n; i++) {       for (int j = i + 1; j < n; j++) {         if (v[j] < v[i]) ret.push_back({i, j});       }     }     sort(ret.begin(), ret.end(), compare);     cout << ret.size() <<   n ;     for (auto x : ret) {       cout << x.first + 1 <<     << x.second + 1 <<   n ;     }     exit(0);   }
#include <bits/stdc++.h>   using namespace std;   void fast() {     ios_base::sync_with_stdio(0);     cin.tie(NULL), cout.tie(NULL);   }   int gcd(int a, int b) { return b == 0 ? a : gcd(b, a % b); }   int lcm(int a, int b) { return a * (b / gcd(a, b)); }   char maze[1001][1001];   int main() {     fast();     int num, one = 0, two = 0, there = 0, six = 0, fou = 0;     cin >> num;     ;     for (int i = 0; i < num; i++) {       int x;       cin >> x;       one += bool(x == 1);       two += bool(x == 2);       there += bool(x == 3);       fou += bool(x == 4);       six += bool(x == 6);     }     if ((fou + six) != num / 3 || (one) != num / 3 || (two + there) != num / 3) {       cout << -1 << endl;       return 0;     }     vector<string> vs;     for (int i = 0; i < num / 3; i++) {       string s =   ;       s +=  1 ;       s +=    ;       if (there == six && six && there) {         s +=  3 , s +=    , s +=  6 ;         six--, there--;       } else if (two) {         s +=  2 ;         s +=    ;         if (fou)           s +=  4 , fou--;         else if (six)           s +=  6 , six--;         else {           cout << -1 << endl;           return 0;         }         two--;       } else {         cout << -1 << endl;         return 0;       }       vs.push_back(s);     }     for (int i = 0; i < vs.size(); i++) {       cout << vs[i] << endl;     }     return 0;   }
#include <bits/stdc++.h>   using namespace std;   int main() {     ios::sync_with_stdio(0);     cin.tie(0);     const int maxN = 2 * 1e5;     int answers[maxN];     int n, m, x, neg = 0, pos = 0;     cin >> n >> m;     for (int i = 0; i < n; i++) {       cin >> x;       if (x == -1)         neg++;       else         pos++;     }     int li, ri, range;     for (int i = 0; i < m; i++) {       cin >> li >> ri;       range = ri - li + 1;       if (range % 2 != 0)         answers[i] = 0;       else if (pos >= range / 2 && neg >= range / 2) {         answers[i] = 1;       } else {         answers[i] = 0;       }     }     for (int i = 0; i < m; i++) {       cout << answers[i] << endl;     }     return 0;   }
#include <bits/stdc++.h>   using namespace std;   const int maxn = 1e5 * 4;   inline int get() {     int x;     cin >> x;     return x;   }   inline long long getlong() {     long long x;     cin >> x;     return x;   }   inline string getString() {     string s;     cin >> s;     return s;   }   template <typename T>   inline vector<T> getvector(int len) {     vector<T> a(len);     for (auto &it : a) cin >> it;     return a;   }   inline vector<int> getvector(int len) {     vector<int> a(len);     for (auto &it : a) cin >> it;     return a;   }   inline vector<pair<int, int>> getvector_andPairCnt(int len) {     vector<pair<int, int>> a(len);     int i = 1;     for (auto &it : a) {       it.second = i;       i++;       cin >> it.first;     }     return a;   }   double power_log(double power, double val) { return log(val) / log(power); }   template <typename T>   T sqr(T x) {     return x * x;   }   template <typename T>   ostream &operator<<(ostream &os, const vector<T> &v) {     for (auto it : v) os << it <<    ;     os <<   n ;     return os;   }   template <typename T, typename H>   inline vector<pair<T, H>> getvector_andBiPair(int len) {     vector<pair<T, H>> a(len);     for (auto &it : a) {       cin >> it.first >> it.second;     }     return a;   }   template <typename T>   inline set<T> vector_to_set(const vector<T> &vec) {     set<T> s;     for (auto &it : vec) s.insert(it);     return s;   }   int main() {     auto n = getlong(), k = getlong();     int t = get();     if (t <= k) {       cout << t;     } else {       if (t >= n) {         cout << (n + k) - t;       } else {         cout << k;       }     }   }
#include <bits/stdc++.h>   using namespace std;   void split(string &s, vector<string> &v, string &sep) {     int current, previous = 0;     current = s.find_first_of(sep);     while (current != string::npos) {       v.push_back(s.substr(previous, current - previous));       previous = current + 1;       current = s.find_first_of(sep, previous);     }     v.push_back(s.substr(previous, current - previous));   }   int main() {     int n, flag = 0;     cin >> n;     for (int i = 0; i < n; i++) {       int temp;       cin >> temp;       if (temp) {         flag = 1;       }     }     if (flag) {       cout <<  HARD ;       cout << endl;     } else {       cout <<  EASY ;       cout << endl;     }     return 0;   }
#include <bits/stdc++.h>   using namespace std;   int has[205][205];   int vis[205][205];   vector<pair<int, int> > q;   int gcd(int x, int y) {     if (x < y) swap(x, y);     while (y) {       int t = x % y;       x = y;       y = t;     }     return x;   }   int main() {     int n;     scanf( %d , &n);     for (int i = 0; i < n; i++) {       int x, y;       scanf( %d%d , &x, &y);       q.push_back(make_pair(y + 100, x + 100));       has[x + 100][y + 100] = 1;     }     sort(q.begin(), q.end());     if (n < 3) {       printf( 0 n );       return 0;     }     long long ans1 = 0;     int hehe = 0;     int L = q.size();     for (int i = 1; i <= 200; i++) {       for (int j = 1; j <= 200; j++) {         if (gcd(i, j) != 1) continue;         memset(vis, 0, sizeof(vis));         for (int k = 0; k < L; k++) {           int yy = q[k].first;           int xx = q[k].second;           if (vis[xx][yy]) continue;           int res = 0;           while (xx <= 200 && yy <= 200) {             vis[xx][yy] = 1;             res += has[xx][yy];             xx += i;             yy += j;           }           if (res > 2) ans1 += (long long)res * (res - 1) * (res - 2) / 6;         }         memset(vis, 0, sizeof(vis));         for (int k = 0; k < L; k++) {           int yy = q[k].first;           int xx = q[k].second;           if (vis[xx][yy]) continue;           int res = 0;           while (xx >= 0 && yy <= 200) {             vis[xx][yy] = 1;             res += has[xx][yy];             xx -= i;             yy += j;           }           if (res > 2) ans1 += (long long)res * (res - 1) * (res - 2) / 6;         }       }     }     for (int i = 0; i <= 200; i++) {       int xx = i;       int yy = 0;       int res = 0;       while (xx <= 200 && yy <= 200) {         res += has[xx][yy];         yy += 1;       }       if (res >= 3) {         ans1 += (long long)res * (res - 1) * (res - 2) / 6;       }     }     for (int i = 0; i <= 200; i++) {       int xx = 0;       int yy = i;       int res = 0;       while (xx <= 200 && yy <= 200) {         res += has[xx][yy];         xx += 1;       }       if (res >= 3) {         ans1 += (long long)res * (res - 1) * (res - 2) / 6;       }     }     long long ans = (long long)n * (n - 1) * (n - 2) / 6 - ans1;     cout << ans << endl;     return 0;   }
#include <bits/stdc++.h>   using namespace std;   int main() {     long long N;     scanf( %I64d , &N);     int l = 1, r = 20000000, ans = 0;     while (l <= r) {       int mid = (l + r) >> 1;       if ((long long)mid * (mid + 1) < N * 2)         ans = mid, l = mid + 1;       else         r = mid - 1;     }     printf( %I64d , N - (long long)ans * (ans + 1) / 2);     return 0;   }
#include <bits/stdc++.h>   #pragma comment(linker,  /STACK:96777216 )   using namespace std;   const double NOT_FOUND = -1000000000;   const double EPS = 0.00000001;   const double PI = acos(-1.0);   struct point {     double x, y;   };   point make_point(double a, double b) {     point c;     c.x = a;     c.y = b;     return c;   }   struct line {     double A, B, C;   };   line make_line(double a, double b, double c) {     line p;     p.A = a;     p.B = b;     p.C = c;     return p;   }   struct circle {     double R;     point center;     vector<double> intersects;   };   circle make_circle(point c, double r) {     circle C;     C.R = r;     C.center = c;     return C;   }   int main() {     int N, K;     cin >> N >> K;     if (K > N) {       cout << -1;       return 0;     }     if (K == 1 && N > 1) {       cout << -1;       return 0;     }     if (K == N) {       char p =  a ;       for (int i = 0; i < N; i++) {         cout << p;         p++;       }       return 0;     }     string S;     for (char c =  a  + K - 1; c >  b ; c--) {       S += c;       N--;     }     if (N % 2) {       S +=  a ;       N--;     }     for (int i = 0; i < N; i += 2) S +=  ba ;     for (int i = (int)S.length() - 1; i >= 0; i--) cout << S[i];     return 0;   }
#include <bits/stdc++.h>   using namespace std;   int prim[10] = {2, 3, 5, 7, 11, 13, 17, 19, 23, 29};   int n;   long long ans;   void DFS(int a, int b, long long temp) {     if (temp < ans && a == n) ans = temp;     if (a >= n) return;     for (int i = 1; i <= 64; i++) {       if (ans / prim[b] < temp) break;       temp *= prim[b];       DFS(a * (i + 1), (b + 1), temp);     }   }   int main() {     while (scanf( %d , &n) != EOF) {       ans = LONG_LONG_MAX;       DFS(1, 0, 1);       printf( %lld n , ans);     }     return 0;   }