Just try to run this code in the Problem: HS08TEST
It gives a runtime error of NZEC but when I submitted it. CodeChef accepted the code. CodeChef is broken. This wasted my 2 days and now I won’t be using this platform.
import java.util.;
import java.lang.;
import java.io.;
import java.text.;
/* Name of the class has to be “Main” only if the class is public. */
class Codechef
{
public static void main (String[] args) throws java.lang.Exception
{
// your code goes here
int amount;
double balance;
Scanner scanner = new Scanner(System.in);
amount = scanner.nextInt();
balance = scanner.nextDouble();
DecimalFormat df = new DecimalFormat(“###.00”);
if((amount>0 && amount<=2000) && (balance>=0 && balance<=2000)){
if(amount%5==0 && amount<=balance && (amount+0.5<=balance)){
balance = balance-amount;
balance = balance-0.50;
System.out.println(df.format(balance));
}
else{
System.out.println(df.format(balance));
}
}else{
System.out.println(df.format(balance));
}
}
}