This one taught me a lot about ruby language; DoS on SPOJ