This is the program I wrote to solve UVa455
Link : https://onlinejudge.org/index.php?option=onlinejudge&page=show_problem&problem=396
However I cannot comp