spoj code to the spoj problems links : command prompt inputs in javascript : (https://stackoverflow.com/questions/4508897/console-input-function-for-rhino)