def myassert(cond : => Boolean) = {
try {
assert(cond)
} catch {
case _ : Throwable => System.exit(1)
}
}
myassert(collatz_max(10) == (19, 9))
myassert(collatz_max(100) == (118, 97))
myassert(collatz_max(1000) == (178, 871))
myassert(collatz_max(10000) == (261, 6171))
myassert(collatz_max(100000) == (350, 77031))
myassert(collatz_max(1000000) == (524, 837799))
myassert(collatz_max(2) == (1, 2))
myassert(collatz_max(77000) == (339, 52527))