atm problem

import java.io.BufferedReader;
import java.io.InputStreamReader;

public class Main
{
	public static void main(String args[])throws Exception
	{
		BufferedReader br=new BufferedReader(new InputStreamReader(System.in));
		try
		{
			
		
		float n=Float.parseFloat(br.readLine());
				
			float x=Float.parseFloat(br.readLine());
		
					
		
		if((n%5!=0)||(x<(n+0.50)))
		{
			
				System.out.println(x);
		}
		else
		{
				System.out.println(x-n-0.50);
			
		}
		}
		catch(Exception e)
		{
		e.printStackTrace();
      }finally{
        br.close();
      }
	}
		
}

********************* what’s wrong with this code

Have a look at this


[1]. Your logic is correct but your code is giving runtime error on the sample test case. Have a look at this 

2.

cant get u…sry.,bt cn u xplain wat r u sayin in detail

You are assuming the input is in 2 separate lines and doing “readline” twice. You are supposed to “readline” once and then split it somehow. Im not a java guy but that could be the problem.