Find the Bug

Job ID: 35393732

Budget: $10 – $30 USD

I need you to find the bug and describe a solution to the bug to a simple, 55 line Java program. This is the problem statement :
https://codeforces.com/problemset/problem/614/C?f0a28=1