fork download
  1. #include <cassert>
  2. #include <iostream>
  3. int main() {
  4. typedef long long BigInteger;
  5. BigInteger max/*("FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF");*/ = 0x0FFFFFFFFFFFFFFF;
  6.  
  7. for(BigInteger x0=1; x0<max;x0 *= 2) {
  8. for(BigInteger x1=x0-1; x1<x0-2; ++x1) {
  9. for(BigInteger y0=1; y0<=x1; y0*= 2) {
  10. for(BigInteger y1=y0-1; y1<=y0+1; ++y1) {
  11. BigInteger p(x1*y1);
  12. if (x1) assert(p/x1==y1);
  13. if (y1) assert(p/y1==x1);
  14. }
  15. }
  16. }
  17. }
  18. std::cout << "PASSED DIVISION TESTS";
  19.  
  20. }
Success #stdin #stdout 0s 2928KB
stdin
Standard input is empty
stdout
PASSED DIVISION TESTS