Java gets AC but equivalent Golang solution gets WA

I’ve written nearly equivalent programs (~30 lines of code each). However, the judge only accepts the Java solution.

Java (AC): https://www.codechef.com/viewsolution/25395032

Golang (WA): https://www.codechef.com/viewsolution/25395067

At this point, I think I must be going crazy. Can anyone spot the difference?