Java Cut the Silver Bar Solution