malteklaes/cpp-code-code_search_net-style huggingface dataset:
#include <bits/stdc++.h>   using namespace std;   long long n, num, m;   map<long long, bool> isInsert;   priority_queue<long long, vector<long long>, greater<long long> > pq;   vector<string> vs;   vector<long long> vi;   int main() {     m = 0;     cin >> n;     while (n--) {       string s;       cin >> s;       if (s ==  insert ) {         cin >> num;         pq.push(num);         isInsert[num] = true;         vs.push_back(s);         vi.push_back(num);         m++;       } else if (s ==  getMin ) {         cin >> num;         if (!pq.empty() && pq.top() == num) {           vs.push_back(s);           vi.push_back(num);           m++;         } else {           if (!isInsert[num]) {             pq.push(num);             isInsert[num] = true;             vs.push_back( insert );             vi.push_back(num);             m++;           }           while (pq.top() != num) {             isInsert[pq.top()] = false;             vs.push_back( removeMin );             vi.push_back(-10000000000);             m++;             pq.pop();           }           vs.push_back(s);           vi.push_back(num);           m++;         }       } else {         m++;         if (pq.empty()) {           pq.push(2);           isInsert[2] = true;           vs.push_back( insert );           vi.push_back(2);           m++;         }         isInsert[pq.top()] = false;         pq.pop();         vs.push_back(s);         vi.push_back(-10000000000);       }     }     cout << m <<   n ;     int size = vs.size();     for (int i = 0; i < size; ++i) {       cout << vs[i] <<    ;       if (vi[i] != -10000000000)         cout << vi[i] <<   n ;       else         cout <<   n ;     }     return 0;   }
#include <bits/stdc++.h>   int team[1000010][2], ans[1010], n, x;   bool used[1010];   int main() {     scanf( %d , &n);     n *= 2;     for (int i = 1; i <= n; i++)       for (int j = 1; j < i; j++) {         scanf( %d , &x);         team[x][0] = i;         team[x][1] = j;       }     used[0] = 1;     for (int i = 1000000; i > 0; i--) {       if (!used[team[i][0]] && !used[team[i][1]]) {         used[team[i][0]] = 1;         used[team[i][1]] = 1;         ans[team[i][0]] = team[i][1];         ans[team[i][1]] = team[i][0];       }     }     for (int i = 1; i < n; i++) printf( %d  , ans[i]);     printf( %d n , ans[n]);     return 0;   }
#include <bits/stdc++.h>   using namespace std;   int judge(int n) {     int flag = 0;     for (int i = 2; i <= n / 2; i++) {       if (n % i == 0) {         flag = 1;         break;       }     }     if (flag)       return 0;     else       return 1;   }   int main() {     int n;     cin >> n;     for (int i = 1; i <= 1000; i++) {       int sum = i * n + 1;       if (judge(sum) == 0) {         printf( %d n , i);         return 0;       }     }     return 0;   }
#include <bits/stdc++.h>   using namespace std;   const long long int inf = 1e18;   const int N = 1e5 + 5;   void solve() {     int n;     cin >> n;     set<int> st;     for (int i = 0; i < n; i++) {       int x;       cin >> x;       if (x % 2 == 0) st.insert(x);     }     int ans = 0;     while (!st.empty()) {       int x = *st.rbegin();       st.erase(x);       if (x % 2 == 0) st.insert(x / 2), ans++;     }     cout << ans <<   n ;   }   int main() {     ios_base::sync_with_stdio(false);     cin.tie(NULL);     cout << fixed << showpoint;     cout << setprecision(9);     int test = 1;     cin >> test;     while (test--) {       solve();     }     return 0;   }
#include <bits/stdc++.h>   using namespace std;   const long long maxN = 1e5 + 13;   long long root, sz[maxN], h[maxN], ans, val[maxN], m, n, pw[maxN], pre[maxN];   map<long long, long long> mp;   vector<long long> vec;   vector<pair<long long, long long>> adj[maxN];   bool mark[maxN], fl;   void dfs(long long v, long long p) {     sz[v] = 1;     for (auto a : adj[v]) {       long long u = a.first, w = a.second;       if (u != p && !mark[u]) {         dfs(u, v);         sz[v] += sz[u];       }     }   }   long long getpw(long long a, long long b) {     long long ret = 1;     for (; b; b >>= 1, a = 1ll * a * a % m)       if (b & 1) ret = 1ll * ret * a % m;     return ret;   }   void precomp() {     pw[0] = 1;     for (long long i = 1; i < n + 5; i++) pw[i] = pw[i - 1] * 10 % m;     long long tmp = m, tot = m;     for (long long p = 2; p * p <= tmp; p++)       if (tmp % p == 0) {         tot = tot / p * (p - 1);         while (tmp % p == 0) tmp /= p;       }     if (tmp > 1) tot = tot / tmp * (tmp - 1);     pre[0] = 1;     pre[1] = getpw(10, tot - 1);     for (long long i = 2; i < n + 5; i++) pre[i] = 1ll * pre[i - 1] * pre[1] % m;   }   void du(long long v, long long p) {     for (auto a : adj[v]) {       long long u = a.first, w = a.second;       if (u != p && !mark[u]) {         h[u] = h[v] + 1;         val[u] = ((val[v]) + w * pw[h[v]]) % m;         if (val[u] == 0) ans++;         du(u, v);       }     }   }   void dd(long long v, long long p, long long cur) {     if (v != root) vec.push_back(v);     reverse(adj[v].begin(), adj[v].end());     for (auto a : adj[v]) {       long long u = a.first, w = a.second;       if (u != p && !mark[u]) {         long long nwcur = (cur * 10 + w) % m;         long long wnt = ((1ll * pre[h[u]] * ((-nwcur) % m + m)) + m) % m;         ans += mp[wnt];         dd(u, v, nwcur);         if (nwcur == 0 && fl) ans++;         if (v == root) {           while (vec.size()) {             long long u = vec.back();             vec.pop_back();             mp[val[u]]++;           }         }       }     }   }   void calc(long long v) {     long long tmp = ans;     h[v] = 0;     val[v] = 0;     du(v, -1);     mp.clear();     fl = 0;     dd(v, -1, 0);     mp.clear();     fl = 1;     dd(v, -1, 0);   }   void solve(long long v) {     dfs(v, -1);     root = v;     long long p = -1;     bool fl = true;     while (fl) {       fl = false;       for (auto a : adj[v]) {         long long u = a.first;         if (!mark[u] && u != p && sz[u] > sz[root] / 2) {           p = v;           v = u;           fl = true;           break;         }       }     }     mark[v] = true;     root = v;     calc(v);     for (auto a : adj[v]) {       long long u = a.first;       if (!mark[u]) solve(u);     }   }   int32_t main() {     ios::sync_with_stdio(false);     cin.tie(0);     cout.tie(0);     cin >> n >> m;     precomp();     for (long long i = 0; i < n - 1; i++) {       long long a, b, w;       cin >> a >> b >> w;       a++;       b++;       w %= m;       adj[a].push_back({b, w});       adj[b].push_back({a, w});     }     solve(1);     cout << ans << endl;   }
#include <bits/stdc++.h>   using namespace std;   void solve() {     int n, M;     cin >> n >> M;     vector<char> s(n);     int m = M;     vector<int> p(m), b(n), yes(n, 0), cnt(26, 0);     for (int i = 0; i < n; i++) {       cin >> s[i];       cnt[s[i] -  a ]++;     }     for (int i = 0; i < m; i++) {       cin >> p[i];       p[i]--;     }     sort(p.begin(), p.end());     int top = 0;     for (int i = 0; i < n; i++) {       if (top >= M) break;       if (p[top] != i)         cnt[s[i] -  a ] += m;       else {         int t = top;         while (top < M - 1 && p[top] == p[top + 1]) top++;         int c = ++top - t;         cnt[s[i] -  a ] += m;         m -= c;       }     }     for (int i = 0; i < 26; i++) cout << cnt[i] <<    ;     cout << endl;     return;   }   int main() {     ios_base::sync_with_stdio(0);     cin.tie(0);     cout.tie(0);     int t;     cin >> t;     while (t--) {       solve();     }     return 0;   }
#include <bits/stdc++.h>   using namespace std;   struct tree {     tree() : par(NULL), val(0) { next.clear(); };     map<int, tree *> next;     tree *par;     int val;     void setParent(tree *p) { par = p; }   };   tree *moveDown(tree *root, int n) {     tree *ret = NULL;     if (root->next.count(n)) {       ret = root->next[n];     } else {       ret = new tree();       ret->setParent(root);       root->next[n] = ret;     }     ret->val++;     return ret;   }   tree *moveUp(tree *root) { return root->par; }   char line[1000003];   char tmp[5002];   map<string, int> f;   vector<int> v;   int go(tree *root, int what) {     int ans = 0;     for (map<int, tree *>::iterator it = root->next.begin();          it != root->next.end(); ++it) {       if (it->first == what)         ans += it->second->val + go(it->second, what);       else         ans += go(it->second, what);     }     return ans;   }   int calc(tree *root, int ind = 0) {     if (ind + 1 == v.size()) {       return go(root, v[ind]);     }     int ans = 0;     for (map<int, tree *>::iterator it = root->next.begin();          it != root->next.end(); ++it) {       if (it->first == v[ind])         ans += calc(it->second, ind + 1);       else         ans += calc(it->second, ind);     }     return ans;   }   void out(tree *root, int par = -1) {     for (map<int, tree *>::iterator it = root->next.begin();          it != root->next.end(); ++it) {       out(it->second, it->first);     }   }   int main() {     tree *root = new tree(), *root1 = root;     char str[25] = {0};     gets(line);     int l = strlen(line), tot = 0;     map<string, int>::iterator it;     for (int i = 0; i < l; ++i) {       if (line[i] ==  < ) {         int type = 0, len = 0;         if (line[i + 1] ==  / ) type = 1;         for (i = i + 1 + (type == 1); i < l; ++i) {           if (line[i] ==  / )             type = 2;           else if (line[i] ==  > )             break;           else             str[len++] = line[i];         }         int num = 0;         str[len] =   0 ;         it = f.find(string(str));         if (it != f.end())           num = it->second;         else           f[string(str)] = num = tot++;         if (type == 0) {           root = moveDown(root, num);         } else if (type == 1) {           root = moveUp(root);         } else {           moveDown(root, num);         }       }     }     int q;     scanf( %d n , &q);     while (q--) {       gets(tmp);       istringstream ss(tmp);       string s;       bool ok = true;       v.clear();       while (ss >> s) {         it = f.find(s);         if (it != f.end()) {           v.push_back(it->second);         } else {           ok = false;           break;         }       }       if (ok)         printf( %d n , calc(root1));       else         printf( 0 n );     }     return 0;   }
#include <bits/stdc++.h>   using namespace std;   long long inv(long long a, long long mod) {     long long b = mod, p = 1, q = 0;     while (b) {       long long c = a / b, d = a;       a = b;       b = d % b;       d = p;       p = q;       q = d - c * q;     }     return (p + mod) % mod;   }   map<tuple<long long, long long, long long, long long, int>, long long> mp;   long long sol(long long w0, long long w1, long long w2, long long a, int m) {     long long res = 0;     long long mod = 998244353;     tuple<long long, long long, long long, long long, int> key =         make_tuple(w0, w1, w2, a, m);     if (mp.find(key) != mp.end()) return mp[key];     if (m == 0) {       res = w2;     } else {       long long sum = w0 + w1 + w2;       long long isum = inv(sum, mod);       long long t0 = w0 * isum % mod * sol(w0 - 1, w1, w2, a, m - 1) % mod;       long long t1 = w1 * isum % mod * sol(w0, w1 + 1, w2, a, m - 1) % mod;       long long t2 =           w2 * isum % mod * sol(w0, w1, w2 + (a == 0 ? -1 : 1), a, m - 1) % mod;       res = (t0 + t1 + t2) % mod;     }     mp[key] = res;     return res;   }   int main() {     ios_base::sync_with_stdio(false);     cin.tie(NULL);     int n, m;     cin >> n >> m;     vector<long long> a(n), w(n);     for (int i = 0; i < n; i++) cin >> a[i];     for (int i = 0; i < n; i++) cin >> w[i];     long long mod = 998244353;     vector<long long> res(n);     for (int i = 0; i < n; i++) {       long long w0 = 0, w1 = 0;       for (int j = 0; j < n; j++) {         if (j == i) continue;         if (a[j] == 0)           w0 = (w0 + w[j]) % mod;         else           w1 = (w1 + w[j]) % mod;       }       long long w2 = w[i];       res[i] = sol(w0, w1, w2, a[i], m);     }     for (int i = 0; i < n; i++) {       cout << res[i] <<   n ;     }     return 0;   }
#include <bits/stdc++.h>   using namespace std;   double ans = 1111111111;   int ap[111111], bp[111111], bt[111111], n, m, a, b, l, r, m1, m2, minap, minbp;   double dist(double ax, double ay, double bx, double by) {     return sqrt((bx - ax) * (bx - ax) + (by - ay) * (by - ay));   }   double f(int i, int j) {     return dist(0, 0, a, ap[i]) + dist(a, ap[i], b, bp[j]) + bt[j];   }   int main() {     scanf( %d%d%d%d , &n, &m, &a, &b);     for (int i = 0; i < n; i++) scanf( %d , &ap[i]);     for (int i = 0; i < m; i++) scanf( %d , &bp[i]);     for (int i = 0; i < m; i++) {       scanf( %d , &bt[i]);       l = 0, r = n - 1;       while (r - l >= 3) {         m1 = l + (r - l) / 3;         m2 = r - (r - l) / 3;         if (f(m1, i) < f(m2, i))           r = m2;         else           l = m1;       }       for (int j = l; j <= r; j++) {         if (f(j, i) < ans) ans = f(j, i), minap = j, minbp = i;       }     }     printf( %d %d , minap + 1, minbp + 1);     return 0;   }
#include <bits/stdc++.h>   using namespace std;   int main() {     int n, i, sum, sum1, count = 1;     cin >> n;     int arr[4 * n + 1];     arr[0] = 0;     for (i = 1; i <= 4 * n - 3; i = i + 4) {       cin >> arr[i] >> arr[i + 1] >> arr[i + 2] >> arr[i + 3];       if (i == 1)         sum = arr[1] + arr[2] + arr[3] + arr[4];       else {         sum1 = arr[i] + arr[i + 1] + arr[i + 2] + arr[i + 3];         if (sum1 > sum) count++;       }     }     cout << count;   }
#include <bits/stdc++.h>   using namespace std;   const double EPS = 1e-10;   const double PI = acos(-1.0);   template <class T>   T gcd(T a, T b) {     for (T c; b; c = a, a = b, b = c % b)       ;     return a;   }   template <class T>   void out(const vector<T> &a) {     for (int i = 0; i < ((int)(a).size()); ++i) cout << a[i] <<    ;     cout << endl;   }   int countbit(int n) { return n == 0 ? 0 : 1 + countbit(n & (n - 1)); }   const int d8[8][2] = {{1, 0}, {-1, 0},  {0, 1},  {0, -1},                         {1, 1}, {-1, -1}, {1, -1}, {-1, 1}};   const int d4[4][2] = {{1, 0}, {-1, 0}, {0, 1}, {0, -1}};   inline long long cross(const complex<long long> &a,                          const complex<long long> &b) {     return (conj(a) * b).imag();   }   inline long long cross(const complex<long long> &a, const complex<long long> &b,                          const complex<long long> &c) {     return cross(b - a, c - a);   }   inline long long dot(const complex<long long> &a, const complex<long long> &b) {     return (conj(a) * b).real();   }   inline bool which_part(const complex<long long> &p) {     return p.imag() > 0 || p.imag() == 0 && p.real() > 0;   }   namespace std {   bool operator<(const complex<long long> &a, const complex<long long> &b) {     int flag_a = which_part(a);     int flag_b = which_part(b);     if (flag_a != flag_b) return flag_a < flag_b;     return cross(a, b) > 0;   }   }  // namespace std   struct node {     complex<long long> p;     int color;   };   struct cmp {     complex<long long> p;     cmp(const complex<long long> &p) : p(p) {}     bool operator()(const node &a, const node &b) { return a.p - p < b.p - p; }   };   node a[1000], b[2000];   int main() {     int n, m;     scanf( %d %d , &n, &m);     for (int i = 0; i < n; ++i) {       long long x, y;       scanf( %I64d %I64d , &x, &y);       a[i].p = complex<long long>(x, y);       a[i].color = 0;     }     for (int i = 0; i < m; ++i) {       long long x, y;       scanf( %I64d %I64d , &x, &y);       a[n + i].p = complex<long long>(x, y);       a[n + i].color = 1;     }     long long ret = 0;     for (int i = 0; i < n; ++i) {       int L = 0;       for (int j = i + 1; j < n + m; ++j) {         if (j == i) continue;         b[L++] = a[j];       }       sort(b, b + L, cmp(a[i].p));       for (int j = 0; j < L; ++j) b[L + j] = b[j];       int u;       for (u = 1; cross(a[i].p, b[0].p, b[u].p) > 0; ++u)         ;       for (int j = 0; j < L; ++j) {         if (b[j].color == 1) continue;         bool found = false;         complex<long long> p;         for (u = max(u, j + 1); cross(a[i].p, b[j].p, b[u].p) > 0; ++u)           ;         for (int k = j + 1; k != u; ++k) {           if (b[k].color == 1) {             if (!found || cross(b[j].p, p, b[k].p) > 0) {               found = true;               p = b[k].p;             }           } else {             if (!found || cross(b[j].p, p, b[k].p) > 0) {               ++ret;             }           }         }       }     }     printf( %I64d n , ret);     return 0;   }
#include <bits/stdc++.h>   using namespace std;   const long long N = 2 * 1e5 + 100;   long long n, m, k, w, a[N], d[N], p[N], fa[N], vi[N];   long long tot, first[N], nxt[N * 2], point[N * 2], len[N * 2];   priority_queue<pair<long long, long long>, vector<pair<long long, long long> >,                  greater<pair<long long, long long> > >       q;   struct node {     long long u, v, w;   } sh[N];   bool cmp(node a, node b) { return a.w < b.w; }   long long find(long long x) {     return (x == fa[x]) ? fa[x] : fa[x] = find(fa[x]);   }   inline long long read() {     long long f = 1, x = 0;     char s = getchar();     while (s <  0  || s >  9 ) {       if (s ==  - ) f = -1;       s = getchar();     }     while (s >=  0  && s <=  9 ) {       x = x * 10 + s -  0 ;       s = getchar();     }     return x * f;   }   inline void add_edge(long long x, long long y, long long z) {     nxt[++tot] = first[x];     first[x] = tot;     point[tot] = y;     len[tot] = z;   }   inline bool merge(long long a, long long b) {     long long fax = find(a), fay = find(b);     if (fax == fay) return 0;     fa[fax] = fay;     return 1;   }   signed main() {     tot = -1;     memset(first, -1, sizeof(first));     n = read();     m = read();     for (long long i = 1; i <= m; i++) {       long long u = read(), v = read(), w = read();       add_edge(u, v, w);       add_edge(v, u, w);     }     k = read();     for (long long i = 1; i <= k; i++) a[i] = read();     for (long long i = 1; i <= n; i++) d[i] = 1e18;     for (long long i = 1; i <= k; i++)       p[a[i]] = a[i], d[a[i]] = 0, q.push(make_pair(0, a[i]));     while (!q.empty()) {       long long x = q.top().second;       q.pop();       if (vi[x]) continue;       vi[x] = 1;       for (long long i = first[x]; i != -1; i = nxt[i]) {         long long u = point[i];         if (d[u] > d[x] + len[i]) {           d[u] = d[x] + len[i];           p[u] = p[x];           q.push(make_pair(d[u], u));         }       }     }     for (long long i = 0; i <= tot; i += 2) {       long long u = point[i], v = point[i ^ 1];       if (p[u] == p[v]) continue;       sh[++w] = (node){p[u], p[v], d[u] + d[v] + len[i]};     }     sort(sh + 1, sh + 1 + w, cmp);     for (long long i = 1; i <= n; i++) fa[i] = i;     long long ans = d[1];     for (long long i = 1; i <= w; i++)       if (merge(sh[i].u, sh[i].v)) ans += sh[i].w;     printf( %lld n , ans);   }
#include <bits/stdc++.h>   char input[5001];   int data[1000];   using namespace std;   int main() {     int r = 0;     stack<int> s;     char temp[10];     int b = 0, p, count;     while (scanf( %s , input) != EOF) {       for (int i = 0; i < strlen(input); i++) {         if (input[i] ==  < ) {           count = 0;           i++;           while (i < strlen(input) && input[i] !=  > ) {             temp[count++] = input[i++];           }         }         if (i < strlen(input) && input[i] ==  > ) {           temp[count] =   0 ;           fflush(0);           if (strcmp(temp,  table ) == 0) {             b = 0;             s.push(b);           } else if (strcmp(temp,  td ) == 0) {             p = s.top();             p++;             s.pop();             s.push(p);           } else if (strcmp(temp,  /table ) == 0) {             data[r++] = s.top();             s.pop();           }         } else if (i < strlen(input) && input[i] !=  < )           temp[count++] = input[i];       }     }     sort(data, data + r);     for (int k = 0; k < r; k++) printf( %d  , data[k]);     return 0;   }
#include <bits/stdc++.h>   using namespace std;   void solve() {}   int main() {     ios_base::sync_with_stdio(0);     cin.tie(0);     cout.tie(0);     int t = 1;     long long k = 1;     vector<long long> v;     while (1) {       long long tmp = ((1 << k) - 1) * (1 << (k - 1));       if (tmp > 100001) break;       v.push_back(tmp);       k++;     }     while (t--) {       long long n;       cin >> n;       for (int i = (int)v.size() - 1; i > -1; i--) {         if (n % v[i] == 0) {           cout << v[i] <<   n ;           break;         }       }     }     return 0;   }
#include <bits/stdc++.h>   using namespace std;   int abs(int x) { return x >= 0 ? x : -x; }   int main() {     int n;     cin >> n;     while (n--) {       vector<int> x;       vector<int> y;       char tmp;       for (int i = 0; i < 8; i++) {         for (int j = 0; j < 8; j++) {           cin >> tmp;           if (tmp ==  K ) {             x.push_back(i);             y.push_back(j);           }         }       }       int tx, ty;       tx = abs(x[0] - x[1]);       ty = abs(y[0] - y[1]);       if ((tx % 4 == 0) && (ty % 4 == 0) && ((tx + ty) % 4 == 0))         cout <<  YES  << endl;       else         cout <<  NO  << endl;     }     return 0;   }
#include <bits/stdc++.h>   using namespace std;   string s;   int n, i, j, k, mx = 0, sum = 0, vis[5005], letter[26], check[26][5005][26], ok;   double ans = 0;   int main() {     cin >> s;     n = s.length();     s = s + s;     for (i = 0; i < n; i++) {       letter[s[i] -  a ]++;       for (j = i; j < i + n; j++) {         check[s[i] -  a ][j - i + 1][s[j] -  a ]++;       }     }     for (i = 0; i < 26; i++) {       if (!letter[i]) continue;       mx = -1;       for (j = 2; j <= n; j++) {         sum = 0;         for (k = 0; k < 26; k++)           if (check[i][j][k] == 1) sum += 1;         mx = max(mx, sum);       }       ans += 1.0 * mx / n;     }     printf( %lf , ans);     return 0;   }
#include <bits/stdc++.h>   using namespace std;   int main() {     int n;     cin >> n;     vector<pair<int, int>> sms;     int time1, amount1;     for (int i = 0; i < n; i++) {       cin >> time1 >> amount1;       sms.push_back(make_pair(time1, amount1));     }     int time = 0;     int amount = 0;     int maxamount = 0;     for (int i = 0; i < n; i++) {       if (amount <= sms[i].first - time) {         time = sms[i].first;         amount = sms[i].second;       } else {         amount -= sms[i].first - time;         time += sms[i].first - time;         amount += sms[i].second;       }       if (amount > maxamount) maxamount = amount;     }     if (amount) {       if (amount > maxamount) maxamount = amount;       time += amount;     }     cout << time <<     << maxamount << endl;     return 0;   }
#include <bits/stdc++.h>   using namespace std;   const int maxn = 100005;   int n, t, cc, flag[maxn], a[maxn];   int main() {     cin >> n;     for (int i = 1; i <= n; i++) cin >> a[i];     if (n == 1) {       cout <<  +  << endl;       return 0;     }     for (int i = 1; i <= n; i++) flag[i] = 1;     flag[n] = -1;     flag[n - 1] = -1;     t = a[n] - a[n - 1];     for (int i = n - 2; i >= 1; i--) {       if (t >= a[i]) {         t = t - a[i];         flag[i + 1] *= -1;         flag[i] *= -1;       } else {         t = a[i] - t;         flag[i + 1] *= -1;       }     }     cc = 1;     for (int i = 1; i <= n; i++) {       cc *= flag[i];       if (cc < 0)         cout <<  - ;       else         cout <<  + ;     }     cout << endl;     return 0;   }