#!/bin/sh # This is a shar archive. # The rest of this file is a shell script which will extract: # # README # 6_11.h 6_11_add.c 6_11_c1.c 6_11_c2.c 6_11_c3.c 6_11_cd.c 6_11_cmp.c 6_11_div.c # 6_11_eq.c 6_11_eq1.c 6_11_eq2.c 6_11_ge.c 6_11_gt.c 6_11_in.c 6_11_le.c 6_11_lt.c # 6_11_min.c 6_11_mul.c 6_11_ne.c 6_11_neg.c 6_11_out.c 6_11_pos.c 6_11a.h 6_11b.h # arbint.h ctype.h makefile outputarb.c runtests3 tst.c tst1.cmp tst1.in tst2.cmp # tst2.in tst3.cmp tst3.in tst4.cmp tst4.in tst5.cmp tst5.in tst6.cmp tst6.in tst7.cmp tst7.in # # To extract the files from this shell archive file simply # create a directory for this file, move the archive file # to it and enter the command # # sh filename # # The files will be extracted automatically. # Note: Do not use csh. # # Archive created: Mon Jul 30 23:04:57 EDT 1990 # echo x - README sed 's/^X//' > README << '!EOF!' The files contained here are the files for Exercise 6.11 as originally included in my book. Unfortunately, there is a nonportability that slipped through during my testing. The problem comes about due to the way that unsigned variables are promoted. Some compilers follow the ANSI C rules which say that preserves value for unsigned promotions, and other compilers follow an older rule that the sign is preserved. For Exercise 6.11, this affects the way that combinations of ARB_type to create an ARB_Ltype is performed. Anyplace within the following code that has a statement such as ARB_Ltype t = uv[I] * v_j + wv[iplusj] + k; it may or may not work on your machine, depending on how your compiler works. Your best bet is to compile the code, and then run the test cases. If it passes, you're okay. If not, you'll have to make some changes. The second edition of the Answer Book will have this mess fixed in a way which will be more portable. My apologies. Tony Hansen hansen@pegasus.att.com, tony@attmail.com att!pegasus!hansen, attmail!tony !EOF! ls -l README echo x - 6_11.h sed 's/^X//' > 6_11.h << '!EOF!' /* Copyright (c) 1990 by AT&T Bell Telephone Laboratories, Incorporated. */ /* The C++ Answer Book */ /* Tony Hansen */ /* All rights reserved. */ /* arbitrary precision arithmetic Exercise 6.11 All numbers are stored in an array of unsigned shorts in two's complement format. Its length is all maintained separately. */ #ifndef ARBINT_H #define ARBINT_H # include # include # include # include typedef unsigned short ARB_type; typedef unsigned long ARB_Ltype; const ARB_Ltype ARB_base = 0x10000; class arbint { struct arep { ARB_type *value; // ptr to value int length; // length of data int refcnt; // reference count }; arep *p; // ptr to data arbint(ARB_type*,int); /* DELETE */ friend void dodivmod(const arbint&, /* DELETE */ const arbint&, arbint&, arbint&); /* DELETE */ #include "6_11a.h" /* DELETE isneg() */ #include "6_11b.h" /* DELETE arb_cmp() */ public: arbint(); // arbint x; or // new arbint; ~arbint(); // delete arbint; arbint(arbint&); // arbint x = y; arbint(long); // arbint x = 35L; arbint(unsigned long); // arbint x = 35LU; arbint(double); // arbint x = 35.0; arbint& operator=(arbint&); // x = y; arbint& operator=(long); // x = 35L; arbint& operator=(unsigned long);// x = 35LU; arbint& operator=(double); // x = 35.0; friend arbint operator+ (const arbint&, const arbint&); friend arbint operator- (const arbint&, const arbint&); friend arbint operator* (const arbint&, const arbint&); friend arbint operator/ (const arbint&, const arbint&); friend arbint operator% (const arbint&, const arbint&); friend arbint operator+ (const arbint&); friend arbint operator- (const arbint&); friend int operator== (const arbint&, const arbint&); friend int operator!= (const arbint&, const arbint&); friend int operator< (const arbint&, const arbint&); friend int operator>= (const arbint&, const arbint&); friend int operator> (const arbint&, const arbint&); friend int operator<= (const arbint&, const arbint&); friend ostream& operator<< (ostream&, const arbint&); friend istream& operator>> (istream&, arbint&); }; // DELETE extern void outputarb(ostream &out, char *h, ARB_type *s, int len, int ref = -100); // DELETE #endif /* ARBINT_H */ !EOF! ls -l 6_11.h echo x - 6_11_add.c sed 's/^X//' > 6_11_add.c << '!EOF!' /* Copyright (c) 1990 by AT&T Bell Telephone Laboratories, Incorporated. */ /* The C++ Answer Book */ /* Tony Hansen */ /* All rights reserved. */ /* Add u[1..n] + v[1..n] to form w[0..n] Based on: The Art of Computer Programming, volume 2 D. Knuth, Section 4.3.1, Algorithm A */ #include #include /* DELETE */ arbint operator+(const arbint& u, const arbint& v) { int ulen = u.p->length; int vlen = v.p->length; int wlen = max(ulen, vlen) + 1; ARB_type *wv = new ARB_type[wlen]; ARB_type *uv = u.p->value; ARB_type *vv = v.p->value; if (debug&64)/*DELETE*/ cerr << "operator+\n"; if (debug&64)/*DELETE*/ outputarb(cerr, "u=", uv, ulen); if (debug&64)/*DELETE*/ outputarb(cerr, "v=", vv, vlen); if (debug&64)/*DELETE*/ outputarb(cerr, "w(beg)=", wv, wlen); /* A1 [Initialize] set j <- n k <- 0 { modification: uj for u, vj for v } A3(a) [Loop on j] decrease j by one { modification: decrease uj and vj } */ if (debug&64)/*DELETE*/ cerr << "before first loop, uj=" << (ulen-1) << ", vj=" << (vlen-1) << ", wj=" << (wlen-1) << "\n"; ARB_Ltype k = 0; for (int uj = ulen - 1, vj = vlen - 1, wj = wlen - 1; uj >= 0 && vj >= 0; uj--, vj--, wj-- ) { /* A2(a) [Add digits] set w[j] <- (u[j] + v[j] + k) mod b { modification: w[wj] <- (u[uj] + v[vj] + k) mod b } */ ARB_Ltype t = uv[uj] + vv[vj] + k; wv[wj] = t; // % ARB_base; /* A2(b) k <- (u[j] + v[j] + k) / b */ k = (t / ARB_base) ? 1 : 0; } if (debug&64)/*DELETE*/ cerr << "after first loop, uj=" << uj << ", vj=" << vj << ", wj=" << wj << ", k=" << k << "\n"; if (debug&64)/*DELETE*/ outputarb(cerr, "w(now)=", wv, wlen); /* NOTE: either (uj >= 0) or (vj >= 0), but not both. As long as the carry is non-zero, it must be added to the next digit. */ if (uj >= 0) { /* Take care of u[1..uj]. */ for ( ; k != 0 && uj >= 0; uj--, wj-- ) { ARB_Ltype t = uv[uj]; t += k; wv[wj] = t; // % ARB_base; k = (t / ARB_base) ? 1 : 0; } if (debug&64)/*DELETE*/ cerr << "after second loop, uj=" << uj << ", vj=" << vj << ", wj=" << wj << ", k=" << k << "\n"; if (debug&64)/*DELETE*/ outputarb(cerr, "w(now)=", wv, wlen); /* The carry is now zero, so any remaining digits can be copied. */ while (uj >= 0) wv[wj--] = uv[uj--]; if (debug&64)/*DELETE*/ cerr << "after first copy, uj=" << uj << ", vj=" << vj << ", wj=" << wj << ", k=" << k << "\n"; if (debug&64)/*DELETE*/ outputarb(cerr, "w(now)=", wv, wlen); /* If there are any digits left to be filled in (there should be at most 1) they must be filled with either 0 or ~0 depending on the sign of wv[wj+1] */ if (wj >= 0) { const ARB_type hibit = (ARB_base >> 1); const ARB_type rest = (wv[wj+1] & hibit) ? ~0 : 0; do { wv[wj--] = rest; } while (wj >= 0); } } else if (vj >= 0) { /* Take care of v[1..vj] */ for ( ; k != 0 && vj >= 0; vj--, wj-- ) { ARB_Ltype t = vv[vj]; t += k; wv[wj] = t; // % ARB_base; k = (t / ARB_base) ? 1 : 0; } if (debug&64)/*DELETE*/ cerr << "after third loop, uj=" << uj << ", vj=" << vj << ", wj=" << wj << ", k=" << k << "\n"; if (debug&64)/*DELETE*/ outputarb(cerr, "w(now)=", wv, wlen); /* The carry is now zero, so any remaining digits can be copied. */ while (vj >= 0) wv[wj--] = vv[vj--]; if (debug&64)/*DELETE*/ cerr << "after second copy, uj=" << uj << ", vj=" << vj << ", wj=" << wj << ", k=" << k << "\n"; if (debug&64)/*DELETE*/ outputarb(cerr, "w(now)=", wv, wlen); /* If there are any digits left (there should be at most 1) they must be filled with either 0 or ~0 depending on the sign of wv[wj+1] */ if (wj >= 0) { const ARB_type hibit = (ARB_base >> 1); const ARB_type rest = (wv[wj+1] & hibit) ? ~0 : 0; do { wv[wj--] = rest; } while (wj >= 0); } } else { /* If there is a digit left (there should be at most 1), it should be set to k. Because we are dealing with 2's complement, a carry here means that the number must be sign-extended; otherwise the digit is set to 0. A3(b) Set w[0] <- k { modification, w[0] <- k ? sign(w[wj]) ? 0 } */ const ARB_type hibit = (ARB_base >> 1); const ARB_type rest = (k && (wv[wj+1] & hibit)) ? ~0 : 0; while (wj >= 0) wv[wj--] = rest; } /* Normalize and return */ if (debug&64)/*DELETE*/ outputarb(cerr, "w(end)=", wv, wlen); arbint w(wv, wlen); return w; } !EOF! ls -l 6_11_add.c echo x - 6_11_c1.c sed 's/^X//' > 6_11_c1.c << '!EOF!' /* Copyright (c) 1990 by AT&T Bell Telephone Laboratories, Incorporated. */ /* The C++ Answer Book */ /* Tony Hansen */ /* All rights reserved. */ /* Constructors and destructor for type arbint. */ #include arbint::arbint() // arbint x; or new arbint; { p = new arep; p->length = 1; p->refcnt = 1; p->value = new ARB_type[1]; p->value[0] = 0; } arbint::arbint(arbint &x) // arbint x = y; { x.p->refcnt++; p = x.p; } arbint::~arbint() // destructor or delete x; { if (--p->refcnt == 0) { delete p->value; delete p; } } !EOF! ls -l 6_11_c1.c echo x - 6_11_c2.c sed 's/^X//' > 6_11_c2.c << '!EOF!' /* Copyright (c) 1990 by AT&T Bell Telephone Laboratories, Incorporated. */ /* The C++ Answer Book */ /* Tony Hansen */ /* All rights reserved. */ /* create an arbint from a (unsigned) long */ #include const arbperlong = sizeof(long) / sizeof(ARB_type); arbint::arbint(long n) // arbint x = 36L; { // allocate data area p = new arep; p->refcnt = 1; p->length = arbperlong; p->value = new ARB_type[arbperlong]; // assign the new value for (int i = arbperlong - 1; i >= 0; i--) { p->value[i] = n % ARB_base; n /= ARB_base; } } arbint::arbint(unsigned long n) // arbint x = 3UL; { int nlen = arbperlong; if ((long) n < 0) nlen++; // allocate data area p = new arep; p->refcnt = 1; p->length = nlen; p->value = new ARB_type[nlen]; // assign the new value for (int i = nlen - 1; i >= 0; i--) { p->value[i] = n % ARB_base; n /= ARB_base; } } !EOF! ls -l 6_11_c2.c echo x - 6_11_c3.c sed 's/^X//' > 6_11_c3.c << '!EOF!' /* Copyright (c) 1990 by AT&T Bell Telephone Laboratories, Incorporated. */ /* The C++ Answer Book */ /* Tony Hansen */ /* All rights reserved. */ /* Create a new arbint using a data value created elsewhere. Before doing the assignment, leading zeroes and sign-bits are removed first. If a new data segment must be allocated, then the old one will be deleted. */ #include #include /* DELETE */ arbint::arbint(ARB_type *w, int wlen) { p = new arep; const ARB_type hibit = (ARB_base >> 1); if (debug&32) cerr << "arbint(ARB_type*, int):\n"; // DELETE if (debug&32) outputarb(cerr, "\tinput=", w, wlen); // DELETE // Leave i pointing to first normal digit. int i = 0, j = 1; if (w[0] & hibit) // negative { if (debug&32) cerr << "\tnegative number\n"; // DELETE // set up a sentinel of non-0, non-~0, // but negative ARB_type save_w_n = w[wlen-1]; w[wlen-1] = hibit; // Increment while digit is all sign bit and // the next digit has a sign bit... for ( ; (w[i] == ~0) && (w[j] & hibit); i++, j++) { // DELETE if (debug&32) cerr << "\tw[" << i << "]==~0 && w[" << j << "]==neg\n"; // DELETE ; } // DELETE // restore sentinel digit w[wlen-1] = save_w_n; } else // positive { if (debug&32) cerr << "\tpositive number\n"; // DELETE // set up a sentinel of non-0, non-~0, // but positive ARB_type save_w_n = w[wlen-1]; if (save_w_n == 0) w[wlen-1] = 1; // Increment while digit is all 0 and the // next digit is not if (debug&32) cerr << "\tw[" << i << "]=" << w[i] << "\n"; // DELETE for ( ; (w[i] == 0) && !(w[j] & hibit); i++, j++) { // DELETE if (debug&32) cerr << "\tw[" << i << "]==0\n"; // DELETE if (debug&32) cerr << "\tw[" << (i+1) << "]=" << w[i+1] << "\n"; // DELETE ; } // DELETE // restore sentinel digit w[wlen-1] = save_w_n; } p->length = wlen - i; p->refcnt = 1; // copy the data if (i == 0) p->value = w; else { p->value = new ARB_type[p->length]; memcpy((char*)p->value, (char*)&w[i], p->length * sizeof(ARB_type)); delete w; } if (debug&32) outputarb(cerr, "\toutput=", p->value, p->length); // DELETE } !EOF! ls -l 6_11_c3.c echo x - 6_11_cd.c sed 's/^X//' > 6_11_cd.c << '!EOF!' /* Copyright (c) 1990 by AT&T Bell Telephone Laboratories, Incorporated. */ /* The C++ Answer Book */ /* Tony Hansen */ /* All rights reserved. */ /* Constructor and assignment of doubles */ #include #include #include #include #include /* Fill in an arep with a double. Convert the double into a string of ARB_type digits. */ static void dassign(arep *p, double n) { p->refcnt = 1; /* declare working storage for dtoarb */ # define BITS(type) (CHAR_BIT * (int)sizeof(type)) const int dlen = DBL_MAX_EXP / BITS(ARB_type); ARB_type s[dlen+1]; /* convert the double to positive */ int neg = 0; if (n < 0) { n = -n; neg = 1; } // convert the double double i = n; ARB_type *s1 = (s + neg); // run forward on digits // this leaves the digits in reverse order do { *s1++ = (ARB_type) fmod(i, ARB_base); i /= ARB_base; } while (i >= 1.0); // run forward and backward on // the digits reversing them p->length = s1-- - (s + neg); ARB_type *s2 = s; while (s2 < s1) swap(*s2++, *s1--); // if necessary, convert to negative if (neg) { ARB_Ltype k = 1; s[0] = 0; p->length++; for (int j = p->length - 1; ; ) { ARB_type l1 = ~s[j]; ARB_Ltype l = l1 + k; s[j] = l; if (--j <= 0) break; k = (l / ARB_base) ? 1 : 0; } } // copy to allocated space p->value = new ARB_type[p->length]; memcpy((char *)p->value, (char *)s, p->length * sizeof(ARB_type)); } /* create an arbint from a double */ arbint::arbint(double n) // arbint x = 36.0; { p = new arep; dassign(p, n); } /* assign a double to an arbint */ arbint& arbint::operator=(double n) // x = 36.0; { if (p->refcnt > 1) { p->refcnt--; p = new arep; } else delete p->value; dassign(p, n); return *this; } !EOF! ls -l 6_11_cd.c echo x - 6_11_cmp.c sed 's/^X//' > 6_11_cmp.c << '!EOF!' /* Copyright (c) 1990 by AT&T Bell Telephone Laboratories, Incorporated. */ /* The C++ Answer Book */ /* Tony Hansen */ /* All rights reserved. */ /* Compare the n ARB_type's pointed to by l1 and l2. Return -1, 0 or 1 dependent on whether l1 is less than, equal or greater than l2. */ #include int arb_cmp(const ARB_type *l1, const ARB_type *l2, int n) { if (l1 != l2) while (--n >= 0) if (*l1++ != *l2++) return (l1[-1] > l2[-1] ? 1 : -1); return (0); } !EOF! ls -l 6_11_cmp.c echo x - 6_11_div.c sed 's/^X//' > 6_11_div.c << '!EOF!' /* Copyright (c) 1990 by AT&T Bell Telephone Laboratories, Incorporated. */ /* The C++ Answer Book */ /* Tony Hansen */ /* All rights reserved. */ /* Divide u[1..m+n] by v[1..n] to form q[0..m] and r[1..n] Based on: The Art of Computer Programming, volume 2 D. Knuth, Section 4.3.1, Algorithm D and exercise 16. */ #include #include /* DELETE */ void dodivmod(const arbint &tmp_u, const arbint &tmp_v, arbint "ient, arbint &remainder) { // Make u (the dividend) and // v (the divisor) positive. int negu = tmp_u.isneg(); int negv = tmp_v.isneg(); arbint u(+tmp_u); if (negu) u = -tmp_u; arbint v(+tmp_v); if (negv) v = -tmp_v; if (debug&16) outputarb(cerr, "u=", u.p->value, u.p->length, u.p->refcnt); // DELETE if (debug&16) outputarb(cerr, "v=", v.p->value, v.p->length, v.p->refcnt); // DELETE /* The sign of the remainder will match the sign of the dividend. The sign of the quotient will be negative if the sign of the divisor and dividend do not match, else positive. */ int negremainder = negu; int negquotient = (negu != negv); if (debug&16) cerr << "neg remainder=" << negremainder << ", neg quotient=" << negquotient << "\n"; // DELETE // Set local variables. ARB_type *uv = u.p->value; ARB_type *vv = v.p->value; int m_n = u.p->length; // m + n int n = v.p->length; int m = m_n - n; if (debug&16) cerr << "m+n=" << m_n << ", n= " << n << ", m=" << m << "\n"; // DELETE /* For n == 1, use simpler algorithm */ if (n == 1) { if (debug&16) cerr << "n==1, simpler algorithm\n"; // DELETE if (vv[0] == 0) { error("division by zero!"); quotient = remainder = +u; } else { /* See Exercise 16 after Section 4.3.1 */ ARB_type *qv = new ARB_type[m_n]; ARB_Ltype prevu = 0; ARB_type v1 = vv[0]; for (int r = 0; r < m_n; r++) { ARB_Ltype t = uv[r] + prevu * ARB_base; ARB_type tmpq = t / v1; qv[r] = tmpq; // % ARB_base prevu = t - v1 * tmpq; } arbint q(qv, m_n); if (negquotient) quotient = -q; else quotient = q; if (negremainder) remainder = -prevu; else remainder = prevu; } return; } /* Degenerate case of length(u) < length(v) i.e., m < 0, implying that u < v */ else if (m_n < n) { if (debug&16) cerr << "m_n < n, quotient <- 0\n"; // DELETE quotient = 0L; if (negremainder) remainder = -u; else remainder = +u; return; } /* Degenerate case of length(u) == length(v) i.e., m == 0, possibly implying that u < v or u == v */ else if (m_n == n) { if (debug&16) cerr << "m_n == n\n"; // DELETE int cmp = arb_cmp(uv, vv, m_n); if (cmp < 0) // u < v { if (debug&16) cerr << "\tquotient == 0\n"; // DELETE quotient = 0L; if (negremainder) remainder = -u; else remainder = +u; return; } else if (cmp == 0) // u == v { if (debug&16) cerr << "\tremainder == 0\n"; // DELETE if (negquotient) quotient = -1L; else quotient = 1L; remainder = 0L; return; } } /* Now call out all of the guns from Knuth */ if (debug&16) cerr << "all the guns\n"; // DELETE // In rare circumstances, the first // digit of u or v may be 0. This digit // must now be discarded. while ((*uv == 0) && (m_n > 1)) { uv++; m_n--; } while ((*vv == 0) && (n > 1)) { vv++; n--; } m = m_n - n; if (debug&16) cerr << "m+n=" << m_n << ", n= " << n << ", m=" << m << "\n"; // DELETE if (debug&16) outputarb(cerr, "uv=", uv, m_n); // DELETE if (debug&16) outputarb(cerr, "vv=", vv, n); // DELETE /* D1(a) [Normalize.] Set d <- b/(v1+1). */ ARB_type d = ARB_base / (vv[0] + 1); if (debug&16) cerr << "D1: normalize\n"; // DELETE if (debug&16) cerr << "d=" << d << "\n"; // DELETE /* D1(b) [Normalize.] Set (u[0]u[1]...u[m+n]) to (u[1]u[2]...u[m+n]) * d */ ARB_type *Ouv = uv; ARB_type k; uv = new ARB_type[m_n + 1]; if (d == 1) { // copy old value uv[0] = 0; memcpy((char*)&uv[1], (char*)&Ouv[0], m_n * sizeof(ARB_type)); } else { // multiply u by d k = 0; for (int Oi = m_n - 1, i = m_n; i > 0; Oi--, i--) { ARB_Ltype t = Ouv[Oi] * d + k; uv[i] = t; // % ARB_base; k = t / ARB_base; } uv[i] = k; } if (debug&16) outputarb(cerr, "uv=", uv, m_n+1); // DELETE /* D1(c) [Normalize.] Set (v[1]v[2]...v[n]) to (v[1]v[2]...v[n]) * d */ ARB_type *Ovv = vv; vv = new ARB_type[n]; if (d == 1) { // copy old value memcpy((char*)&vv[0], (char*)&Ovv[0], n * sizeof(ARB_type)); } else { // multiply v by d k = 0; for (int Oi = n - 1, i = n - 1; i >= 0; Oi--, i--) { ARB_Ltype t = Ovv[Oi] * d + k; vv[i] = t; // % ARB_base; k = t / ARB_base; } } if (debug&16) outputarb(cerr, "vv=", vv, n); // DELETE /* D2 [Initialize j] Set j <- 0 D7 [Loop on j] Set j <- j+1 Loop if j <= m */ ARB_type v1 = vv[0]; ARB_type v2 = vv[1]; ARB_type *qv = new ARB_type[m + 1]; ARB_type *nv = new ARB_type[n + 1]; for (int j = 0; j <= m; j++) { /* D3 [Calculate q^] If u[j] == v[1] Set q^ <- base - 1 Else Set q^ <- (u[j] * base + u[j+1]) / v[1] While v[2] * q^ > (u[j] * base + u[j+1] - q^ * v[1]) * base + u[j+2] Set q^ <- q^ - 1 */ ARB_Ltype q_hat; if (uv[j] == v1) q_hat = ARB_base - 1; else q_hat = (uv[j] * ARB_base + uv[j+1]) / v1; if (debug&16) cerr << "D3: calculate q^, j=" << j << "\n"; // DELETE if (debug&16) cerr << "\tq^=" << q_hat << "\n"; // DELETE ARB_Ltype u_j = uv[j]; ARB_Ltype u_j1 = uv[j+1]; ARB_Ltype u_j2 = uv[j+2]; for ( ; ; q_hat--) { /* if ((v2 * q_hat) <= ((u_j * ARB_base + u_j1 - v1 * q_hat) * ARB_base + u_j2)) q^--; */ ARB_Ltype u_j_q_hat = u_j * ARB_base + u_j1; u_j_q_hat -= v1 * q_hat; if (u_j_q_hat / ARB_base != 0) break; u_j_q_hat *= ARB_base; u_j_q_hat += u_j2; if ((v2 * q_hat) <= u_j_q_hat) break; } if (debug&16) cerr << "q^=" << q_hat << "\n"; // DELETE /* D4 [Multiply and subtract.] Replace u[j..j+n] by u[j..j+n] - q^ * v[1..n] */ if (debug&16) cerr << "D4: multiply and subtract\n"; // DELETE // set nv <- q^ * (v[1..n]) k = 0; for (int dl = n, vl = n-1; vl >= 0; vl--, dl--) { ARB_Ltype t = vv[vl] * q_hat + k; nv[dl] = t; // % ARB_base; k = t / ARB_base; } nv[0] = k; // subtract nv[0..n] from u[j..j+n] int borrow = 0; int ul = j + n; for (dl = n; dl >= 0; dl--, ul--) { ARB_Ltype t = uv[ul] - nv[dl] - borrow; uv[ul] = t; // % ARB_base borrow = (t / ARB_base) ? 1 : 0; } /* D5 [Test remainder] Set q[j] <- q^ if u[j] < 0 D6 [Add back] add 0v[1..n] back to u[j..j+n] q[j]-- */ qv[j] = q_hat; if (debug&16) cerr << "D5: test remainder\n"; // DELETE if (debug&16) cerr << "\tqv[" << j << "]=" << q_hat << "\n"; // DELETE if (debug&16) cerr << "\tborrow=" << borrow << "\n"; // DELETE if (borrow != 0) { for (k = 0, ul = j + n, vl = n - 1; vl >= 0; vl--, ul--) { ARB_Ltype t = uv[ul] + vv[vl] + k; uv[ul] = t; // % ARB_base k = t / ARB_base; } uv[j] += k; qv[j]--; if (debug&16) cerr << "\tqv[" << j << "]=" << q_hat << "\n"; // DELETE } } /* D8 [Unnormalize] q[0..m] is quotient u[m+1..m+n] / d is remainder */ if (debug&16) outputarb(cerr, "q=", qv, m+1); // DELETE arbint q(qv, m+1); if (negquotient) quotient = -q; else quotient = q; if (debug&16) outputarb(cerr, "quotient=", quotient.p->value, quotient.p->length); // DELETE // divide u[m+1..m+n] by d ARB_type *rem = new ARB_type[n]; if (d == 1) // nothing special to do memcpy((char*)rem, (char*)&uv[m+1], n * sizeof(ARB_type)); else { ARB_Ltype prevu = 0; // do division by single digit for (int rl = 0, ul = m + 1; ul <= m_n; ul++, rl++) { ARB_Ltype t = uv[ul] + prevu * ARB_base; ARB_type tmpq = t / d; rem[rl] = tmpq; // % ARB_base prevu = t - d * tmpq; } } if (debug&16) outputarb(cerr, "rem=", rem, n); // DELETE arbint r(rem, n); if (negremainder) remainder = -r; else remainder = r; if (debug&16) outputarb(cerr, "remainder=", remainder.p->value, remainder.p->length); // DELETE delete uv; delete vv; delete nv; } arbint operator%(const arbint &u, const arbint &v) { arbint quot, rem; dodivmod(u, v, quot, rem); return rem; } arbint operator/(const arbint &u, const arbint &v) { arbint quot, rem; dodivmod(u, v, quot, rem); return quot; } !EOF! ls -l 6_11_div.c echo x - 6_11_eq.c sed 's/^X//' > 6_11_eq.c << '!EOF!' /* Copyright (c) 1990 by AT&T Bell Telephone Laboratories, Incorporated. */ /* The C++ Answer Book */ /* Tony Hansen */ /* All rights reserved. */ /* Compare two arbint's for equality */ #include inline int operator==(const arbint& a, const arbint& b) { return (a.p->length == b.p->length) && (memcmp((char*)a.p->value, (char*)b.p->value, a.p->length * sizeof(ARB_type)) == 0); } !EOF! ls -l 6_11_eq.c echo x - 6_11_eq1.c sed 's/^X//' > 6_11_eq1.c << '!EOF!' /* Copyright (c) 1990 by AT&T Bell Telephone Laboratories, Incorporated. */ /* The C++ Answer Book */ /* Tony Hansen */ /* All rights reserved. */ /* Assignment operator for type arbint. */ #include arbint& arbint::operator=(arbint &x) // x = y; { x.p->refcnt++; if (--p->refcnt == 0) { delete p->value; delete p; } p = x.p; return *this; } // DELETE // DELETE arbint& arbint::operator=(const arbint &x) // x = y; // DELETE { // DELETE if (--p->refcnt == 0) // DELETE { // DELETE delete p->value; // DELETE delete p; // DELETE } // DELETE // DELETE p = new arep; // DELETE int nlen = x.p->length; // DELETE p->length = nlen; // DELETE p->value = new ARB_type[nlen]; // DELETE p->refcnt = 1; // DELETE memcpy((char*)p->value, (char*)x.p->value, // DELETE nlen * sizeof(ARB_type)); // DELETE return *this; // DELETE } !EOF! ls -l 6_11_eq1.c echo x - 6_11_eq2.c sed 's/^X//' > 6_11_eq2.c << '!EOF!' /* Copyright (c) 1990 by AT&T Bell Telephone Laboratories, Incorporated. */ /* The C++ Answer Book */ /* Tony Hansen */ /* All rights reserved. */ /* assign a (unsigned) long to an arbint */ #include const arbperlong = sizeof(long) / sizeof(ARB_type); arbint& arbint::operator=(long n) // x = 36L; { // get rid of old data if (p->refcnt > 1) { p->refcnt--; p = new arep; p->refcnt = 1; p->length = arbperlong; p->value = new ARB_type[arbperlong]; } // delete old value else if (p->length != arbperlong) { delete p->value; p->length = arbperlong; p->value = new ARB_type[arbperlong]; } // assign the new value for (int i = arbperlong - 1; i >= 0; i--) { p->value[i] = n % ARB_base; n /= ARB_base; } return *this; } arbint& arbint::operator=(unsigned long n) // x = 3UL; { int nlen = arbperlong; if (((long) n) < 0) nlen++; // get rid of old data if (p->refcnt > 1) { p->refcnt--; p = new arep; p->refcnt = 1; p->length = arbperlong; p->value = new ARB_type[arbperlong]; } // reallocate old value else if (p->length != nlen) { delete p->value; p->length = nlen; p->value = new ARB_type[nlen]; } // assign the new value for (int i = nlen - 1; i >= 0; i--) { p->value[i] = n % ARB_base; n /= ARB_base; } return *this; } !EOF! ls -l 6_11_eq2.c echo x - 6_11_ge.c sed 's/^X//' > 6_11_ge.c << '!EOF!' /* Copyright (c) 1990 by AT&T Bell Telephone Laboratories, Incorporated. */ /* The C++ Answer Book */ /* Tony Hansen */ /* All rights reserved. */ /* Compare two arbint's for >= */ #include inline int operator>=(const arbint& a, const arbint& b) { return !(a < b); } !EOF! ls -l 6_11_ge.c echo x - 6_11_gt.c sed 's/^X//' > 6_11_gt.c << '!EOF!' /* Copyright (c) 1990 by AT&T Bell Telephone Laboratories, Incorporated. */ /* The C++ Answer Book */ /* Tony Hansen */ /* All rights reserved. */ /* Compare two arbint's for > */ #include int operator>(const arbint& a, const arbint& b) { // check signs int a_isneg = a.isneg(); int b_isneg = b.isneg(); if (a_isneg && !b_isneg) return 0; if (!a_isneg && b_isneg) return 1; // check lengths and compare int alength = a.p->length; int blength = b.p->length; if (!a_isneg) // both positive { if (alength < blength) return 0; if (alength > blength) return 1; if (arb_cmp(a.p->value, b.p->value, alength) > 0) return 1; } else { if (alength > blength) return 0; if (alength < blength) return 1; if (arb_cmp(a.p->value, b.p->value, alength) < 0) return 1; } return 0; } !EOF! ls -l 6_11_gt.c echo x - 6_11_in.c sed 's/^X//' > 6_11_in.c << '!EOF!' /* Copyright (c) 1990 by AT&T Bell Telephone Laboratories, Incorporated. */ /* The C++ Answer Book */ /* Tony Hansen */ /* All rights reserved. */ // Input an arbint. // Convert a string of signed digits into an arbint. // Hex and octal prefixes are allowed. #include #include #include #include // DELETE const int chunksize = 5; // convert hexadecimal 0-9, a-f, A-F // to its numeric value inline int hexvalue(char c) { if (isdigit(c)) return c - '0'; else if (c >= 'a' && c <= 'f') return c - 'a' + 10; else return c - 'A' + 10; } // return true if c is an octal digit inline int isodigit(int c) { return isdigit(c) && c < '8'; } static ARB_type *i_s; static i_len; /* Add to the length of i_s by allocated new space, copying the old data to the new space, and deleting the old space. The new space is initialized to all zeros, except for the last digit whose value is passed in. */ static void extend_s(int k) { int olen = i_len; i_len += chunksize; ARB_type *new_i_s = new ARB_type[i_len]; memcpy((char*)&new_i_s[chunksize], (char*)i_s, i_len * sizeof(ARB_type)); memset((char*)new_i_s, 0, 4); new_i_s[4] = k; delete i_s; i_s = new_i_s; } // perform: i = i * base - newdigit static void addonedigit(int multiplier, int addend) { // i *= base // almost identical to that used // for operator* ARB_Ltype k = 0; for (int l = i_len - 1; l >= 0; l--) { ARB_Ltype t = i_s[l] * multiplier + k; i_s[l] = t; // % ARB_base k = t / ARB_base; } // add digits, if necessary if ((k != 0) || (i_s[0] & 0x8000)) extend_s(k); // i += addend // almost identical to that used // for operator+ k = addend; for (l = i_len - 1; l >= 0; l--) { ARB_Ltype t = i_s[l] + k; i_s[l] = t; k = (t / ARB_base) ? 1 : 0; } // add digits, if necessary if ((k != 0) || (i_s[0] & 0x8000)) extend_s(k); } istream& operator>> (istream& in, arbint& i) { char c, sign = 0; in >> WS; // skip white space if (!in.get(c)) { i = 0L; return in; } switch (c) // remember the sign { case '+': case '-': sign = c; if (!in.get(c)) { i = 0L; return in; } break; } // allocate the initial data space i_s = new ARB_type[chunksize]; i_len = chunksize; memset((char*)i_s, 0, chunksize * sizeof(ARB_type)); switch (c) { case '0': // hex or octal if (!in.get(c)) break; switch (c) { case 'x': // hex number case 'X': for (in.get(c); in && isxdigit(c); in.get(c)) addonedigit(16, hexvalue(c)); break; default: // octal number for ( ; in && isodigit(c); in.get(c)) addonedigit(8, (c - '0')); break; } break; default: // decimal number for ( ; in && isdigit(c); in.get(c)) addonedigit(10, (c - '0')); break; } if (in) in.putback(c); // change sign, if necessary, // and save data if (debug&1) outputarb(cerr, "\n\nin:\ni_s=", i_s, i_len); // DELETE arbint ret(i_s, i_len); if (debug&1) outputarb(cerr, "ret=", ret.p->value, ret.p->length); // DELETE if (sign == '-') i = -ret; else i = ret; if (debug&1) outputarb(cerr, "i=", i.p->value, i.p->length); // DELETE return in; } !EOF! ls -l 6_11_in.c echo x - 6_11_le.c sed 's/^X//' > 6_11_le.c << '!EOF!' /* Copyright (c) 1990 by AT&T Bell Telephone Laboratories, Incorporated. */ /* The C++ Answer Book */ /* Tony Hansen */ /* All rights reserved. */ /* Compare two arbint's for <= */ #include inline int operator<=(const arbint& a, const arbint& b) { return !(a > b); } !EOF! ls -l 6_11_le.c echo x - 6_11_lt.c sed 's/^X//' > 6_11_lt.c << '!EOF!' /* Copyright (c) 1990 by AT&T Bell Telephone Laboratories, Incorporated. */ /* The C++ Answer Book */ /* Tony Hansen */ /* All rights reserved. */ /* Compare two arbint's for < */ #include int operator<(const arbint& a, const arbint& b) { // check signs int a_isneg = a.isneg(); int b_isneg = b.isneg(); if (a_isneg && !b_isneg) return 1; if (!a_isneg && b_isneg) return 0; // check lengths and compare int alength = a.p->length; int blength = b.p->length; if (!a_isneg) // both positive { if (alength < blength) return 1; if (alength > blength) return 0; if (arb_cmp(a.p->value, b.p->value, alength) < 0) return 1; } else { if (alength > blength) return 1; if (alength < blength) return 0; if (arb_cmp(a.p->value, b.p->value, alength) > 0) return 1; } return 0; } !EOF! ls -l 6_11_lt.c echo x - 6_11_min.c sed 's/^X//' > 6_11_min.c << '!EOF!' /* Copyright (c) 1990 by AT&T Bell Telephone Laboratories, Incorporated. */ /* The C++ Answer Book */ /* Tony Hansen */ /* All rights reserved. */ /* Subtract u[1..n] - v[1..n] to form w[0..n] based on The Art of Computer Programming, volume 2 D. Knuth, Section 4.3.1, Algorithm A */ #include #include /* DELETE */ arbint operator-(const arbint& u, const arbint& v) { int ulen = u.p->length; int vlen = v.p->length; int wlen = max(ulen, vlen) + 1; ARB_type *wv = new ARB_type[wlen]; ARB_type *uv = u.p->value; ARB_type *vv = v.p->value; if (debug&128)/*DELETE*/ cerr << "operator-\n"; if (debug&128)/*DELETE*/ outputarb(cerr, "\tu=", uv, ulen); if (debug&128)/*DELETE*/ outputarb(cerr, "\tv=", vv, vlen); if (debug&128)/*DELETE*/ outputarb(cerr, "\tw(beg)=", wv, wlen); /* A1 [Initialize] set j <- n k <- 0 { modification: uj for u, vj for v k <- 1 } A3(a) [Loop on j] decrease j by one { modification: decrease uj and vj } */ if (debug&128)/*DELETE*/ cerr << "\tbefore first loop, uj=" << (ulen-1) << ", vj=" << (vlen-1) << ", wj=" << (wlen-1) << "\n"; ARB_Ltype k = 1; for (int uj = ulen - 1, vj = vlen - 1, wj = wlen - 1; uj >= 0 && vj >= 0; uj--, vj--, wj-- ) { /* A2(a) [Add digits] set w[j] <- (u[j] + v[j] + k) mod b { modification: w[wj] <- (u[uj] + ~v[vj] + k) mod b } */ if (debug&128)/*DELETE*/ cerr << "\tin first loop, uj=" << uj << ", vj=" << vj << ", wj=" << wj << ", k=" << k << "\n"; if (debug&128)/*DELETE*/ cerr << "\t\tuv[" << uj << "]=" << form("%4.4x", uv[uj]) << "\n"; ARB_Ltype t = uv[uj]; if (debug&128)/*DELETE*/ cerr << "\t\tt=" << form("%8.8x", t) << "\n"; if (debug&128)/*DELETE*/ cerr << "\t\tvv[" << vj << "]=" << form("%4.4x", vv[vj]) << "\n"; ARB_type t1 = ~vv[vj]; if (debug&128)/*DELETE*/ cerr << "\t\t~vv[" << vj << "]=" << form("%4.4x", t1) << "\n"; t += t1; if (debug&128)/*DELETE*/ cerr << "\t\tt=" << form("%8.8x", t) << "\n"; if (debug&128)/*DELETE*/ cerr << "\t\tk=" << k << "\n"; t += k; if (debug&128)/*DELETE*/ cerr << "\t\tt=" << form("%8.8x", t) << "\n"; wv[wj] = t; // % ARB_base if (debug&128)/*DELETE*/ cerr << "\t\twv[" << wj << "]=" << form("%4.4x", wv[wj]) << "\n"; /* A2(b) k <- (u[j] + v[j] + k) / b */ k = (t / ARB_base) ? 1 : 0; if (debug&128)/*DELETE*/ cerr << "\t\tk=" << k << "\n"; } if (debug&128)/*DELETE*/ cerr << "\tafter first loop, uj=" << uj << ", vj=" << vj << ", wj=" << wj << ", k=" << k << "\n"; if (debug&128)/*DELETE*/ outputarb(cerr, "\tw(now)=", wv, wlen); /* NOTE: either (uj >= 0) or (vj >= 0), but not both. As long as the carry is non-zero, it must be added to the next digit. */ if (uj >= 0) { /* Take care of u[1..uj]. */ for ( ; uj >= 0; uj--, wj-- ) { ARB_type t1 = ~0; ARB_Ltype t = uv[uj] + t1 + k; wv[wj] = t; // % ARB_mask; k = (t / ARB_base ) ? 1 : 0; } if (debug&128)/*DELETE*/ cerr << "\tafter second loop, uj=" << uj << ", vj=" << vj << ", wj=" << wj << ", k=" << k << "\n"; if (debug&128)/*DELETE*/ outputarb(cerr, "\tw(now)=", wv, wlen); /* If there are any digits left (there should be at most 1) they must be filled with either 0 or ~0 depending on the sign of wv[wj+1] */ if (wj >= 0) { const ARB_type hibit = (ARB_base >> 1); const ARB_type rest = ((wv[wj+1] & hibit) != 0) ? ~0 : 0; if (debug&128)/*DELETE*/ cerr << "\tfinish off, wv[" << (wj+1) << "]=" << form("%4.4x", wv[(wj+1)]) << "\n"; if (debug&128)/*DELETE*/ cerr << "\t\thibit=" << form("%4.4x", hibit) << "\n"; if (debug&128)/*DELETE*/ cerr << "\t\twv[wj+1]&hibit=" << ((wv[wj+1] & hibit) != 0) << "\n"; if (debug&128)/*DELETE*/ cerr << "\t\trest=" << form("%4.4x", rest) << "\n"; do { wv[wj--] = rest; } while (wj >= 0); } } else if (vj >= 0) { /* Take care of v[1..vj] */ for ( ; k != 0 && vj >= 0; vj--, wj-- ) { ARB_type t1 = ~vv[vj]; ARB_Ltype t = k; t += t1; wv[wj] = t; // % ARB_base k = (t / ARB_base) ? 1 : 0; } if (debug&128)/*DELETE*/ cerr << "\tafter third loop, uj=" << uj << ", vj=" << vj << ", wj=" << wj << ", k=" << k << "\n"; if (debug&128)/*DELETE*/ outputarb(cerr, "\tw(now)=", wv, wlen); /* The borrow is now zero, so any remaining digits can be negated. */ while (vj >= 0) wv[wj--] = ~vv[vj--]; if (debug&128)/*DELETE*/ cerr << "\tafter second copy, uj=" << uj << ", vj=" << vj << ", wj=" << wj << ", k=" << k << "\n"; if (debug&128)/*DELETE*/ outputarb(cerr, "\tw(now)=", wv, wlen); /* If there are any digits left (there should be at most 1) they must be filled with either 0 or ~0 depending on the sign of wv[wj+1] */ if (wj >= 0) { const ARB_type hibit = (ARB_base >> 1); const ARB_type rest = ((wv[wj+1] & hibit) != 0) ? ~0 : 0; if (debug&128)/*DELETE*/ cerr << "\tfinish off, wv[" << (wj+1) << "]=" << form("%4.4x", wv[(wj+1)]) << "\n"; if (debug&128)/*DELETE*/ cerr << "\t\thibit=" << form("%4.4x", hibit) << "\n"; if (debug&128)/*DELETE*/ cerr << "\t\twv[wj+1]&hibit=" << ((wv[wj+1] & hibit) != 0) << "\n"; if (debug&128)/*DELETE*/ cerr << "\t\trest=" << form("%4.4x", rest) << "\n"; do { wv[wj--] = rest; } while (wj >= 0); } } else { /* If there is a digit left (there should be at most 1), it should be set to k. Because we are dealing with 2's complement, a carry here means that the number must be sign-extended; otherwise the digit is set to 0. A3(b) Set w[0] <- k { modification, w[0] <- k ? sign(w[wj+1]) ? 0 } */ const ARB_type hibit = (ARB_base >> 1); const ARB_type rest = ((wv[wj+1] & hibit) != 0) ? ~0 : 0; if (debug&128)/*DELETE*/ cerr << "\tfinish off, wv[" << (wj+1) << "]=" << form("%4.4x", wv[(wj+1)]) << "\n"; if (debug&128)/*DELETE*/ cerr << "\t\thibit=" << form("%4.4x", hibit) << "\n"; if (debug&128)/*DELETE*/ cerr << "\t\twv[wj+1]&hibit=" << ((wv[wj+1] & hibit) != 0) << "\n"; if (debug&128)/*DELETE*/ cerr << "\t\trest=" << form("%4.4x", rest) << "\n"; while (wj >= 0) wv[wj--] = rest; } /* Normalize and return */ if (debug&128)/*DELETE*/ outputarb(cerr, "\tw(end)=", wv, wlen); arbint w(wv, wlen); return w; } !EOF! ls -l 6_11_min.c echo x - 6_11_mul.c sed 's/^X//' > 6_11_mul.c << '!EOF!' /* Copyright (c) 1990 by AT&T Bell Telephone Laboratories, Incorporated. */ /* The C++ Answer Book */ /* Tony Hansen */ /* All rights reserved. */ /* Multiply u[1..n] * v[1..m] to form w[0..m+n] Based on: The Art of Computer Programming, volume 2 D. Knuth, Section 4.3.1, Algorithm M */ #include #include /* DELETE */ arbint operator*(const arbint& tmp_u, const arbint& tmp_v) { // Make u (the multiplicand) and // v (the multiplier) positive. int negu = tmp_u.isneg(); int negv = tmp_v.isneg(); arbint u(+tmp_u); if (negu) u = -tmp_u; arbint v(+tmp_v); if (negv) v = -tmp_v; if (debug&8) cerr << "operator*\n"; // DELETE if (debug&8) outputarb(cerr, "\tu=", u.p->value, u.p->length, u.p->refcnt); // DELETE if (debug&8) outputarb(cerr, "\tv=", v.p->value, v.p->length, v.p->refcnt); // DELETE // The product will be negative if // the signs of the multiplier and // multiplicand do not match. int negans = (negu != negv); int n = u.p->length; int m = v.p->length; int wlen = n + m + 1; ARB_type *wv = new ARB_type[wlen]; ARB_type *uv = u.p->value; ARB_type *vv = v.p->value; /* M1(a) [Initialize] Set w[m+1..m+n] <- 0 */ memset((char*)wv, 0, wlen * sizeof(ARB_type)); if (debug&8) { outputarb(cerr, "\twv=", wv, wlen); // DELETE cerr << "\tn=" << n << ", m=" << m << ", wlen=" << wlen << "\n"; } // DELETE /* M1(b) [Initialize] Set j <- m M6 [Loop on j] decrease j by one if j > 0, goto M2 */ for (int j = m - 1; j >= 0; j-- ) { /* M2 [zero multiplier?] if v[j] == 0 w[j] <- 0 goto M6 */ if (debug&8)/*DELETE*/ cerr << "\tj=" << j << "\n"; if (debug&8)/*DELETE*/ cerr << "\tvv[" << j << "]=" << form("%4.4x", vv[j]) << "\n"; if (vv[j] == 0) { if (debug&8)/*DELETE*/ cerr << "\tsetting wv[" << j << "] <- 0\n"; wv[j] = 0; continue; } /* M3 [Initialize i] set i <- n, k <- 0 M5(a) [Loop on i] decrease i by one if i > 0, goto M4 */ ARB_Ltype v_j = vv[j]; ARB_Ltype k = 0; for (int i = n - 1, iplusj = i + j + 2; i >= 0; i--, iplusj--) { if (debug&8)/*DELETE*/ cerr << "\ti=" << i << "\n"; if (debug&8)/*DELETE*/ cerr << "\tuv[" << i << "]=" << form("%4.4x", uv[i]) << "\n"; if (debug&8)/*DELETE*/ cerr << "\twv[" << iplusj << "]=" << form("%4.4x", wv[iplusj]) << "\n"; if (debug&8)/*DELETE*/ cerr << "\tk=" << k << "\n"; /* M4 [multiply and add] set t <- u[i] * v[j] + w[i+j] + k w[i+j] <- t % b k <- t / b */ ARB_Ltype t = uv[i] * v_j + wv[iplusj] + k; wv[iplusj] = t; // % ARB_base; k = t / ARB_base; } if (debug&8)/*DELETE*/ cerr << "\tend of loop on i\n"; if (debug&8)/*DELETE*/ cerr << "\tk=" << k << "\n"; if (debug&8)/*DELETE*/ cerr << "\twv[" << (j+1) << "]<-" << form("%4.4x", k) << "\n"; /* M5(b) [Loop on i] if i <= 0, set w[j] <- k */ wv[j+1] = k; } /* Normalize */ if (debug&8)/*DELETE*/ cerr << "\tend of loop on j\n"; if (debug&8) outputarb(cerr, "\tw=", wv, wlen); // DELETE arbint w(wv, wlen); if (debug&8) outputarb(cerr, "\tw=", w.p->value, w.p->length, w.p->refcnt); // DELETE if (debug&8) outputarb(cerr, "\tu=", u.p->value, u.p->length, u.p->refcnt); // DELETE if (debug&8) outputarb(cerr, "\tv=", v.p->value, v.p->length, v.p->refcnt); // DELETE /* Restore sign and return */ if (negans) return -w; else return w; } !EOF! ls -l 6_11_mul.c echo x - 6_11_ne.c sed 's/^X//' > 6_11_ne.c << '!EOF!' /* Copyright (c) 1990 by AT&T Bell Telephone Laboratories, Incorporated. */ /* The C++ Answer Book */ /* Tony Hansen */ /* All rights reserved. */ /* Compare two arbint's for inequality */ #include inline int operator!=(const arbint& a, const arbint& b) { return !(a == b); } !EOF! ls -l 6_11_ne.c echo x - 6_11_neg.c sed 's/^X//' > 6_11_neg.c << '!EOF!' /* Copyright (c) 1990 by AT&T Bell Telephone Laboratories, Incorporated. */ /* The C++ Answer Book */ /* Tony Hansen */ /* All rights reserved. */ /* Negate u[1..n] to form w[0..n] Uses a variation on: The Art of Computer Programming, volume 2 D. Knuth, Section 4.3.1, Algorithm A */ #include #include // DELETE arbint operator-(const arbint& u) { int ulen = u.p->length; int wlen = ulen + u.isneg(); ARB_type *wv = new ARB_type[wlen]; ARB_type *uv = u.p->value; if (debug&4) outputarb(cerr, "\n\nneg:\nu=", uv, ulen); // DELETE /* A1 [Initialize] set j <- n k <- 0 becomes k <- 1 A3(a) [Loop on j] decrease j by one */ ARB_Ltype k = 1; for (int uj = ulen - 1, wj = wlen - 1; uj >= 0; uj--, wj--) { /* A2(a) [Add digits] set w[j] <- (u[j] + v[j] + k) mod b becomes set w[j] <- (~u[j] + k) mod b */ ARB_type l1 = ~uv[uj]; ARB_Ltype l = l1 + k; wv[wj] = l; // % ARB_base /* A2(b) k <- (u[j] + v[j] + k) / b */ k = (l / ARB_base ) ? 1 : 0; } /* A3(b) Set w[0] <- ~0 + k */ if (wj == 0) { if (debug&4) cerr << "wj==0, k=" << k << "\n"; // DELETE wv[0] = k ? ~0 : 0; } // DELETE /* Normalize and return */ if (debug&4) outputarb(cerr, "wv=", wv, wlen); // DELETE arbint w(wv, wlen); if (debug&4) outputarb(cerr, "w=", w.p->value, w.p->length); // DELETE return w; } !EOF! ls -l 6_11_neg.c echo x - 6_11_out.c sed 's/^X//' > 6_11_out.c << '!EOF!' /* Copyright (c) 1990 by AT&T Bell Telephone Laboratories, Incorporated. */ /* The C++ Answer Book */ /* Tony Hansen */ /* All rights reserved. */ /* Output a type arbint to the given stream. */ #include #include // DELETE ostream& operator<< (ostream& out, const arbint& j) { if (debug&2) outputarb(cerr, "\n\nout:\nj=", j.p->value, j.p->length); // DELETE arbint val = +j; if (debug&2) outputarb(cerr, "val=", val.p->value, val.p->length); // DELETE // reverse the sign of negative numbers if (j.isneg()) { val = -j; out << "-"; if (debug&2) outputarb(cerr, "val=", val.p->value, val.p->length); // DELETE } // output can be stored in 6*val.length hyper-decimal // digits, each digit holding a value 0..9999. const ARB_type dec_base = 10000; if (debug&2) cerr << "val.p->length=" << val.p->length << ", ARB_base=" << ARB_base << ", dec_base=" << dec_base << "\n"; // DELETE ARB_type *digs = new ARB_type[val.p->length * ARB_base / dec_base]; ARB_type *svdigs = digs; ARB_type *val_val = val.p->value; int val_len = val.p->length; // store "digits" in reverse order for (;;) { // *digs++ = val % 10000 // val /= 10000; ARB_Ltype prevu = 0; for (int r = 0; r < val_len; r++) { ARB_Ltype tmp = val_val[r] + prevu * ARB_base; ARB_type tmpq = tmp / dec_base; val_val[r] = tmpq; // % ARB_base prevu = tmp - dec_base * tmpq; } *digs++ = prevu; if (debug&2) cerr << "\tdigit stored: " << prevu << "\n"; // DELETE // if (val == 0) // break; if (debug&2) outputarb(cerr, "val (after div)=", val_val, val_len); // DELETE int allzero = 1; for (r = 0; r < val_len; r++) if (val_val[r] != 0) { allzero = 0; break; } if (allzero) break; } // Output digits in forward order. // All but first digit must be 4 decimal // digits in lengths, including leading zeros. out << *--digs; while (digs-- > svdigs) out << form("%4.4u", *digs); delete svdigs; return out; } !EOF! ls -l 6_11_out.c echo x - 6_11_pos.c sed 's/^X//' > 6_11_pos.c << '!EOF!' /* Copyright (c) 1990 by AT&T Bell Telephone Laboratories, Incorporated. */ /* The C++ Answer Book */ /* Tony Hansen */ /* All rights reserved. */ /* The unary plus operator on type arbint. */ #include arbint operator+(const arbint& j) { int nlen = j.p->length; ARB_type *nv = new ARB_type[nlen]; memcpy((char*)nv, (char*)j.p->value, nlen * sizeof(ARB_type)); arbint k(nv, nlen); return k; } !EOF! ls -l 6_11_pos.c echo x - 6_11a.h sed 's/^X//' > 6_11a.h << '!EOF!' /* Copyright (c) 1990 by AT&T Bell Telephone Laboratories, Incorporated. */ /* The C++ Answer Book */ /* Tony Hansen */ /* All rights reserved. */ int isneg() { return (p->value[0] & (ARB_base >> 1)) != 0; } !EOF! ls -l 6_11a.h echo x - 6_11b.h sed 's/^X//' > 6_11b.h << '!EOF!' /* Copyright (c) 1990 by AT&T Bell Telephone Laboratories, Incorporated. */ /* The C++ Answer Book */ /* Tony Hansen */ /* All rights reserved. */ friend int arb_cmp(const ARB_type*, const ARB_type*, int); !EOF! ls -l 6_11b.h echo x - arbint.h sed 's/^X//' > arbint.h << '!EOF!' /* Copyright (c) 1990 by AT&T Bell Telephone Laboratories, Incorporated. */ /* The C++ Answer Book */ /* Tony Hansen */ /* All rights reserved. */ /* Copyright (c) 1990 by AT&T Bell Telephone Laboratories, Incorporated. */ /* The C++ Answer Book */ /* Tony Hansen */ /* All rights reserved. */ /* arbitrary precision arithmetic Exercise 6.11 All numbers are stored in an array of unsigned shorts in two's complement format. Its length is all maintained separately. */ #ifndef ARBINT_H #define ARBINT_H # include # include # include # include typedef unsigned short ARB_type; typedef unsigned long ARB_Ltype; const ARB_Ltype ARB_base = 0x10000; class arbint { struct arep { ARB_type *value; // ptr to value int length; // length of data int refcnt; // reference count }; arep *p; // ptr to data arbint(ARB_type*,int); /* DELETE */ friend void dodivmod(const arbint&, /* DELETE */ const arbint&, arbint&, arbint&); /* DELETE */ #include "6_11a.h" /* DELETE isneg() */ #include "6_11b.h" /* DELETE arb_cmp() */ public: arbint(); // arbint x; or // new arbint; ~arbint(); // delete arbint; arbint(arbint&); // arbint x = y; arbint(long); // arbint x = 35L; arbint(unsigned long); // arbint x = 35LU; arbint(double); // arbint x = 35.0; arbint& operator=(arbint&); // x = y; arbint& operator=(long); // x = 35L; arbint& operator=(unsigned long);// x = 35LU; arbint& operator=(double); // x = 35.0; friend arbint operator+ (const arbint&, const arbint&); friend arbint operator- (const arbint&, const arbint&); friend arbint operator* (const arbint&, const arbint&); friend arbint operator/ (const arbint&, const arbint&); friend arbint operator% (const arbint&, const arbint&); friend arbint operator+ (const arbint&); friend arbint operator- (const arbint&); friend int operator== (const arbint&, const arbint&); friend int operator!= (const arbint&, const arbint&); friend int operator< (const arbint&, const arbint&); friend int operator>= (const arbint&, const arbint&); friend int operator> (const arbint&, const arbint&); friend int operator<= (const arbint&, const arbint&); friend ostream& operator<< (ostream&, const arbint&); friend istream& operator>> (istream&, arbint&); }; // DELETE extern void outputarb(ostream &out, char *h, ARB_type *s, int len, int ref = -100); // DELETE #endif /* ARBINT_H */ !EOF! ls -l arbint.h echo x - ctype.h sed 's/^X//' > ctype.h << '!EOF!' /* Copyright (c) 1990 by AT&T Bell Telephone Laboratories, Incorporated. */ /* The C++ Answer Book */ /* Tony Hansen */ /* All rights reserved. */ /* @(#)ctype.h 1.4 */ /* 3.0 SID # 1.2 */ #ifndef CTYPEH # define CTYPEH const int _U = 01; /* Upper case */ const int _L = 02; /* Lower case */ const int _N = 04; /* Numeral (digit) */ const int _S = 010; /* Spacing character */ const int _P = 020; /* Punctuation */ const int _C = 040; /* Control character */ const int _B = 0100; /* Blank */ const int _X = 0200; /* heXadecimal digit */ extern char _ctype[]; inline int isalpha(int c) { return ((_ctype + 1)[c] & (_U | _L)); } inline int isupper(int c) { return ((_ctype + 1)[c] & _U); } inline int islower(int c) { return ((_ctype + 1)[c] & _L); } inline int isdigit(int c) { return ((_ctype + 1)[c] & _N); } inline int isxdigit(int c) { return ((_ctype + 1)[c] & _X); } inline int isalnum(int c) { return ((_ctype + 1)[c] & (_U | _L | _N)); } inline int isspace(int c) { return ((_ctype + 1)[c] & _S); } inline int ispunct(int c) { return ((_ctype + 1)[c] & _P); } inline int isprint(int c) { return ((_ctype + 1)[c] & (_P | _U | _L | _N | _B)); } inline int isgraph(int c) { return ((_ctype + 1)[c] & (_P | _U | _L | _N)); } inline int iscntrl(int c) { return ((_ctype + 1)[c] & _C); } inline int isascii(int c) { return (!((c) & ~0177)); } inline int _toupper(int c) { return ((c) - 'a' + 'A'); } inline int _tolower(int c) { return ((c) - 'A' + 'a'); } inline int toascii(int c) { return ((c) & 0177); } #endif /* CTYPEH */ !EOF! ls -l ctype.h echo x - makefile sed 's/^X//' > makefile << '!EOF!' CC= CC -I. -I../../CC CFLAGS= -I. ERROR= ../../error.o OBJ= 6_11_add.o 6_11_cmp.o \ 6_11_c1.o 6_11_c2.o 6_11_c3.o 6_11_cd.o \ 6_11_div.o 6_11_eq.o 6_11_eq1.o 6_11_eq2.o \ 6_11_ge.o 6_11_gt.o 6_11_in.o 6_11_le.o \ 6_11_lt.o 6_11_min.o 6_11_mul.o 6_11_ne.o \ 6_11_neg.o 6_11_out.o 6_11_pos.o outputarb.o SRC= $(OBJ:.o=.c) all: tst tst: tst.o $(OBJ) $(CC) tst.o $(OBJ) -o tst -lm $(ERROR) $(OBJ): arbint.h 6_11a.h 6_11b.h CMP= tst1.cmp tst2.cmp tst3.cmp tst4.cmp tst5.cmp tst6.cmp tst7.cmp OUT= tst1.out tst2.out tst3.out tst4.out tst5.out tst6.out tst7.out tst1.out: tst tst1.in ; tst < tst1.in > tst1.out tst2.out: tst tst2.in ; tst < tst2.in > tst2.out tst3.out: tst tst3.in ; tst < tst3.in > tst3.out tst4.out: tst tst4.in ; tst < tst4.in > tst4.out tst5.out: tst tst5.in ; tst < tst5.in > tst5.out tst6.out: tst tst6.in ; tst < tst6.in > tst6.out tst7.out: tst tst7.in ; tst < tst7.in > tst7.out test: all $(OUT) $(CMP) cmp tst1.cmp tst1.out cmp tst2.cmp tst2.out cmp tst3.cmp tst3.out cmp tst4.cmp tst4.out cmp tst5.cmp tst5.out cmp tst6.cmp tst6.out cmp tst7.cmp tst7.out echo tests done !EOF! ls -l makefile echo x - outputarb.c sed 's/^X//' > outputarb.c << '!EOF!' /* Copyright (c) 1990 by AT&T Bell Telephone Laboratories, Incorporated. */ /* The C++ Answer Book */ /* Tony Hansen */ /* All rights reserved. */ #include void outputarb(ostream &out, char *h, ARB_type *s, int len, int ref) { out << h << "(" << len << ") 0x"; for (int ii = 0; ii < len; ii++) out << form(" %4.4x", s[ii]); if (ref != -100) out << "\tref=" << ref; out << "\n"; } !EOF! ls -l outputarb.c echo x - runtests3 sed 's/^X//' > runtests3 << '!EOF!' all="plus mult min div mod" swapall="swapplus swapmult swapmin swapdiv swapmod" if [ $# -eq 0 ] then set $all $swapall fi for i do case $i in build ) echo build sed cp tst.in /tmp/tst.in.plus sed 's!+!*!' < /tmp/tst.in.plus > /tmp/tst.in.mult sed 's!+!-!' < /tmp/tst.in.plus > /tmp/tst.in.min sed 's!+!/!' < /tmp/tst.in.plus > /tmp/tst.in.div sed 's!+!%!' < /tmp/tst.in.plus > /tmp/tst.in.mod for j in $all do echo build bc $j bc < /tmp/tst.in.$j > /tmp/bc.out.$j echo build swap $j nawk '{print $3, $2, $1}' < /tmp/tst.in.$j > /tmp/tst.in.swap$j echo build bc swap$j bc < /tmp/tst.in.swap$j > /tmp/bc.out.swap$j done ;; esac done for i do case $i in build ) ;; * ) echo $i ./tst3 < /tmp/tst.in.$i > /tmp/tst.out.$i nawk '{ getline bc < "/tmp/bc.out.'"$i"'"; if (NF != 5 || $5 != bc) print $0, bc }' < /tmp/tst.out.$i ;; esac done !EOF! ls -l runtests3 echo x - tst.c sed 's/^X//' > tst.c << '!EOF!' /* Copyright (c) 1990 by AT&T Bell Telephone Laboratories, Incorporated. */ /* The C++ Answer Book */ /* Tony Hansen */ /* All rights reserved. */ #include #include #include #include void testdiv(const arbint& A, const arbint& B) { arbint quot = A / B; cout << A << " / " << B << " = " << quot << "\n"; } void testmod(const arbint& A, const arbint& B) { arbint rem = A % B; cout << A << " % " << B << " = " << rem << "\n"; } void testdivmod(const arbint& A, const arbint& B) { arbint quot, rem; dodivmod(A, B, quot, rem); cout << A << " / " << B << " = " << quot << "\n"; cout << A << " % " << B << " = " << rem << "\n"; } void testmul(const arbint& A, const arbint& B) { arbint prod = A * B; cout << A << " * " << B << " = " << prod << "\n"; } void testadd(const arbint& A, const arbint& B) { arbint sum = A + B; cout << A << " + " << B << " = " << sum << "\n"; } void testsub(const arbint& A, const arbint& B) { arbint diff = A - B; cout << A << " - " << B << " = " << diff << "\n"; } void testneg(const arbint& A) { arbint neg = -A; cout << " 0, 0 - " << A << " = " << neg << "\n"; } void testpos(const arbint& A) { arbint pos = +A; cout << " 0, 0 + " << A << " = " << pos << "\n"; } inline int eq(char*s1, char*s2) { return (strcmp(s1, s2) == 0); } main() { arbint x, y; char op[100]; while (cin >> x >> op >> y) { if (eq(op, "+")) testadd(x, y); else if (eq(op, "-")) testsub(x, y); else if (eq(op, "*")) testmul(x, y); else if (eq(op, "/")) testdiv(x, y); else if (eq(op, "%")) testmod(x, y); else if (eq(op, "/%")) testdivmod(x, y); else if (eq(op, "--")) testneg(x); else if (eq(op, "++")) testpos(x); else cout << "unknown operator\n"; } return 0; } !EOF! ls -l tst.c echo x - tst1.cmp sed 's/^X//' > tst1.cmp << '!EOF!' 1 + 1 = 2 1 + 2 = 3 1 + 15 = 16 1 + 364 = 365 1 + 2938 = 2939 1 + 3136 = 3137 1 + 3514 = 3515 1 + 3627 = 3628 1 + 3861 = 3862 1 + 6117 = 6118 1 + 6424 = 6425 1 + 7448 = 7449 1 + 8184 = 8185 1 + 9312 = 9313 1 + 10269 = 10270 1 + 12738 = 12739 1 + 13485 = 13486 1 + 15090 = 15091 1 + 15161 = 15162 1 + 15970 = 15971 1 + 15987 = 15988 1 + 17517 = 17518 1 + 18308 = 18309 1 + 18455 = 18456 1 + 18464 = 18465 1 + 20525 = 20526 1 + 20576 = 20577 1 + 20718 = 20719 1 + 22099 = 22100 1 + 22859 = 22860 1 + 22934 = 22935 1 + 23269 = 23270 1 + 23520 = 23521 1 + 23947 = 23948 1 + 24541 = 24542 1 + 24580 = 24581 1 + 25137 = 25138 1 + 27342 = 27343 1 + 27387 = 27388 1 + 28848 = 28849 1 + 30907 = 30908 1 + 31244 = 31245 1 + 32277 = 32278 1 + 268435456 = 268435457 1 + 888515840709 = 888515840710 1 + 1099511627775 = 1099511627776 1 + 17381190257349 = 17381190257350 1 + 17592186044415 = 17592186044416 1 + 17592186044416 = 17592186044417 1 + 35184372088832 = 35184372088833 1 + 123145302310912 = 123145302310913 1 + 140737488355328 = 140737488355329 1 + 281263980923589 = 281263980923590 1 + 281474976710640 = 281474976710641 1 + 281474976710641 = 281474976710642 1 + 281474976710654 = 281474976710655 1 + 281474976710655 = 281474976710656 1 + 281474976710656 = 281474976710657 2 + 2 = 4 2 + 15 = 17 2 + 364 = 366 2 + 2938 = 2940 2 + 3136 = 3138 2 + 3514 = 3516 2 + 3627 = 3629 2 + 3861 = 3863 2 + 6117 = 6119 2 + 6424 = 6426 2 + 7448 = 7450 2 + 8184 = 8186 2 + 9312 = 9314 2 + 10269 = 10271 2 + 12738 = 12740 2 + 13485 = 13487 2 + 15090 = 15092 2 + 15161 = 15163 2 + 15970 = 15972 2 + 15987 = 15989 2 + 17517 = 17519 2 + 18308 = 18310 2 + 18455 = 18457 2 + 18464 = 18466 2 + 20525 = 20527 2 + 20576 = 20578 2 + 20718 = 20720 2 + 22099 = 22101 2 + 22859 = 22861 2 + 22934 = 22936 2 + 23269 = 23271 2 + 23520 = 23522 2 + 23947 = 23949 2 + 24541 = 24543 2 + 24580 = 24582 2 + 25137 = 25139 2 + 27342 = 27344 2 + 27387 = 27389 2 + 28848 = 28850 2 + 30907 = 30909 2 + 31244 = 31246 2 + 32277 = 32279 2 + 268435456 = 268435458 2 + 888515840709 = 888515840711 2 + 1099511627775 = 1099511627777 2 + 17381190257349 = 17381190257351 2 + 17592186044415 = 17592186044417 2 + 17592186044416 = 17592186044418 2 + 35184372088832 = 35184372088834 2 + 123145302310912 = 123145302310914 2 + 140737488355328 = 140737488355330 2 + 281263980923589 = 281263980923591 2 + 281474976710640 = 281474976710642 2 + 281474976710641 = 281474976710643 2 + 281474976710654 = 281474976710656 2 + 281474976710655 = 281474976710657 2 + 281474976710656 = 281474976710658 15 + 15 = 30 15 + 364 = 379 15 + 2938 = 2953 15 + 3136 = 3151 15 + 3514 = 3529 15 + 3627 = 3642 15 + 3861 = 3876 15 + 6117 = 6132 15 + 6424 = 6439 15 + 7448 = 7463 15 + 8184 = 8199 15 + 9312 = 9327 15 + 10269 = 10284 15 + 12738 = 12753 15 + 13485 = 13500 15 + 15090 = 15105 15 + 15161 = 15176 15 + 15970 = 15985 15 + 15987 = 16002 15 + 17517 = 17532 15 + 18308 = 18323 15 + 18455 = 18470 15 + 18464 = 18479 15 + 20525 = 20540 15 + 20576 = 20591 15 + 20718 = 20733 15 + 22099 = 22114 15 + 22859 = 22874 15 + 22934 = 22949 15 + 23269 = 23284 15 + 23520 = 23535 15 + 23947 = 23962 15 + 24541 = 24556 15 + 24580 = 24595 15 + 25137 = 25152 15 + 27342 = 27357 15 + 27387 = 27402 15 + 28848 = 28863 15 + 30907 = 30922 15 + 31244 = 31259 15 + 32277 = 32292 15 + 268435456 = 268435471 15 + 888515840709 = 888515840724 15 + 1099511627775 = 1099511627790 15 + 17381190257349 = 17381190257364 15 + 17592186044415 = 17592186044430 15 + 17592186044416 = 17592186044431 15 + 35184372088832 = 35184372088847 15 + 123145302310912 = 123145302310927 15 + 140737488355328 = 140737488355343 15 + 281263980923589 = 281263980923604 15 + 281474976710640 = 281474976710655 15 + 281474976710641 = 281474976710656 15 + 281474976710654 = 281474976710669 15 + 281474976710655 = 281474976710670 15 + 281474976710656 = 281474976710671 364 + 364 = 728 364 + 2938 = 3302 364 + 3136 = 3500 364 + 3514 = 3878 364 + 3627 = 3991 364 + 3861 = 4225 364 + 6117 = 6481 364 + 6424 = 6788 364 + 7448 = 7812 364 + 8184 = 8548 364 + 9312 = 9676 364 + 10269 = 10633 364 + 12738 = 13102 364 + 13485 = 13849 364 + 15090 = 15454 364 + 15161 = 15525 364 + 15970 = 16334 364 + 15987 = 16351 364 + 17517 = 17881 364 + 18308 = 18672 364 + 18455 = 18819 364 + 18464 = 18828 364 + 20525 = 20889 364 + 20576 = 20940 364 + 20718 = 21082 364 + 22099 = 22463 364 + 22859 = 23223 364 + 22934 = 23298 364 + 23269 = 23633 364 + 23520 = 23884 364 + 23947 = 24311 364 + 24541 = 24905 364 + 24580 = 24944 364 + 25137 = 25501 364 + 27342 = 27706 364 + 27387 = 27751 364 + 28848 = 29212 364 + 30907 = 31271 364 + 31244 = 31608 364 + 32277 = 32641 364 + 268435456 = 268435820 364 + 888515840709 = 888515841073 364 + 1099511627775 = 1099511628139 364 + 17381190257349 = 17381190257713 364 + 17592186044415 = 17592186044779 364 + 17592186044416 = 17592186044780 364 + 35184372088832 = 35184372089196 364 + 123145302310912 = 123145302311276 364 + 140737488355328 = 140737488355692 364 + 281263980923589 = 281263980923953 364 + 281474976710640 = 281474976711004 364 + 281474976710641 = 281474976711005 364 + 281474976710654 = 281474976711018 364 + 281474976710655 = 281474976711019 364 + 281474976710656 = 281474976711020 2938 + 2938 = 5876 2938 + 3136 = 6074 2938 + 3514 = 6452 2938 + 3627 = 6565 2938 + 3861 = 6799 2938 + 6117 = 9055 2938 + 6424 = 9362 2938 + 7448 = 10386 2938 + 8184 = 11122 2938 + 9312 = 12250 2938 + 10269 = 13207 2938 + 12738 = 15676 2938 + 13485 = 16423 2938 + 15090 = 18028 2938 + 15161 = 18099 2938 + 15970 = 18908 2938 + 15987 = 18925 2938 + 17517 = 20455 2938 + 18308 = 21246 2938 + 18455 = 21393 2938 + 18464 = 21402 2938 + 20525 = 23463 2938 + 20576 = 23514 2938 + 20718 = 23656 2938 + 22099 = 25037 2938 + 22859 = 25797 2938 + 22934 = 25872 2938 + 23269 = 26207 2938 + 23520 = 26458 2938 + 23947 = 26885 2938 + 24541 = 27479 2938 + 24580 = 27518 2938 + 25137 = 28075 2938 + 27342 = 30280 2938 + 27387 = 30325 2938 + 28848 = 31786 2938 + 30907 = 33845 2938 + 31244 = 34182 2938 + 32277 = 35215 2938 + 268435456 = 268438394 2938 + 888515840709 = 888515843647 2938 + 1099511627775 = 1099511630713 2938 + 17381190257349 = 17381190260287 2938 + 17592186044415 = 17592186047353 2938 + 17592186044416 = 17592186047354 2938 + 35184372088832 = 35184372091770 2938 + 123145302310912 = 123145302313850 2938 + 140737488355328 = 140737488358266 2938 + 281263980923589 = 281263980926527 2938 + 281474976710640 = 281474976713578 2938 + 281474976710641 = 281474976713579 2938 + 281474976710654 = 281474976713592 2938 + 281474976710655 = 281474976713593 2938 + 281474976710656 = 281474976713594 3136 + 3136 = 6272 3136 + 3514 = 6650 3136 + 3627 = 6763 3136 + 3861 = 6997 3136 + 6117 = 9253 3136 + 6424 = 9560 3136 + 7448 = 10584 3136 + 8184 = 11320 3136 + 9312 = 12448 3136 + 10269 = 13405 3136 + 12738 = 15874 3136 + 13485 = 16621 3136 + 15090 = 18226 3136 + 15161 = 18297 3136 + 15970 = 19106 3136 + 15987 = 19123 3136 + 17517 = 20653 3136 + 18308 = 21444 3136 + 18455 = 21591 3136 + 18464 = 21600 3136 + 20525 = 23661 3136 + 20576 = 23712 3136 + 20718 = 23854 3136 + 22099 = 25235 3136 + 22859 = 25995 3136 + 22934 = 26070 3136 + 23269 = 26405 3136 + 23520 = 26656 3136 + 23947 = 27083 3136 + 24541 = 27677 3136 + 24580 = 27716 3136 + 25137 = 28273 3136 + 27342 = 30478 3136 + 27387 = 30523 3136 + 28848 = 31984 3136 + 30907 = 34043 3136 + 31244 = 34380 3136 + 32277 = 35413 3136 + 268435456 = 268438592 3136 + 888515840709 = 888515843845 3136 + 1099511627775 = 1099511630911 3136 + 17381190257349 = 17381190260485 3136 + 17592186044415 = 17592186047551 3136 + 17592186044416 = 17592186047552 3136 + 35184372088832 = 35184372091968 3136 + 123145302310912 = 123145302314048 3136 + 140737488355328 = 140737488358464 3136 + 281263980923589 = 281263980926725 3136 + 281474976710640 = 281474976713776 3136 + 281474976710641 = 281474976713777 3136 + 281474976710654 = 281474976713790 3136 + 281474976710655 = 281474976713791 3136 + 281474976710656 = 281474976713792 3514 + 3514 = 7028 3514 + 3627 = 7141 3514 + 3861 = 7375 3514 + 6117 = 9631 3514 + 6424 = 9938 3514 + 7448 = 10962 3514 + 8184 = 11698 3514 + 9312 = 12826 3514 + 10269 = 13783 3514 + 12738 = 16252 3514 + 13485 = 16999 3514 + 15090 = 18604 3514 + 15161 = 18675 3514 + 15970 = 19484 3514 + 15987 = 19501 3514 + 17517 = 21031 3514 + 18308 = 21822 3514 + 18455 = 21969 3514 + 18464 = 21978 3514 + 20525 = 24039 3514 + 20576 = 24090 3514 + 20718 = 24232 3514 + 22099 = 25613 3514 + 22859 = 26373 3514 + 22934 = 26448 3514 + 23269 = 26783 3514 + 23520 = 27034 3514 + 23947 = 27461 3514 + 24541 = 28055 3514 + 24580 = 28094 3514 + 25137 = 28651 3514 + 27342 = 30856 3514 + 27387 = 30901 3514 + 28848 = 32362 3514 + 30907 = 34421 3514 + 31244 = 34758 3514 + 32277 = 35791 3514 + 268435456 = 268438970 3514 + 888515840709 = 888515844223 3514 + 1099511627775 = 1099511631289 3514 + 17381190257349 = 17381190260863 3514 + 17592186044415 = 17592186047929 3514 + 17592186044416 = 17592186047930 3514 + 35184372088832 = 35184372092346 3514 + 123145302310912 = 123145302314426 3514 + 140737488355328 = 140737488358842 3514 + 281263980923589 = 281263980927103 3514 + 281474976710640 = 281474976714154 3514 + 281474976710641 = 281474976714155 3514 + 281474976710654 = 281474976714168 3514 + 281474976710655 = 281474976714169 3514 + 281474976710656 = 281474976714170 3627 + 3627 = 7254 3627 + 3861 = 7488 3627 + 6117 = 9744 3627 + 6424 = 10051 3627 + 7448 = 11075 3627 + 8184 = 11811 3627 + 9312 = 12939 3627 + 10269 = 13896 3627 + 12738 = 16365 3627 + 13485 = 17112 3627 + 15090 = 18717 3627 + 15161 = 18788 3627 + 15970 = 19597 3627 + 15987 = 19614 3627 + 17517 = 21144 3627 + 18308 = 21935 3627 + 18455 = 22082 3627 + 18464 = 22091 3627 + 20525 = 24152 3627 + 20576 = 24203 3627 + 20718 = 24345 3627 + 22099 = 25726 3627 + 22859 = 26486 3627 + 22934 = 26561 3627 + 23269 = 26896 3627 + 23520 = 27147 3627 + 23947 = 27574 3627 + 24541 = 28168 3627 + 24580 = 28207 3627 + 25137 = 28764 3627 + 27342 = 30969 3627 + 27387 = 31014 3627 + 28848 = 32475 3627 + 30907 = 34534 3627 + 31244 = 34871 3627 + 32277 = 35904 3627 + 268435456 = 268439083 3627 + 888515840709 = 888515844336 3627 + 1099511627775 = 1099511631402 3627 + 17381190257349 = 17381190260976 3627 + 17592186044415 = 17592186048042 3627 + 17592186044416 = 17592186048043 3627 + 35184372088832 = 35184372092459 3627 + 123145302310912 = 123145302314539 3627 + 140737488355328 = 140737488358955 3627 + 281263980923589 = 281263980927216 3627 + 281474976710640 = 281474976714267 3627 + 281474976710641 = 281474976714268 3627 + 281474976710654 = 281474976714281 3627 + 281474976710655 = 281474976714282 3627 + 281474976710656 = 281474976714283 3861 + 3861 = 7722 3861 + 6117 = 9978 3861 + 6424 = 10285 3861 + 7448 = 11309 3861 + 8184 = 12045 3861 + 9312 = 13173 3861 + 10269 = 14130 3861 + 12738 = 16599 3861 + 13485 = 17346 3861 + 15090 = 18951 3861 + 15161 = 19022 3861 + 15970 = 19831 3861 + 15987 = 19848 3861 + 17517 = 21378 3861 + 18308 = 22169 3861 + 18455 = 22316 3861 + 18464 = 22325 3861 + 20525 = 24386 3861 + 20576 = 24437 3861 + 20718 = 24579 3861 + 22099 = 25960 3861 + 22859 = 26720 3861 + 22934 = 26795 3861 + 23269 = 27130 3861 + 23520 = 27381 3861 + 23947 = 27808 3861 + 24541 = 28402 3861 + 24580 = 28441 3861 + 25137 = 28998 3861 + 27342 = 31203 3861 + 27387 = 31248 3861 + 28848 = 32709 3861 + 30907 = 34768 3861 + 31244 = 35105 3861 + 32277 = 36138 3861 + 268435456 = 268439317 3861 + 888515840709 = 888515844570 3861 + 1099511627775 = 1099511631636 3861 + 17381190257349 = 17381190261210 3861 + 17592186044415 = 17592186048276 3861 + 17592186044416 = 17592186048277 3861 + 35184372088832 = 35184372092693 3861 + 123145302310912 = 123145302314773 3861 + 140737488355328 = 140737488359189 3861 + 281263980923589 = 281263980927450 3861 + 281474976710640 = 281474976714501 3861 + 281474976710641 = 281474976714502 3861 + 281474976710654 = 281474976714515 3861 + 281474976710655 = 281474976714516 3861 + 281474976710656 = 281474976714517 6117 + 6117 = 12234 6117 + 6424 = 12541 6117 + 7448 = 13565 6117 + 8184 = 14301 6117 + 9312 = 15429 6117 + 10269 = 16386 6117 + 12738 = 18855 6117 + 13485 = 19602 6117 + 15090 = 21207 6117 + 15161 = 21278 6117 + 15970 = 22087 6117 + 15987 = 22104 6117 + 17517 = 23634 6117 + 18308 = 24425 6117 + 18455 = 24572 6117 + 18464 = 24581 6117 + 20525 = 26642 6117 + 20576 = 26693 6117 + 20718 = 26835 6117 + 22099 = 28216 6117 + 22859 = 28976 6117 + 22934 = 29051 6117 + 23269 = 29386 6117 + 23520 = 29637 6117 + 23947 = 30064 6117 + 24541 = 30658 6117 + 24580 = 30697 6117 + 25137 = 31254 6117 + 27342 = 33459 6117 + 27387 = 33504 6117 + 28848 = 34965 6117 + 30907 = 37024 6117 + 31244 = 37361 6117 + 32277 = 38394 6117 + 268435456 = 268441573 6117 + 888515840709 = 888515846826 6117 + 1099511627775 = 1099511633892 6117 + 17381190257349 = 17381190263466 6117 + 17592186044415 = 17592186050532 6117 + 17592186044416 = 17592186050533 6117 + 35184372088832 = 35184372094949 6117 + 123145302310912 = 123145302317029 6117 + 140737488355328 = 140737488361445 6117 + 281263980923589 = 281263980929706 6117 + 281474976710640 = 281474976716757 6117 + 281474976710641 = 281474976716758 6117 + 281474976710654 = 281474976716771 6117 + 281474976710655 = 281474976716772 6117 + 281474976710656 = 281474976716773 6424 + 6424 = 12848 6424 + 7448 = 13872 6424 + 8184 = 14608 6424 + 9312 = 15736 6424 + 10269 = 16693 6424 + 12738 = 19162 6424 + 13485 = 19909 6424 + 15090 = 21514 6424 + 15161 = 21585 6424 + 15970 = 22394 6424 + 15987 = 22411 6424 + 17517 = 23941 6424 + 18308 = 24732 6424 + 18455 = 24879 6424 + 18464 = 24888 6424 + 20525 = 26949 6424 + 20576 = 27000 6424 + 20718 = 27142 6424 + 22099 = 28523 6424 + 22859 = 29283 6424 + 22934 = 29358 6424 + 23269 = 29693 6424 + 23520 = 29944 6424 + 23947 = 30371 6424 + 24541 = 30965 6424 + 24580 = 31004 6424 + 25137 = 31561 6424 + 27342 = 33766 6424 + 27387 = 33811 6424 + 28848 = 35272 6424 + 30907 = 37331 6424 + 31244 = 37668 6424 + 32277 = 38701 6424 + 268435456 = 268441880 6424 + 888515840709 = 888515847133 6424 + 1099511627775 = 1099511634199 6424 + 17381190257349 = 17381190263773 6424 + 17592186044415 = 17592186050839 6424 + 17592186044416 = 17592186050840 6424 + 35184372088832 = 35184372095256 6424 + 123145302310912 = 123145302317336 6424 + 140737488355328 = 140737488361752 6424 + 281263980923589 = 281263980930013 6424 + 281474976710640 = 281474976717064 6424 + 281474976710641 = 281474976717065 6424 + 281474976710654 = 281474976717078 6424 + 281474976710655 = 281474976717079 6424 + 281474976710656 = 281474976717080 7448 + 7448 = 14896 7448 + 8184 = 15632 7448 + 9312 = 16760 7448 + 10269 = 17717 7448 + 12738 = 20186 7448 + 13485 = 20933 7448 + 15090 = 22538 7448 + 15161 = 22609 7448 + 15970 = 23418 7448 + 15987 = 23435 7448 + 17517 = 24965 7448 + 18308 = 25756 7448 + 18455 = 25903 7448 + 18464 = 25912 7448 + 20525 = 27973 7448 + 20576 = 28024 7448 + 20718 = 28166 7448 + 22099 = 29547 7448 + 22859 = 30307 7448 + 22934 = 30382 7448 + 23269 = 30717 7448 + 23520 = 30968 7448 + 23947 = 31395 7448 + 24541 = 31989 7448 + 24580 = 32028 7448 + 25137 = 32585 7448 + 27342 = 34790 7448 + 27387 = 34835 7448 + 28848 = 36296 7448 + 30907 = 38355 7448 + 31244 = 38692 7448 + 32277 = 39725 7448 + 268435456 = 268442904 7448 + 888515840709 = 888515848157 7448 + 1099511627775 = 1099511635223 7448 + 17381190257349 = 17381190264797 7448 + 17592186044415 = 17592186051863 7448 + 17592186044416 = 17592186051864 7448 + 35184372088832 = 35184372096280 7448 + 123145302310912 = 123145302318360 7448 + 140737488355328 = 140737488362776 7448 + 281263980923589 = 281263980931037 7448 + 281474976710640 = 281474976718088 7448 + 281474976710641 = 281474976718089 7448 + 281474976710654 = 281474976718102 7448 + 281474976710655 = 281474976718103 7448 + 281474976710656 = 281474976718104 8184 + 8184 = 16368 8184 + 9312 = 17496 8184 + 10269 = 18453 8184 + 12738 = 20922 8184 + 13485 = 21669 8184 + 15090 = 23274 8184 + 15161 = 23345 8184 + 15970 = 24154 8184 + 15987 = 24171 8184 + 17517 = 25701 8184 + 18308 = 26492 8184 + 18455 = 26639 8184 + 18464 = 26648 8184 + 20525 = 28709 8184 + 20576 = 28760 8184 + 20718 = 28902 8184 + 22099 = 30283 8184 + 22859 = 31043 8184 + 22934 = 31118 8184 + 23269 = 31453 8184 + 23520 = 31704 8184 + 23947 = 32131 8184 + 24541 = 32725 8184 + 24580 = 32764 8184 + 25137 = 33321 8184 + 27342 = 35526 8184 + 27387 = 35571 8184 + 28848 = 37032 8184 + 30907 = 39091 8184 + 31244 = 39428 8184 + 32277 = 40461 8184 + 268435456 = 268443640 8184 + 888515840709 = 888515848893 8184 + 1099511627775 = 1099511635959 8184 + 17381190257349 = 17381190265533 8184 + 17592186044415 = 17592186052599 8184 + 17592186044416 = 17592186052600 8184 + 35184372088832 = 35184372097016 8184 + 123145302310912 = 123145302319096 8184 + 140737488355328 = 140737488363512 8184 + 281263980923589 = 281263980931773 8184 + 281474976710640 = 281474976718824 8184 + 281474976710641 = 281474976718825 8184 + 281474976710654 = 281474976718838 8184 + 281474976710655 = 281474976718839 8184 + 281474976710656 = 281474976718840 9312 + 9312 = 18624 9312 + 10269 = 19581 9312 + 12738 = 22050 9312 + 13485 = 22797 9312 + 15090 = 24402 9312 + 15161 = 24473 9312 + 15970 = 25282 9312 + 15987 = 25299 9312 + 17517 = 26829 9312 + 18308 = 27620 9312 + 18455 = 27767 9312 + 18464 = 27776 9312 + 20525 = 29837 9312 + 20576 = 29888 9312 + 20718 = 30030 9312 + 22099 = 31411 9312 + 22859 = 32171 9312 + 22934 = 32246 9312 + 23269 = 32581 9312 + 23520 = 32832 9312 + 23947 = 33259 9312 + 24541 = 33853 9312 + 24580 = 33892 9312 + 25137 = 34449 9312 + 27342 = 36654 9312 + 27387 = 36699 9312 + 28848 = 38160 9312 + 30907 = 40219 9312 + 31244 = 40556 9312 + 32277 = 41589 9312 + 268435456 = 268444768 9312 + 888515840709 = 888515850021 9312 + 1099511627775 = 1099511637087 9312 + 17381190257349 = 17381190266661 9312 + 17592186044415 = 17592186053727 9312 + 17592186044416 = 17592186053728 9312 + 35184372088832 = 35184372098144 9312 + 123145302310912 = 123145302320224 9312 + 140737488355328 = 140737488364640 9312 + 281263980923589 = 281263980932901 9312 + 281474976710640 = 281474976719952 9312 + 281474976710641 = 281474976719953 9312 + 281474976710654 = 281474976719966 9312 + 281474976710655 = 281474976719967 9312 + 281474976710656 = 281474976719968 10269 + 10269 = 20538 10269 + 12738 = 23007 10269 + 13485 = 23754 10269 + 15090 = 25359 10269 + 15161 = 25430 10269 + 15970 = 26239 10269 + 15987 = 26256 10269 + 17517 = 27786 10269 + 18308 = 28577 10269 + 18455 = 28724 10269 + 18464 = 28733 10269 + 20525 = 30794 10269 + 20576 = 30845 10269 + 20718 = 30987 10269 + 22099 = 32368 10269 + 22859 = 33128 10269 + 22934 = 33203 10269 + 23269 = 33538 10269 + 23520 = 33789 10269 + 23947 = 34216 10269 + 24541 = 34810 10269 + 24580 = 34849 10269 + 25137 = 35406 10269 + 27342 = 37611 10269 + 27387 = 37656 10269 + 28848 = 39117 10269 + 30907 = 41176 10269 + 31244 = 41513 10269 + 32277 = 42546 10269 + 268435456 = 268445725 10269 + 888515840709 = 888515850978 10269 + 1099511627775 = 1099511638044 10269 + 17381190257349 = 17381190267618 10269 + 17592186044415 = 17592186054684 10269 + 17592186044416 = 17592186054685 10269 + 35184372088832 = 35184372099101 10269 + 123145302310912 = 123145302321181 10269 + 140737488355328 = 140737488365597 10269 + 281263980923589 = 281263980933858 10269 + 281474976710640 = 281474976720909 10269 + 281474976710641 = 281474976720910 10269 + 281474976710654 = 281474976720923 10269 + 281474976710655 = 281474976720924 10269 + 281474976710656 = 281474976720925 12738 + 12738 = 25476 12738 + 13485 = 26223 12738 + 15090 = 27828 12738 + 15161 = 27899 12738 + 15970 = 28708 12738 + 15987 = 28725 12738 + 17517 = 30255 12738 + 18308 = 31046 12738 + 18455 = 31193 12738 + 18464 = 31202 12738 + 20525 = 33263 12738 + 20576 = 33314 12738 + 20718 = 33456 12738 + 22099 = 34837 12738 + 22859 = 35597 12738 + 22934 = 35672 12738 + 23269 = 36007 12738 + 23520 = 36258 12738 + 23947 = 36685 12738 + 24541 = 37279 12738 + 24580 = 37318 12738 + 25137 = 37875 12738 + 27342 = 40080 12738 + 27387 = 40125 12738 + 28848 = 41586 12738 + 30907 = 43645 12738 + 31244 = 43982 12738 + 32277 = 45015 12738 + 268435456 = 268448194 12738 + 888515840709 = 888515853447 12738 + 1099511627775 = 1099511640513 12738 + 17381190257349 = 17381190270087 12738 + 17592186044415 = 17592186057153 12738 + 17592186044416 = 17592186057154 12738 + 35184372088832 = 35184372101570 12738 + 123145302310912 = 123145302323650 12738 + 140737488355328 = 140737488368066 12738 + 281263980923589 = 281263980936327 12738 + 281474976710640 = 281474976723378 12738 + 281474976710641 = 281474976723379 12738 + 281474976710654 = 281474976723392 12738 + 281474976710655 = 281474976723393 12738 + 281474976710656 = 281474976723394 13485 + 13485 = 26970 13485 + 15090 = 28575 13485 + 15161 = 28646 13485 + 15970 = 29455 13485 + 15987 = 29472 13485 + 17517 = 31002 13485 + 18308 = 31793 13485 + 18455 = 31940 13485 + 18464 = 31949 13485 + 20525 = 34010 13485 + 20576 = 34061 13485 + 20718 = 34203 13485 + 22099 = 35584 13485 + 22859 = 36344 13485 + 22934 = 36419 13485 + 23269 = 36754 13485 + 23520 = 37005 13485 + 23947 = 37432 13485 + 24541 = 38026 13485 + 24580 = 38065 13485 + 25137 = 38622 13485 + 27342 = 40827 13485 + 27387 = 40872 13485 + 28848 = 42333 13485 + 30907 = 44392 13485 + 31244 = 44729 13485 + 32277 = 45762 13485 + 268435456 = 268448941 13485 + 888515840709 = 888515854194 13485 + 1099511627775 = 1099511641260 13485 + 17381190257349 = 17381190270834 13485 + 17592186044415 = 17592186057900 13485 + 17592186044416 = 17592186057901 13485 + 35184372088832 = 35184372102317 13485 + 123145302310912 = 123145302324397 13485 + 140737488355328 = 140737488368813 13485 + 281263980923589 = 281263980937074 13485 + 281474976710640 = 281474976724125 13485 + 281474976710641 = 281474976724126 13485 + 281474976710654 = 281474976724139 13485 + 281474976710655 = 281474976724140 13485 + 281474976710656 = 281474976724141 15090 + 15090 = 30180 15090 + 15161 = 30251 15090 + 15970 = 31060 15090 + 15987 = 31077 15090 + 17517 = 32607 15090 + 18308 = 33398 15090 + 18455 = 33545 15090 + 18464 = 33554 15090 + 20525 = 35615 15090 + 20576 = 35666 15090 + 20718 = 35808 15090 + 22099 = 37189 15090 + 22859 = 37949 15090 + 22934 = 38024 15090 + 23269 = 38359 15090 + 23520 = 38610 15090 + 23947 = 39037 15090 + 24541 = 39631 15090 + 24580 = 39670 15090 + 25137 = 40227 15090 + 27342 = 42432 15090 + 27387 = 42477 15090 + 28848 = 43938 15090 + 30907 = 45997 15090 + 31244 = 46334 15090 + 32277 = 47367 15090 + 268435456 = 268450546 15090 + 888515840709 = 888515855799 15090 + 1099511627775 = 1099511642865 15090 + 17381190257349 = 17381190272439 15090 + 17592186044415 = 17592186059505 15090 + 17592186044416 = 17592186059506 15090 + 35184372088832 = 35184372103922 15090 + 123145302310912 = 123145302326002 15090 + 140737488355328 = 140737488370418 15090 + 281263980923589 = 281263980938679 15090 + 281474976710640 = 281474976725730 15090 + 281474976710641 = 281474976725731 15090 + 281474976710654 = 281474976725744 15090 + 281474976710655 = 281474976725745 15090 + 281474976710656 = 281474976725746 15161 + 15161 = 30322 15161 + 15970 = 31131 15161 + 15987 = 31148 15161 + 17517 = 32678 15161 + 18308 = 33469 15161 + 18455 = 33616 15161 + 18464 = 33625 15161 + 20525 = 35686 15161 + 20576 = 35737 15161 + 20718 = 35879 15161 + 22099 = 37260 15161 + 22859 = 38020 15161 + 22934 = 38095 15161 + 23269 = 38430 15161 + 23520 = 38681 15161 + 23947 = 39108 15161 + 24541 = 39702 15161 + 24580 = 39741 15161 + 25137 = 40298 15161 + 27342 = 42503 15161 + 27387 = 42548 15161 + 28848 = 44009 15161 + 30907 = 46068 15161 + 31244 = 46405 15161 + 32277 = 47438 15161 + 268435456 = 268450617 15161 + 888515840709 = 888515855870 15161 + 1099511627775 = 1099511642936 15161 + 17381190257349 = 17381190272510 15161 + 17592186044415 = 17592186059576 15161 + 17592186044416 = 17592186059577 15161 + 35184372088832 = 35184372103993 15161 + 123145302310912 = 123145302326073 15161 + 140737488355328 = 140737488370489 15161 + 281263980923589 = 281263980938750 15161 + 281474976710640 = 281474976725801 15161 + 281474976710641 = 281474976725802 15161 + 281474976710654 = 281474976725815 15161 + 281474976710655 = 281474976725816 15161 + 281474976710656 = 281474976725817 15970 + 15970 = 31940 15970 + 15987 = 31957 15970 + 17517 = 33487 15970 + 18308 = 34278 15970 + 18455 = 34425 15970 + 18464 = 34434 15970 + 20525 = 36495 15970 + 20576 = 36546 15970 + 20718 = 36688 15970 + 22099 = 38069 15970 + 22859 = 38829 15970 + 22934 = 38904 15970 + 23269 = 39239 15970 + 23520 = 39490 15970 + 23947 = 39917 15970 + 24541 = 40511 15970 + 24580 = 40550 15970 + 25137 = 41107 15970 + 27342 = 43312 15970 + 27387 = 43357 15970 + 28848 = 44818 15970 + 30907 = 46877 15970 + 31244 = 47214 15970 + 32277 = 48247 15970 + 268435456 = 268451426 15970 + 888515840709 = 888515856679 15970 + 1099511627775 = 1099511643745 15970 + 17381190257349 = 17381190273319 15970 + 17592186044415 = 17592186060385 15970 + 17592186044416 = 17592186060386 15970 + 35184372088832 = 35184372104802 15970 + 123145302310912 = 123145302326882 15970 + 140737488355328 = 140737488371298 15970 + 281263980923589 = 281263980939559 15970 + 281474976710640 = 281474976726610 15970 + 281474976710641 = 281474976726611 15970 + 281474976710654 = 281474976726624 15970 + 281474976710655 = 281474976726625 15970 + 281474976710656 = 281474976726626 15987 + 15987 = 31974 15987 + 17517 = 33504 15987 + 18308 = 34295 15987 + 18455 = 34442 15987 + 18464 = 34451 15987 + 20525 = 36512 15987 + 20576 = 36563 15987 + 20718 = 36705 15987 + 22099 = 38086 15987 + 22859 = 38846 15987 + 22934 = 38921 15987 + 23269 = 39256 15987 + 23520 = 39507 15987 + 23947 = 39934 15987 + 24541 = 40528 15987 + 24580 = 40567 15987 + 25137 = 41124 15987 + 27342 = 43329 15987 + 27387 = 43374 15987 + 28848 = 44835 15987 + 30907 = 46894 15987 + 31244 = 47231 15987 + 32277 = 48264 15987 + 268435456 = 268451443 15987 + 888515840709 = 888515856696 15987 + 1099511627775 = 1099511643762 15987 + 17381190257349 = 17381190273336 15987 + 17592186044415 = 17592186060402 15987 + 17592186044416 = 17592186060403 15987 + 35184372088832 = 35184372104819 15987 + 123145302310912 = 123145302326899 15987 + 140737488355328 = 140737488371315 15987 + 281263980923589 = 281263980939576 15987 + 281474976710640 = 281474976726627 15987 + 281474976710641 = 281474976726628 15987 + 281474976710654 = 281474976726641 15987 + 281474976710655 = 281474976726642 15987 + 281474976710656 = 281474976726643 17517 + 17517 = 35034 17517 + 18308 = 35825 17517 + 18455 = 35972 17517 + 18464 = 35981 17517 + 20525 = 38042 17517 + 20576 = 38093 17517 + 20718 = 38235 17517 + 22099 = 39616 17517 + 22859 = 40376 17517 + 22934 = 40451 17517 + 23269 = 40786 17517 + 23520 = 41037 17517 + 23947 = 41464 17517 + 24541 = 42058 17517 + 24580 = 42097 17517 + 25137 = 42654 17517 + 27342 = 44859 17517 + 27387 = 44904 17517 + 28848 = 46365 17517 + 30907 = 48424 17517 + 31244 = 48761 17517 + 32277 = 49794 17517 + 268435456 = 268452973 17517 + 888515840709 = 888515858226 17517 + 1099511627775 = 1099511645292 17517 + 17381190257349 = 17381190274866 17517 + 17592186044415 = 17592186061932 17517 + 17592186044416 = 17592186061933 17517 + 35184372088832 = 35184372106349 17517 + 123145302310912 = 123145302328429 17517 + 140737488355328 = 140737488372845 17517 + 281263980923589 = 281263980941106 17517 + 281474976710640 = 281474976728157 17517 + 281474976710641 = 281474976728158 17517 + 281474976710654 = 281474976728171 17517 + 281474976710655 = 281474976728172 17517 + 281474976710656 = 281474976728173 18308 + 18308 = 36616 18308 + 18455 = 36763 18308 + 18464 = 36772 18308 + 20525 = 38833 18308 + 20576 = 38884 18308 + 20718 = 39026 18308 + 22099 = 40407 18308 + 22859 = 41167 18308 + 22934 = 41242 18308 + 23269 = 41577 18308 + 23520 = 41828 18308 + 23947 = 42255 18308 + 24541 = 42849 18308 + 24580 = 42888 18308 + 25137 = 43445 18308 + 27342 = 45650 18308 + 27387 = 45695 18308 + 28848 = 47156 18308 + 30907 = 49215 18308 + 31244 = 49552 18308 + 32277 = 50585 18308 + 268435456 = 268453764 18308 + 888515840709 = 888515859017 18308 + 1099511627775 = 1099511646083 18308 + 17381190257349 = 17381190275657 18308 + 17592186044415 = 17592186062723 18308 + 17592186044416 = 17592186062724 18308 + 35184372088832 = 35184372107140 18308 + 123145302310912 = 123145302329220 18308 + 140737488355328 = 140737488373636 18308 + 281263980923589 = 281263980941897 18308 + 281474976710640 = 281474976728948 18308 + 281474976710641 = 281474976728949 18308 + 281474976710654 = 281474976728962 18308 + 281474976710655 = 281474976728963 18308 + 281474976710656 = 281474976728964 18455 + 18455 = 36910 18455 + 18464 = 36919 18455 + 20525 = 38980 18455 + 20576 = 39031 18455 + 20718 = 39173 18455 + 22099 = 40554 18455 + 22859 = 41314 18455 + 22934 = 41389 18455 + 23269 = 41724 18455 + 23520 = 41975 18455 + 23947 = 42402 18455 + 24541 = 42996 18455 + 24580 = 43035 18455 + 25137 = 43592 18455 + 27342 = 45797 18455 + 27387 = 45842 18455 + 28848 = 47303 18455 + 30907 = 49362 18455 + 31244 = 49699 18455 + 32277 = 50732 18455 + 268435456 = 268453911 18455 + 888515840709 = 888515859164 18455 + 1099511627775 = 1099511646230 18455 + 17381190257349 = 17381190275804 18455 + 17592186044415 = 17592186062870 18455 + 17592186044416 = 17592186062871 18455 + 35184372088832 = 35184372107287 18455 + 123145302310912 = 123145302329367 18455 + 140737488355328 = 140737488373783 18455 + 281263980923589 = 281263980942044 18455 + 281474976710640 = 281474976729095 18455 + 281474976710641 = 281474976729096 18455 + 281474976710654 = 281474976729109 18455 + 281474976710655 = 281474976729110 18455 + 281474976710656 = 281474976729111 18464 + 18464 = 36928 18464 + 20525 = 38989 18464 + 20576 = 39040 18464 + 20718 = 39182 18464 + 22099 = 40563 18464 + 22859 = 41323 18464 + 22934 = 41398 18464 + 23269 = 41733 18464 + 23520 = 41984 18464 + 23947 = 42411 18464 + 24541 = 43005 18464 + 24580 = 43044 18464 + 25137 = 43601 18464 + 27342 = 45806 18464 + 27387 = 45851 18464 + 28848 = 47312 18464 + 30907 = 49371 18464 + 31244 = 49708 18464 + 32277 = 50741 18464 + 268435456 = 268453920 18464 + 888515840709 = 888515859173 18464 + 1099511627775 = 1099511646239 18464 + 17381190257349 = 17381190275813 18464 + 17592186044415 = 17592186062879 18464 + 17592186044416 = 17592186062880 18464 + 35184372088832 = 35184372107296 18464 + 123145302310912 = 123145302329376 18464 + 140737488355328 = 140737488373792 18464 + 281263980923589 = 281263980942053 18464 + 281474976710640 = 281474976729104 18464 + 281474976710641 = 281474976729105 18464 + 281474976710654 = 281474976729118 18464 + 281474976710655 = 281474976729119 18464 + 281474976710656 = 281474976729120 20525 + 20525 = 41050 20525 + 20576 = 41101 20525 + 20718 = 41243 20525 + 22099 = 42624 20525 + 22859 = 43384 20525 + 22934 = 43459 20525 + 23269 = 43794 20525 + 23520 = 44045 20525 + 23947 = 44472 20525 + 24541 = 45066 20525 + 24580 = 45105 20525 + 25137 = 45662 20525 + 27342 = 47867 20525 + 27387 = 47912 20525 + 28848 = 49373 20525 + 30907 = 51432 20525 + 31244 = 51769 20525 + 32277 = 52802 20525 + 268435456 = 268455981 20525 + 888515840709 = 888515861234 20525 + 1099511627775 = 1099511648300 20525 + 17381190257349 = 17381190277874 20525 + 17592186044415 = 17592186064940 20525 + 17592186044416 = 17592186064941 20525 + 35184372088832 = 35184372109357 20525 + 123145302310912 = 123145302331437 20525 + 140737488355328 = 140737488375853 20525 + 281263980923589 = 281263980944114 20525 + 281474976710640 = 281474976731165 20525 + 281474976710641 = 281474976731166 20525 + 281474976710654 = 281474976731179 20525 + 281474976710655 = 281474976731180 20525 + 281474976710656 = 281474976731181 20576 + 20576 = 41152 20576 + 20718 = 41294 20576 + 22099 = 42675 20576 + 22859 = 43435 20576 + 22934 = 43510 20576 + 23269 = 43845 20576 + 23520 = 44096 20576 + 23947 = 44523 20576 + 24541 = 45117 20576 + 24580 = 45156 20576 + 25137 = 45713 20576 + 27342 = 47918 20576 + 27387 = 47963 20576 + 28848 = 49424 20576 + 30907 = 51483 20576 + 31244 = 51820 20576 + 32277 = 52853 20576 + 268435456 = 268456032 20576 + 888515840709 = 888515861285 20576 + 1099511627775 = 1099511648351 20576 + 17381190257349 = 17381190277925 20576 + 17592186044415 = 17592186064991 20576 + 17592186044416 = 17592186064992 20576 + 35184372088832 = 35184372109408 20576 + 123145302310912 = 123145302331488 20576 + 140737488355328 = 140737488375904 20576 + 281263980923589 = 281263980944165 20576 + 281474976710640 = 281474976731216 20576 + 281474976710641 = 281474976731217 20576 + 281474976710654 = 281474976731230 20576 + 281474976710655 = 281474976731231 20576 + 281474976710656 = 281474976731232 20718 + 20718 = 41436 20718 + 22099 = 42817 20718 + 22859 = 43577 20718 + 22934 = 43652 20718 + 23269 = 43987 20718 + 23520 = 44238 20718 + 23947 = 44665 20718 + 24541 = 45259 20718 + 24580 = 45298 20718 + 25137 = 45855 20718 + 27342 = 48060 20718 + 27387 = 48105 20718 + 28848 = 49566 20718 + 30907 = 51625 20718 + 31244 = 51962 20718 + 32277 = 52995 20718 + 268435456 = 268456174 20718 + 888515840709 = 888515861427 20718 + 1099511627775 = 1099511648493 20718 + 17381190257349 = 17381190278067 20718 + 17592186044415 = 17592186065133 20718 + 17592186044416 = 17592186065134 20718 + 35184372088832 = 35184372109550 20718 + 123145302310912 = 123145302331630 20718 + 140737488355328 = 140737488376046 20718 + 281263980923589 = 281263980944307 20718 + 281474976710640 = 281474976731358 20718 + 281474976710641 = 281474976731359 20718 + 281474976710654 = 281474976731372 20718 + 281474976710655 = 281474976731373 20718 + 281474976710656 = 281474976731374 22099 + 22099 = 44198 22099 + 22859 = 44958 22099 + 22934 = 45033 22099 + 23269 = 45368 22099 + 23520 = 45619 22099 + 23947 = 46046 22099 + 24541 = 46640 22099 + 24580 = 46679 22099 + 25137 = 47236 22099 + 27342 = 49441 22099 + 27387 = 49486 22099 + 28848 = 50947 22099 + 30907 = 53006 22099 + 31244 = 53343 22099 + 32277 = 54376 22099 + 268435456 = 268457555 22099 + 888515840709 = 888515862808 22099 + 1099511627775 = 1099511649874 22099 + 17381190257349 = 17381190279448 22099 + 17592186044415 = 17592186066514 22099 + 17592186044416 = 17592186066515 22099 + 35184372088832 = 35184372110931 22099 + 123145302310912 = 123145302333011 22099 + 140737488355328 = 140737488377427 22099 + 281263980923589 = 281263980945688 22099 + 281474976710640 = 281474976732739 22099 + 281474976710641 = 281474976732740 22099 + 281474976710654 = 281474976732753 22099 + 281474976710655 = 281474976732754 22099 + 281474976710656 = 281474976732755 22859 + 22859 = 45718 22859 + 22934 = 45793 22859 + 23269 = 46128 22859 + 23520 = 46379 22859 + 23947 = 46806 22859 + 24541 = 47400 22859 + 24580 = 47439 22859 + 25137 = 47996 22859 + 27342 = 50201 22859 + 27387 = 50246 22859 + 28848 = 51707 22859 + 30907 = 53766 22859 + 31244 = 54103 22859 + 32277 = 55136 22859 + 268435456 = 268458315 22859 + 888515840709 = 888515863568 22859 + 1099511627775 = 1099511650634 22859 + 17381190257349 = 17381190280208 22859 + 17592186044415 = 17592186067274 22859 + 17592186044416 = 17592186067275 22859 + 35184372088832 = 35184372111691 22859 + 123145302310912 = 123145302333771 22859 + 140737488355328 = 140737488378187 22859 + 281263980923589 = 281263980946448 22859 + 281474976710640 = 281474976733499 22859 + 281474976710641 = 281474976733500 22859 + 281474976710654 = 281474976733513 22859 + 281474976710655 = 281474976733514 22859 + 281474976710656 = 281474976733515 22934 + 22934 = 45868 22934 + 23269 = 46203 22934 + 23520 = 46454 22934 + 23947 = 46881 22934 + 24541 = 47475 22934 + 24580 = 47514 22934 + 25137 = 48071 22934 + 27342 = 50276 22934 + 27387 = 50321 22934 + 28848 = 51782 22934 + 30907 = 53841 22934 + 31244 = 54178 22934 + 32277 = 55211 22934 + 268435456 = 268458390 22934 + 888515840709 = 888515863643 22934 + 1099511627775 = 1099511650709 22934 + 17381190257349 = 17381190280283 22934 + 17592186044415 = 17592186067349 22934 + 17592186044416 = 17592186067350 22934 + 35184372088832 = 35184372111766 22934 + 123145302310912 = 123145302333846 22934 + 140737488355328 = 140737488378262 22934 + 281263980923589 = 281263980946523 22934 + 281474976710640 = 281474976733574 22934 + 281474976710641 = 281474976733575 22934 + 281474976710654 = 281474976733588 22934 + 281474976710655 = 281474976733589 22934 + 281474976710656 = 281474976733590 23269 + 23269 = 46538 23269 + 23520 = 46789 23269 + 23947 = 47216 23269 + 24541 = 47810 23269 + 24580 = 47849 23269 + 25137 = 48406 23269 + 27342 = 50611 23269 + 27387 = 50656 23269 + 28848 = 52117 23269 + 30907 = 54176 23269 + 31244 = 54513 23269 + 32277 = 55546 23269 + 268435456 = 268458725 23269 + 888515840709 = 888515863978 23269 + 1099511627775 = 1099511651044 23269 + 17381190257349 = 17381190280618 23269 + 17592186044415 = 17592186067684 23269 + 17592186044416 = 17592186067685 23269 + 35184372088832 = 35184372112101 23269 + 123145302310912 = 123145302334181 23269 + 140737488355328 = 140737488378597 23269 + 281263980923589 = 281263980946858 23269 + 281474976710640 = 281474976733909 23269 + 281474976710641 = 281474976733910 23269 + 281474976710654 = 281474976733923 23269 + 281474976710655 = 281474976733924 23269 + 281474976710656 = 281474976733925 23520 + 23520 = 47040 23520 + 23947 = 47467 23520 + 24541 = 48061 23520 + 24580 = 48100 23520 + 25137 = 48657 23520 + 27342 = 50862 23520 + 27387 = 50907 23520 + 28848 = 52368 23520 + 30907 = 54427 23520 + 31244 = 54764 23520 + 32277 = 55797 23520 + 268435456 = 268458976 23520 + 888515840709 = 888515864229 23520 + 1099511627775 = 1099511651295 23520 + 17381190257349 = 17381190280869 23520 + 17592186044415 = 17592186067935 23520 + 17592186044416 = 17592186067936 23520 + 35184372088832 = 35184372112352 23520 + 123145302310912 = 123145302334432 23520 + 140737488355328 = 140737488378848 23520 + 281263980923589 = 281263980947109 23520 + 281474976710640 = 281474976734160 23520 + 281474976710641 = 281474976734161 23520 + 281474976710654 = 281474976734174 23520 + 281474976710655 = 281474976734175 23520 + 281474976710656 = 281474976734176 23947 + 23947 = 47894 23947 + 24541 = 48488 23947 + 24580 = 48527 23947 + 25137 = 49084 23947 + 27342 = 51289 23947 + 27387 = 51334 23947 + 28848 = 52795 23947 + 30907 = 54854 23947 + 31244 = 55191 23947 + 32277 = 56224 23947 + 268435456 = 268459403 23947 + 888515840709 = 888515864656 23947 + 1099511627775 = 1099511651722 23947 + 17381190257349 = 17381190281296 23947 + 17592186044415 = 17592186068362 23947 + 17592186044416 = 17592186068363 23947 + 35184372088832 = 35184372112779 23947 + 123145302310912 = 123145302334859 23947 + 140737488355328 = 140737488379275 23947 + 281263980923589 = 281263980947536 23947 + 281474976710640 = 281474976734587 23947 + 281474976710641 = 281474976734588 23947 + 281474976710654 = 281474976734601 23947 + 281474976710655 = 281474976734602 23947 + 281474976710656 = 281474976734603 24541 + 24541 = 49082 24541 + 24580 = 49121 24541 + 25137 = 49678 24541 + 27342 = 51883 24541 + 27387 = 51928 24541 + 28848 = 53389 24541 + 30907 = 55448 24541 + 31244 = 55785 24541 + 32277 = 56818 24541 + 268435456 = 268459997 24541 + 888515840709 = 888515865250 24541 + 1099511627775 = 1099511652316 24541 + 17381190257349 = 17381190281890 24541 + 17592186044415 = 17592186068956 24541 + 17592186044416 = 17592186068957 24541 + 35184372088832 = 35184372113373 24541 + 123145302310912 = 123145302335453 24541 + 140737488355328 = 140737488379869 24541 + 281263980923589 = 281263980948130 24541 + 281474976710640 = 281474976735181 24541 + 281474976710641 = 281474976735182 24541 + 281474976710654 = 281474976735195 24541 + 281474976710655 = 281474976735196 24541 + 281474976710656 = 281474976735197 24580 + 24580 = 49160 24580 + 25137 = 49717 24580 + 27342 = 51922 24580 + 27387 = 51967 24580 + 28848 = 53428 24580 + 30907 = 55487 24580 + 31244 = 55824 24580 + 32277 = 56857 24580 + 268435456 = 268460036 24580 + 888515840709 = 888515865289 24580 + 1099511627775 = 1099511652355 24580 + 17381190257349 = 17381190281929 24580 + 17592186044415 = 17592186068995 24580 + 17592186044416 = 17592186068996 24580 + 35184372088832 = 35184372113412 24580 + 123145302310912 = 123145302335492 24580 + 140737488355328 = 140737488379908 24580 + 281263980923589 = 281263980948169 24580 + 281474976710640 = 281474976735220 24580 + 281474976710641 = 281474976735221 24580 + 281474976710654 = 281474976735234 24580 + 281474976710655 = 281474976735235 24580 + 281474976710656 = 281474976735236 25137 + 25137 = 50274 25137 + 27342 = 52479 25137 + 27387 = 52524 25137 + 28848 = 53985 25137 + 30907 = 56044 25137 + 31244 = 56381 25137 + 32277 = 57414 25137 + 268435456 = 268460593 25137 + 888515840709 = 888515865846 25137 + 1099511627775 = 1099511652912 25137 + 17381190257349 = 17381190282486 25137 + 17592186044415 = 17592186069552 25137 + 17592186044416 = 17592186069553 25137 + 35184372088832 = 35184372113969 25137 + 123145302310912 = 123145302336049 25137 + 140737488355328 = 140737488380465 25137 + 281263980923589 = 281263980948726 25137 + 281474976710640 = 281474976735777 25137 + 281474976710641 = 281474976735778 25137 + 281474976710654 = 281474976735791 25137 + 281474976710655 = 281474976735792 25137 + 281474976710656 = 281474976735793 27342 + 27342 = 54684 27342 + 27387 = 54729 27342 + 28848 = 56190 27342 + 30907 = 58249 27342 + 31244 = 58586 27342 + 32277 = 59619 27342 + 268435456 = 268462798 27342 + 888515840709 = 888515868051 27342 + 1099511627775 = 1099511655117 27342 + 17381190257349 = 17381190284691 27342 + 17592186044415 = 17592186071757 27342 + 17592186044416 = 17592186071758 27342 + 35184372088832 = 35184372116174 27342 + 123145302310912 = 123145302338254 27342 + 140737488355328 = 140737488382670 27342 + 281263980923589 = 281263980950931 27342 + 281474976710640 = 281474976737982 27342 + 281474976710641 = 281474976737983 27342 + 281474976710654 = 281474976737996 27342 + 281474976710655 = 281474976737997 27342 + 281474976710656 = 281474976737998 27387 + 27387 = 54774 27387 + 28848 = 56235 27387 + 30907 = 58294 27387 + 31244 = 58631 27387 + 32277 = 59664 27387 + 268435456 = 268462843 27387 + 888515840709 = 888515868096 27387 + 1099511627775 = 1099511655162 27387 + 17381190257349 = 17381190284736 27387 + 17592186044415 = 17592186071802 27387 + 17592186044416 = 17592186071803 27387 + 35184372088832 = 35184372116219 27387 + 123145302310912 = 123145302338299 27387 + 140737488355328 = 140737488382715 27387 + 281263980923589 = 281263980950976 27387 + 281474976710640 = 281474976738027 27387 + 281474976710641 = 281474976738028 27387 + 281474976710654 = 281474976738041 27387 + 281474976710655 = 281474976738042 27387 + 281474976710656 = 281474976738043 28848 + 28848 = 57696 28848 + 30907 = 59755 28848 + 31244 = 60092 28848 + 32277 = 61125 28848 + 268435456 = 268464304 28848 + 888515840709 = 888515869557 28848 + 1099511627775 = 1099511656623 28848 + 17381190257349 = 17381190286197 28848 + 17592186044415 = 17592186073263 28848 + 17592186044416 = 17592186073264 28848 + 35184372088832 = 35184372117680 28848 + 123145302310912 = 123145302339760 28848 + 140737488355328 = 140737488384176 28848 + 281263980923589 = 281263980952437 28848 + 281474976710640 = 281474976739488 28848 + 281474976710641 = 281474976739489 28848 + 281474976710654 = 281474976739502 28848 + 281474976710655 = 281474976739503 28848 + 281474976710656 = 281474976739504 30907 + 30907 = 61814 30907 + 31244 = 62151 30907 + 32277 = 63184 30907 + 268435456 = 268466363 30907 + 888515840709 = 888515871616 30907 + 1099511627775 = 1099511658682 30907 + 17381190257349 = 17381190288256 30907 + 17592186044415 = 17592186075322 30907 + 17592186044416 = 17592186075323 30907 + 35184372088832 = 35184372119739 30907 + 123145302310912 = 123145302341819 30907 + 140737488355328 = 140737488386235 30907 + 281263980923589 = 281263980954496 30907 + 281474976710640 = 281474976741547 30907 + 281474976710641 = 281474976741548 30907 + 281474976710654 = 281474976741561 30907 + 281474976710655 = 281474976741562 30907 + 281474976710656 = 281474976741563 31244 + 31244 = 62488 31244 + 32277 = 63521 31244 + 268435456 = 268466700 31244 + 888515840709 = 888515871953 31244 + 1099511627775 = 1099511659019 31244 + 17381190257349 = 17381190288593 31244 + 17592186044415 = 17592186075659 31244 + 17592186044416 = 17592186075660 31244 + 35184372088832 = 35184372120076 31244 + 123145302310912 = 123145302342156 31244 + 140737488355328 = 140737488386572 31244 + 281263980923589 = 281263980954833 31244 + 281474976710640 = 281474976741884 31244 + 281474976710641 = 281474976741885 31244 + 281474976710654 = 281474976741898 31244 + 281474976710655 = 281474976741899 31244 + 281474976710656 = 281474976741900 32277 + 32277 = 64554 32277 + 268435456 = 268467733 32277 + 888515840709 = 888515872986 32277 + 1099511627775 = 1099511660052 32277 + 17381190257349 = 17381190289626 32277 + 17592186044415 = 17592186076692 32277 + 17592186044416 = 17592186076693 32277 + 35184372088832 = 35184372121109 32277 + 123145302310912 = 123145302343189 32277 + 140737488355328 = 140737488387605 32277 + 281263980923589 = 281263980955866 32277 + 281474976710640 = 281474976742917 32277 + 281474976710641 = 281474976742918 32277 + 281474976710654 = 281474976742931 32277 + 281474976710655 = 281474976742932 32277 + 281474976710656 = 281474976742933 268435456 + 268435456 = 536870912 268435456 + 888515840709 = 888784276165 268435456 + 1099511627775 = 1099780063231 268435456 + 17381190257349 = 17381458692805 268435456 + 17592186044415 = 17592454479871 268435456 + 17592186044416 = 17592454479872 268435456 + 35184372088832 = 35184640524288 268435456 + 123145302310912 = 123145570746368 268435456 + 140737488355328 = 140737756790784 268435456 + 281263980923589 = 281264249359045 268435456 + 281474976710640 = 281475245146096 268435456 + 281474976710641 = 281475245146097 268435456 + 281474976710654 = 281475245146110 268435456 + 281474976710655 = 281475245146111 268435456 + 281474976710656 = 281475245146112 888515840709 + 888515840709 = 1777031681418 888515840709 + 1099511627775 = 1988027468484 888515840709 + 17381190257349 = 18269706098058 888515840709 + 17592186044415 = 18480701885124 888515840709 + 17592186044416 = 18480701885125 888515840709 + 35184372088832 = 36072887929541 888515840709 + 123145302310912 = 124033818151621 888515840709 + 140737488355328 = 141626004196037 888515840709 + 281263980923589 = 282152496764298 888515840709 + 281474976710640 = 282363492551349 888515840709 + 281474976710641 = 282363492551350 888515840709 + 281474976710654 = 282363492551363 888515840709 + 281474976710655 = 282363492551364 888515840709 + 281474976710656 = 282363492551365 1099511627775 + 1099511627775 = 2199023255550 1099511627775 + 17381190257349 = 18480701885124 1099511627775 + 17592186044415 = 18691697672190 1099511627775 + 17592186044416 = 18691697672191 1099511627775 + 35184372088832 = 36283883716607 1099511627775 + 123145302310912 = 124244813938687 1099511627775 + 140737488355328 = 141836999983103 1099511627775 + 281263980923589 = 282363492551364 1099511627775 + 281474976710640 = 282574488338415 1099511627775 + 281474976710641 = 282574488338416 1099511627775 + 281474976710654 = 282574488338429 1099511627775 + 281474976710655 = 282574488338430 1099511627775 + 281474976710656 = 282574488338431 17381190257349 + 17381190257349 = 34762380514698 17381190257349 + 17592186044415 = 34973376301764 17381190257349 + 17592186044416 = 34973376301765 17381190257349 + 35184372088832 = 52565562346181 17381190257349 + 123145302310912 = 140526492568261 17381190257349 + 140737488355328 = 158118678612677 17381190257349 + 281263980923589 = 298645171180938 17381190257349 + 281474976710640 = 298856166967989 17381190257349 + 281474976710641 = 298856166967990 17381190257349 + 281474976710654 = 298856166968003 17381190257349 + 281474976710655 = 298856166968004 17381190257349 + 281474976710656 = 298856166968005 17592186044415 + 17592186044415 = 35184372088830 17592186044415 + 17592186044416 = 35184372088831 17592186044415 + 35184372088832 = 52776558133247 17592186044415 + 123145302310912 = 140737488355327 17592186044415 + 140737488355328 = 158329674399743 17592186044415 + 281263980923589 = 298856166968004 17592186044415 + 281474976710640 = 299067162755055 17592186044415 + 281474976710641 = 299067162755056 17592186044415 + 281474976710654 = 299067162755069 17592186044415 + 281474976710655 = 299067162755070 17592186044415 + 281474976710656 = 299067162755071 17592186044416 + 17592186044416 = 35184372088832 17592186044416 + 35184372088832 = 52776558133248 17592186044416 + 123145302310912 = 140737488355328 17592186044416 + 140737488355328 = 158329674399744 17592186044416 + 281263980923589 = 298856166968005 17592186044416 + 281474976710640 = 299067162755056 17592186044416 + 281474976710641 = 299067162755057 17592186044416 + 281474976710654 = 299067162755070 17592186044416 + 281474976710655 = 299067162755071 17592186044416 + 281474976710656 = 299067162755072 35184372088832 + 35184372088832 = 70368744177664 35184372088832 + 123145302310912 = 158329674399744 35184372088832 + 140737488355328 = 175921860444160 35184372088832 + 281263980923589 = 316448353012421 35184372088832 + 281474976710640 = 316659348799472 35184372088832 + 281474976710641 = 316659348799473 35184372088832 + 281474976710654 = 316659348799486 35184372088832 + 281474976710655 = 316659348799487 35184372088832 + 281474976710656 = 316659348799488 123145302310912 + 123145302310912 = 246290604621824 123145302310912 + 140737488355328 = 263882790666240 123145302310912 + 281263980923589 = 404409283234501 123145302310912 + 281474976710640 = 404620279021552 123145302310912 + 281474976710641 = 404620279021553 123145302310912 + 281474976710654 = 404620279021566 123145302310912 + 281474976710655 = 404620279021567 123145302310912 + 281474976710656 = 404620279021568 140737488355328 + 140737488355328 = 281474976710656 140737488355328 + 281263980923589 = 422001469278917 140737488355328 + 281474976710640 = 422212465065968 140737488355328 + 281474976710641 = 422212465065969 140737488355328 + 281474976710654 = 422212465065982 140737488355328 + 281474976710655 = 422212465065983 140737488355328 + 281474976710656 = 422212465065984 281263980923589 + 281263980923589 = 562527961847178 281263980923589 + 281474976710640 = 562738957634229 281263980923589 + 281474976710641 = 562738957634230 281263980923589 + 281474976710654 = 562738957634243 281263980923589 + 281474976710655 = 562738957634244 281263980923589 + 281474976710656 = 562738957634245 281474976710640 + 281474976710640 = 562949953421280 281474976710640 + 281474976710641 = 562949953421281 281474976710640 + 281474976710654 = 562949953421294 281474976710640 + 281474976710655 = 562949953421295 281474976710640 + 281474976710656 = 562949953421296 281474976710641 + 281474976710641 = 562949953421282 281474976710641 + 281474976710654 = 562949953421295 281474976710641 + 281474976710655 = 562949953421296 281474976710641 + 281474976710656 = 562949953421297 281474976710654 + 281474976710654 = 562949953421308 281474976710654 + 281474976710655 = 562949953421309 281474976710654 + 281474976710656 = 562949953421310 281474976710655 + 281474976710655 = 562949953421310 281474976710655 + 281474976710656 = 562949953421311 281474976710656 + 281474976710656 = 562949953421312 !EOF! ls -l tst1.cmp echo x - tst1.in sed 's/^X//' > tst1.in << '!EOF!' 1 + 1 1 + 2 1 + 15 1 + 364 1 + 2938 1 + 3136 1 + 3514 1 + 3627 1 + 3861 1 + 6117 1 + 6424 1 + 7448 1 + 8184 1 + 9312 1 + 10269 1 + 12738 1 + 13485 1 + 15090 1 + 15161 1 + 15970 1 + 15987 1 + 17517 1 + 18308 1 + 18455 1 + 18464 1 + 20525 1 + 20576 1 + 20718 1 + 22099 1 + 22859 1 + 22934 1 + 23269 1 + 23520 1 + 23947 1 + 24541 1 + 24580 1 + 25137 1 + 27342 1 + 27387 1 + 28848 1 + 30907 1 + 31244 1 + 32277 1 + 268435456 1 + 888515840709 1 + 1099511627775 1 + 17381190257349 1 + 17592186044415 1 + 17592186044416 1 + 35184372088832 1 + 123145302310912 1 + 140737488355328 1 + 281263980923589 1 + 281474976710640 1 + 281474976710641 1 + 281474976710654 1 + 281474976710655 1 + 281474976710656 2 + 2 2 + 15 2 + 364 2 + 2938 2 + 3136 2 + 3514 2 + 3627 2 + 3861 2 + 6117 2 + 6424 2 + 7448 2 + 8184 2 + 9312 2 + 10269 2 + 12738 2 + 13485 2 + 15090 2 + 15161 2 + 15970 2 + 15987 2 + 17517 2 + 18308 2 + 18455 2 + 18464 2 + 20525 2 + 20576 2 + 20718 2 + 22099 2 + 22859 2 + 22934 2 + 23269 2 + 23520 2 + 23947 2 + 24541 2 + 24580 2 + 25137 2 + 27342 2 + 27387 2 + 28848 2 + 30907 2 + 31244 2 + 32277 2 + 268435456 2 + 888515840709 2 + 1099511627775 2 + 17381190257349 2 + 17592186044415 2 + 17592186044416 2 + 35184372088832 2 + 123145302310912 2 + 140737488355328 2 + 281263980923589 2 + 281474976710640 2 + 281474976710641 2 + 281474976710654 2 + 281474976710655 2 + 281474976710656 15 + 15 15 + 364 15 + 2938 15 + 3136 15 + 3514 15 + 3627 15 + 3861 15 + 6117 15 + 6424 15 + 7448 15 + 8184 15 + 9312 15 + 10269 15 + 12738 15 + 13485 15 + 15090 15 + 15161 15 + 15970 15 + 15987 15 + 17517 15 + 18308 15 + 18455 15 + 18464 15 + 20525 15 + 20576 15 + 20718 15 + 22099 15 + 22859 15 + 22934 15 + 23269 15 + 23520 15 + 23947 15 + 24541 15 + 24580 15 + 25137 15 + 27342 15 + 27387 15 + 28848 15 + 30907 15 + 31244 15 + 32277 15 + 268435456 15 + 888515840709 15 + 1099511627775 15 + 17381190257349 15 + 17592186044415 15 + 17592186044416 15 + 35184372088832 15 + 123145302310912 15 + 140737488355328 15 + 281263980923589 15 + 281474976710640 15 + 281474976710641 15 + 281474976710654 15 + 281474976710655 15 + 281474976710656 364 + 364 364 + 2938 364 + 3136 364 + 3514 364 + 3627 364 + 3861 364 + 6117 364 + 6424 364 + 7448 364 + 8184 364 + 9312 364 + 10269 364 + 12738 364 + 13485 364 + 15090 364 + 15161 364 + 15970 364 + 15987 364 + 17517 364 + 18308 364 + 18455 364 + 18464 364 + 20525 364 + 20576 364 + 20718 364 + 22099 364 + 22859 364 + 22934 364 + 23269 364 + 23520 364 + 23947 364 + 24541 364 + 24580 364 + 25137 364 + 27342 364 + 27387 364 + 28848 364 + 30907 364 + 31244 364 + 32277 364 + 268435456 364 + 888515840709 364 + 1099511627775 364 + 17381190257349 364 + 17592186044415 364 + 17592186044416 364 + 35184372088832 364 + 123145302310912 364 + 140737488355328 364 + 281263980923589 364 + 281474976710640 364 + 281474976710641 364 + 281474976710654 364 + 281474976710655 364 + 281474976710656 2938 + 2938 2938 + 3136 2938 + 3514 2938 + 3627 2938 + 3861 2938 + 6117 2938 + 6424 2938 + 7448 2938 + 8184 2938 + 9312 2938 + 10269 2938 + 12738 2938 + 13485 2938 + 15090 2938 + 15161 2938 + 15970 2938 + 15987 2938 + 17517 2938 + 18308 2938 + 18455 2938 + 18464 2938 + 20525 2938 + 20576 2938 + 20718 2938 + 22099 2938 + 22859 2938 + 22934 2938 + 23269 2938 + 23520 2938 + 23947 2938 + 24541 2938 + 24580 2938 + 25137 2938 + 27342 2938 + 27387 2938 + 28848 2938 + 30907 2938 + 31244 2938 + 32277 2938 + 268435456 2938 + 888515840709 2938 + 1099511627775 2938 + 17381190257349 2938 + 17592186044415 2938 + 17592186044416 2938 + 35184372088832 2938 + 123145302310912 2938 + 140737488355328 2938 + 281263980923589 2938 + 281474976710640 2938 + 281474976710641 2938 + 281474976710654 2938 + 281474976710655 2938 + 281474976710656 3136 + 3136 3136 + 3514 3136 + 3627 3136 + 3861 3136 + 6117 3136 + 6424 3136 + 7448 3136 + 8184 3136 + 9312 3136 + 10269 3136 + 12738 3136 + 13485 3136 + 15090 3136 + 15161 3136 + 15970 3136 + 15987 3136 + 17517 3136 + 18308 3136 + 18455 3136 + 18464 3136 + 20525 3136 + 20576 3136 + 20718 3136 + 22099 3136 + 22859 3136 + 22934 3136 + 23269 3136 + 23520 3136 + 23947 3136 + 24541 3136 + 24580 3136 + 25137 3136 + 27342 3136 + 27387 3136 + 28848 3136 + 30907 3136 + 31244 3136 + 32277 3136 + 268435456 3136 + 888515840709 3136 + 1099511627775 3136 + 17381190257349 3136 + 17592186044415 3136 + 17592186044416 3136 + 35184372088832 3136 + 123145302310912 3136 + 140737488355328 3136 + 281263980923589 3136 + 281474976710640 3136 + 281474976710641 3136 + 281474976710654 3136 + 281474976710655 3136 + 281474976710656 3514 + 3514 3514 + 3627 3514 + 3861 3514 + 6117 3514 + 6424 3514 + 7448 3514 + 8184 3514 + 9312 3514 + 10269 3514 + 12738 3514 + 13485 3514 + 15090 3514 + 15161 3514 + 15970 3514 + 15987 3514 + 17517 3514 + 18308 3514 + 18455 3514 + 18464 3514 + 20525 3514 + 20576 3514 + 20718 3514 + 22099 3514 + 22859 3514 + 22934 3514 + 23269 3514 + 23520 3514 + 23947 3514 + 24541 3514 + 24580 3514 + 25137 3514 + 27342 3514 + 27387 3514 + 28848 3514 + 30907 3514 + 31244 3514 + 32277 3514 + 268435456 3514 + 888515840709 3514 + 1099511627775 3514 + 17381190257349 3514 + 17592186044415 3514 + 17592186044416 3514 + 35184372088832 3514 + 123145302310912 3514 + 140737488355328 3514 + 281263980923589 3514 + 281474976710640 3514 + 281474976710641 3514 + 281474976710654 3514 + 281474976710655 3514 + 281474976710656 3627 + 3627 3627 + 3861 3627 + 6117 3627 + 6424 3627 + 7448 3627 + 8184 3627 + 9312 3627 + 10269 3627 + 12738 3627 + 13485 3627 + 15090 3627 + 15161 3627 + 15970 3627 + 15987 3627 + 17517 3627 + 18308 3627 + 18455 3627 + 18464 3627 + 20525 3627 + 20576 3627 + 20718 3627 + 22099 3627 + 22859 3627 + 22934 3627 + 23269 3627 + 23520 3627 + 23947 3627 + 24541 3627 + 24580 3627 + 25137 3627 + 27342 3627 + 27387 3627 + 28848 3627 + 30907 3627 + 31244 3627 + 32277 3627 + 268435456 3627 + 888515840709 3627 + 1099511627775 3627 + 17381190257349 3627 + 17592186044415 3627 + 17592186044416 3627 + 35184372088832 3627 + 123145302310912 3627 + 140737488355328 3627 + 281263980923589 3627 + 281474976710640 3627 + 281474976710641 3627 + 281474976710654 3627 + 281474976710655 3627 + 281474976710656 3861 + 3861 3861 + 6117 3861 + 6424 3861 + 7448 3861 + 8184 3861 + 9312 3861 + 10269 3861 + 12738 3861 + 13485 3861 + 15090 3861 + 15161 3861 + 15970 3861 + 15987 3861 + 17517 3861 + 18308 3861 + 18455 3861 + 18464 3861 + 20525 3861 + 20576 3861 + 20718 3861 + 22099 3861 + 22859 3861 + 22934 3861 + 23269 3861 + 23520 3861 + 23947 3861 + 24541 3861 + 24580 3861 + 25137 3861 + 27342 3861 + 27387 3861 + 28848 3861 + 30907 3861 + 31244 3861 + 32277 3861 + 268435456 3861 + 888515840709 3861 + 1099511627775 3861 + 17381190257349 3861 + 17592186044415 3861 + 17592186044416 3861 + 35184372088832 3861 + 123145302310912 3861 + 140737488355328 3861 + 281263980923589 3861 + 281474976710640 3861 + 281474976710641 3861 + 281474976710654 3861 + 281474976710655 3861 + 281474976710656 6117 + 6117 6117 + 6424 6117 + 7448 6117 + 8184 6117 + 9312 6117 + 10269 6117 + 12738 6117 + 13485 6117 + 15090 6117 + 15161 6117 + 15970 6117 + 15987 6117 + 17517 6117 + 18308 6117 + 18455 6117 + 18464 6117 + 20525 6117 + 20576 6117 + 20718 6117 + 22099 6117 + 22859 6117 + 22934 6117 + 23269 6117 + 23520 6117 + 23947 6117 + 24541 6117 + 24580 6117 + 25137 6117 + 27342 6117 + 27387 6117 + 28848 6117 + 30907 6117 + 31244 6117 + 32277 6117 + 268435456 6117 + 888515840709 6117 + 1099511627775 6117 + 17381190257349 6117 + 17592186044415 6117 + 17592186044416 6117 + 35184372088832 6117 + 123145302310912 6117 + 140737488355328 6117 + 281263980923589 6117 + 281474976710640 6117 + 281474976710641 6117 + 281474976710654 6117 + 281474976710655 6117 + 281474976710656 6424 + 6424 6424 + 7448 6424 + 8184 6424 + 9312 6424 + 10269 6424 + 12738 6424 + 13485 6424 + 15090 6424 + 15161 6424 + 15970 6424 + 15987 6424 + 17517 6424 + 18308 6424 + 18455 6424 + 18464 6424 + 20525 6424 + 20576 6424 + 20718 6424 + 22099 6424 + 22859 6424 + 22934 6424 + 23269 6424 + 23520 6424 + 23947 6424 + 24541 6424 + 24580 6424 + 25137 6424 + 27342 6424 + 27387 6424 + 28848 6424 + 30907 6424 + 31244 6424 + 32277 6424 + 268435456 6424 + 888515840709 6424 + 1099511627775 6424 + 17381190257349 6424 + 17592186044415 6424 + 17592186044416 6424 + 35184372088832 6424 + 123145302310912 6424 + 140737488355328 6424 + 281263980923589 6424 + 281474976710640 6424 + 281474976710641 6424 + 281474976710654 6424 + 281474976710655 6424 + 281474976710656 7448 + 7448 7448 + 8184 7448 + 9312 7448 + 10269 7448 + 12738 7448 + 13485 7448 + 15090 7448 + 15161 7448 + 15970 7448 + 15987 7448 + 17517 7448 + 18308 7448 + 18455 7448 + 18464 7448 + 20525 7448 + 20576 7448 + 20718 7448 + 22099 7448 + 22859 7448 + 22934 7448 + 23269 7448 + 23520 7448 + 23947 7448 + 24541 7448 + 24580 7448 + 25137 7448 + 27342 7448 + 27387 7448 + 28848 7448 + 30907 7448 + 31244 7448 + 32277 7448 + 268435456 7448 + 888515840709 7448 + 1099511627775 7448 + 17381190257349 7448 + 17592186044415 7448 + 17592186044416 7448 + 35184372088832 7448 + 123145302310912 7448 + 140737488355328 7448 + 281263980923589 7448 + 281474976710640 7448 + 281474976710641 7448 + 281474976710654 7448 + 281474976710655 7448 + 281474976710656 8184 + 8184 8184 + 9312 8184 + 10269 8184 + 12738 8184 + 13485 8184 + 15090 8184 + 15161 8184 + 15970 8184 + 15987 8184 + 17517 8184 + 18308 8184 + 18455 8184 + 18464 8184 + 20525 8184 + 20576 8184 + 20718 8184 + 22099 8184 + 22859 8184 + 22934 8184 + 23269 8184 + 23520 8184 + 23947 8184 + 24541 8184 + 24580 8184 + 25137 8184 + 27342 8184 + 27387 8184 + 28848 8184 + 30907 8184 + 31244 8184 + 32277 8184 + 268435456 8184 + 888515840709 8184 + 1099511627775 8184 + 17381190257349 8184 + 17592186044415 8184 + 17592186044416 8184 + 35184372088832 8184 + 123145302310912 8184 + 140737488355328 8184 + 281263980923589 8184 + 281474976710640 8184 + 281474976710641 8184 + 281474976710654 8184 + 281474976710655 8184 + 281474976710656 9312 + 9312 9312 + 10269 9312 + 12738 9312 + 13485 9312 + 15090 9312 + 15161 9312 + 15970 9312 + 15987 9312 + 17517 9312 + 18308 9312 + 18455 9312 + 18464 9312 + 20525 9312 + 20576 9312 + 20718 9312 + 22099 9312 + 22859 9312 + 22934 9312 + 23269 9312 + 23520 9312 + 23947 9312 + 24541 9312 + 24580 9312 + 25137 9312 + 27342 9312 + 27387 9312 + 28848 9312 + 30907 9312 + 31244 9312 + 32277 9312 + 268435456 9312 + 888515840709 9312 + 1099511627775 9312 + 17381190257349 9312 + 17592186044415 9312 + 17592186044416 9312 + 35184372088832 9312 + 123145302310912 9312 + 140737488355328 9312 + 281263980923589 9312 + 281474976710640 9312 + 281474976710641 9312 + 281474976710654 9312 + 281474976710655 9312 + 281474976710656 10269 + 10269 10269 + 12738 10269 + 13485 10269 + 15090 10269 + 15161 10269 + 15970 10269 + 15987 10269 + 17517 10269 + 18308 10269 + 18455 10269 + 18464 10269 + 20525 10269 + 20576 10269 + 20718 10269 + 22099 10269 + 22859 10269 + 22934 10269 + 23269 10269 + 23520 10269 + 23947 10269 + 24541 10269 + 24580 10269 + 25137 10269 + 27342 10269 + 27387 10269 + 28848 10269 + 30907 10269 + 31244 10269 + 32277 10269 + 268435456 10269 + 888515840709 10269 + 1099511627775 10269 + 17381190257349 10269 + 17592186044415 10269 + 17592186044416 10269 + 35184372088832 10269 + 123145302310912 10269 + 140737488355328 10269 + 281263980923589 10269 + 281474976710640 10269 + 281474976710641 10269 + 281474976710654 10269 + 281474976710655 10269 + 281474976710656 12738 + 12738 12738 + 13485 12738 + 15090 12738 + 15161 12738 + 15970 12738 + 15987 12738 + 17517 12738 + 18308 12738 + 18455 12738 + 18464 12738 + 20525 12738 + 20576 12738 + 20718 12738 + 22099 12738 + 22859 12738 + 22934 12738 + 23269 12738 + 23520 12738 + 23947 12738 + 24541 12738 + 24580 12738 + 25137 12738 + 27342 12738 + 27387 12738 + 28848 12738 + 30907 12738 + 31244 12738 + 32277 12738 + 268435456 12738 + 888515840709 12738 + 1099511627775 12738 + 17381190257349 12738 + 17592186044415 12738 + 17592186044416 12738 + 35184372088832 12738 + 123145302310912 12738 + 140737488355328 12738 + 281263980923589 12738 + 281474976710640 12738 + 281474976710641 12738 + 281474976710654 12738 + 281474976710655 12738 + 281474976710656 13485 + 13485 13485 + 15090 13485 + 15161 13485 + 15970 13485 + 15987 13485 + 17517 13485 + 18308 13485 + 18455 13485 + 18464 13485 + 20525 13485 + 20576 13485 + 20718 13485 + 22099 13485 + 22859 13485 + 22934 13485 + 23269 13485 + 23520 13485 + 23947 13485 + 24541 13485 + 24580 13485 + 25137 13485 + 27342 13485 + 27387 13485 + 28848 13485 + 30907 13485 + 31244 13485 + 32277 13485 + 268435456 13485 + 888515840709 13485 + 1099511627775 13485 + 17381190257349 13485 + 17592186044415 13485 + 17592186044416 13485 + 35184372088832 13485 + 123145302310912 13485 + 140737488355328 13485 + 281263980923589 13485 + 281474976710640 13485 + 281474976710641 13485 + 281474976710654 13485 + 281474976710655 13485 + 281474976710656 15090 + 15090 15090 + 15161 15090 + 15970 15090 + 15987 15090 + 17517 15090 + 18308 15090 + 18455 15090 + 18464 15090 + 20525 15090 + 20576 15090 + 20718 15090 + 22099 15090 + 22859 15090 + 22934 15090 + 23269 15090 + 23520 15090 + 23947 15090 + 24541 15090 + 24580 15090 + 25137 15090 + 27342 15090 + 27387 15090 + 28848 15090 + 30907 15090 + 31244 15090 + 32277 15090 + 268435456 15090 + 888515840709 15090 + 1099511627775 15090 + 17381190257349 15090 + 17592186044415 15090 + 17592186044416 15090 + 35184372088832 15090 + 123145302310912 15090 + 140737488355328 15090 + 281263980923589 15090 + 281474976710640 15090 + 281474976710641 15090 + 281474976710654 15090 + 281474976710655 15090 + 281474976710656 15161 + 15161 15161 + 15970 15161 + 15987 15161 + 17517 15161 + 18308 15161 + 18455 15161 + 18464 15161 + 20525 15161 + 20576 15161 + 20718 15161 + 22099 15161 + 22859 15161 + 22934 15161 + 23269 15161 + 23520 15161 + 23947 15161 + 24541 15161 + 24580 15161 + 25137 15161 + 27342 15161 + 27387 15161 + 28848 15161 + 30907 15161 + 31244 15161 + 32277 15161 + 268435456 15161 + 888515840709 15161 + 1099511627775 15161 + 17381190257349 15161 + 17592186044415 15161 + 17592186044416 15161 + 35184372088832 15161 + 123145302310912 15161 + 140737488355328 15161 + 281263980923589 15161 + 281474976710640 15161 + 281474976710641 15161 + 281474976710654 15161 + 281474976710655 15161 + 281474976710656 15970 + 15970 15970 + 15987 15970 + 17517 15970 + 18308 15970 + 18455 15970 + 18464 15970 + 20525 15970 + 20576 15970 + 20718 15970 + 22099 15970 + 22859 15970 + 22934 15970 + 23269 15970 + 23520 15970 + 23947 15970 + 24541 15970 + 24580 15970 + 25137 15970 + 27342 15970 + 27387 15970 + 28848 15970 + 30907 15970 + 31244 15970 + 32277 15970 + 268435456 15970 + 888515840709 15970 + 1099511627775 15970 + 17381190257349 15970 + 17592186044415 15970 + 17592186044416 15970 + 35184372088832 15970 + 123145302310912 15970 + 140737488355328 15970 + 281263980923589 15970 + 281474976710640 15970 + 281474976710641 15970 + 281474976710654 15970 + 281474976710655 15970 + 281474976710656 15987 + 15987 15987 + 17517 15987 + 18308 15987 + 18455 15987 + 18464 15987 + 20525 15987 + 20576 15987 + 20718 15987 + 22099 15987 + 22859 15987 + 22934 15987 + 23269 15987 + 23520 15987 + 23947 15987 + 24541 15987 + 24580 15987 + 25137 15987 + 27342 15987 + 27387 15987 + 28848 15987 + 30907 15987 + 31244 15987 + 32277 15987 + 268435456 15987 + 888515840709 15987 + 1099511627775 15987 + 17381190257349 15987 + 17592186044415 15987 + 17592186044416 15987 + 35184372088832 15987 + 123145302310912 15987 + 140737488355328 15987 + 281263980923589 15987 + 281474976710640 15987 + 281474976710641 15987 + 281474976710654 15987 + 281474976710655 15987 + 281474976710656 17517 + 17517 17517 + 18308 17517 + 18455 17517 + 18464 17517 + 20525 17517 + 20576 17517 + 20718 17517 + 22099 17517 + 22859 17517 + 22934 17517 + 23269 17517 + 23520 17517 + 23947 17517 + 24541 17517 + 24580 17517 + 25137 17517 + 27342 17517 + 27387 17517 + 28848 17517 + 30907 17517 + 31244 17517 + 32277 17517 + 268435456 17517 + 888515840709 17517 + 1099511627775 17517 + 17381190257349 17517 + 17592186044415 17517 + 17592186044416 17517 + 35184372088832 17517 + 123145302310912 17517 + 140737488355328 17517 + 281263980923589 17517 + 281474976710640 17517 + 281474976710641 17517 + 281474976710654 17517 + 281474976710655 17517 + 281474976710656 18308 + 18308 18308 + 18455 18308 + 18464 18308 + 20525 18308 + 20576 18308 + 20718 18308 + 22099 18308 + 22859 18308 + 22934 18308 + 23269 18308 + 23520 18308 + 23947 18308 + 24541 18308 + 24580 18308 + 25137 18308 + 27342 18308 + 27387 18308 + 28848 18308 + 30907 18308 + 31244 18308 + 32277 18308 + 268435456 18308 + 888515840709 18308 + 1099511627775 18308 + 17381190257349 18308 + 17592186044415 18308 + 17592186044416 18308 + 35184372088832 18308 + 123145302310912 18308 + 140737488355328 18308 + 281263980923589 18308 + 281474976710640 18308 + 281474976710641 18308 + 281474976710654 18308 + 281474976710655 18308 + 281474976710656 18455 + 18455 18455 + 18464 18455 + 20525 18455 + 20576 18455 + 20718 18455 + 22099 18455 + 22859 18455 + 22934 18455 + 23269 18455 + 23520 18455 + 23947 18455 + 24541 18455 + 24580 18455 + 25137 18455 + 27342 18455 + 27387 18455 + 28848 18455 + 30907 18455 + 31244 18455 + 32277 18455 + 268435456 18455 + 888515840709 18455 + 1099511627775 18455 + 17381190257349 18455 + 17592186044415 18455 + 17592186044416 18455 + 35184372088832 18455 + 123145302310912 18455 + 140737488355328 18455 + 281263980923589 18455 + 281474976710640 18455 + 281474976710641 18455 + 281474976710654 18455 + 281474976710655 18455 + 281474976710656 18464 + 18464 18464 + 20525 18464 + 20576 18464 + 20718 18464 + 22099 18464 + 22859 18464 + 22934 18464 + 23269 18464 + 23520 18464 + 23947 18464 + 24541 18464 + 24580 18464 + 25137 18464 + 27342 18464 + 27387 18464 + 28848 18464 + 30907 18464 + 31244 18464 + 32277 18464 + 268435456 18464 + 888515840709 18464 + 1099511627775 18464 + 17381190257349 18464 + 17592186044415 18464 + 17592186044416 18464 + 35184372088832 18464 + 123145302310912 18464 + 140737488355328 18464 + 281263980923589 18464 + 281474976710640 18464 + 281474976710641 18464 + 281474976710654 18464 + 281474976710655 18464 + 281474976710656 20525 + 20525 20525 + 20576 20525 + 20718 20525 + 22099 20525 + 22859 20525 + 22934 20525 + 23269 20525 + 23520 20525 + 23947 20525 + 24541 20525 + 24580 20525 + 25137 20525 + 27342 20525 + 27387 20525 + 28848 20525 + 30907 20525 + 31244 20525 + 32277 20525 + 268435456 20525 + 888515840709 20525 + 1099511627775 20525 + 17381190257349 20525 + 17592186044415 20525 + 17592186044416 20525 + 35184372088832 20525 + 123145302310912 20525 + 140737488355328 20525 + 281263980923589 20525 + 281474976710640 20525 + 281474976710641 20525 + 281474976710654 20525 + 281474976710655 20525 + 281474976710656 20576 + 20576 20576 + 20718 20576 + 22099 20576 + 22859 20576 + 22934 20576 + 23269 20576 + 23520 20576 + 23947 20576 + 24541 20576 + 24580 20576 + 25137 20576 + 27342 20576 + 27387 20576 + 28848 20576 + 30907 20576 + 31244 20576 + 32277 20576 + 268435456 20576 + 888515840709 20576 + 1099511627775 20576 + 17381190257349 20576 + 17592186044415 20576 + 17592186044416 20576 + 35184372088832 20576 + 123145302310912 20576 + 140737488355328 20576 + 281263980923589 20576 + 281474976710640 20576 + 281474976710641 20576 + 281474976710654 20576 + 281474976710655 20576 + 281474976710656 20718 + 20718 20718 + 22099 20718 + 22859 20718 + 22934 20718 + 23269 20718 + 23520 20718 + 23947 20718 + 24541 20718 + 24580 20718 + 25137 20718 + 27342 20718 + 27387 20718 + 28848 20718 + 30907 20718 + 31244 20718 + 32277 20718 + 268435456 20718 + 888515840709 20718 + 1099511627775 20718 + 17381190257349 20718 + 17592186044415 20718 + 17592186044416 20718 + 35184372088832 20718 + 123145302310912 20718 + 140737488355328 20718 + 281263980923589 20718 + 281474976710640 20718 + 281474976710641 20718 + 281474976710654 20718 + 281474976710655 20718 + 281474976710656 22099 + 22099 22099 + 22859 22099 + 22934 22099 + 23269 22099 + 23520 22099 + 23947 22099 + 24541 22099 + 24580 22099 + 25137 22099 + 27342 22099 + 27387 22099 + 28848 22099 + 30907 22099 + 31244 22099 + 32277 22099 + 268435456 22099 + 888515840709 22099 + 1099511627775 22099 + 17381190257349 22099 + 17592186044415 22099 + 17592186044416 22099 + 35184372088832 22099 + 123145302310912 22099 + 140737488355328 22099 + 281263980923589 22099 + 281474976710640 22099 + 281474976710641 22099 + 281474976710654 22099 + 281474976710655 22099 + 281474976710656 22859 + 22859 22859 + 22934 22859 + 23269 22859 + 23520 22859 + 23947 22859 + 24541 22859 + 24580 22859 + 25137 22859 + 27342 22859 + 27387 22859 + 28848 22859 + 30907 22859 + 31244 22859 + 32277 22859 + 268435456 22859 + 888515840709 22859 + 1099511627775 22859 + 17381190257349 22859 + 17592186044415 22859 + 17592186044416 22859 + 35184372088832 22859 + 123145302310912 22859 + 140737488355328 22859 + 281263980923589 22859 + 281474976710640 22859 + 281474976710641 22859 + 281474976710654 22859 + 281474976710655 22859 + 281474976710656 22934 + 22934 22934 + 23269 22934 + 23520 22934 + 23947 22934 + 24541 22934 + 24580 22934 + 25137 22934 + 27342 22934 + 27387 22934 + 28848 22934 + 30907 22934 + 31244 22934 + 32277 22934 + 268435456 22934 + 888515840709 22934 + 1099511627775 22934 + 17381190257349 22934 + 17592186044415 22934 + 17592186044416 22934 + 35184372088832 22934 + 123145302310912 22934 + 140737488355328 22934 + 281263980923589 22934 + 281474976710640 22934 + 281474976710641 22934 + 281474976710654 22934 + 281474976710655 22934 + 281474976710656 23269 + 23269 23269 + 23520 23269 + 23947 23269 + 24541 23269 + 24580 23269 + 25137 23269 + 27342 23269 + 27387 23269 + 28848 23269 + 30907 23269 + 31244 23269 + 32277 23269 + 268435456 23269 + 888515840709 23269 + 1099511627775 23269 + 17381190257349 23269 + 17592186044415 23269 + 17592186044416 23269 + 35184372088832 23269 + 123145302310912 23269 + 140737488355328 23269 + 281263980923589 23269 + 281474976710640 23269 + 281474976710641 23269 + 281474976710654 23269 + 281474976710655 23269 + 281474976710656 23520 + 23520 23520 + 23947 23520 + 24541 23520 + 24580 23520 + 25137 23520 + 27342 23520 + 27387 23520 + 28848 23520 + 30907 23520 + 31244 23520 + 32277 23520 + 268435456 23520 + 888515840709 23520 + 1099511627775 23520 + 17381190257349 23520 + 17592186044415 23520