Help me in solving HS08TEST problem

My issue

I dont know where Iam doing mistake all the test cases are not passed.Please help me out.

My code

// We have populated the solutions for the 10 easiest problems for your support.
// Click on the SUBMIT button to make a submission to this problem.

import java.util.*;
import java.io.*;

class Solution{
    public static void main(String[] args) {
        Scanner s=new Scanner(System.in);
        int x=s.nextInt();
        double y=s.nextDouble();
        double result=0;
        if(x%5!=0){
            result=y;
        }
        else if(x > y){
            result=y;
        }
        else{
            result=(y-x)-0.50;
        }
        System.out.print(result);
    }
}
        
       


Problem Link: HS08TEST Problem - CodeChef

@vaishureddy14
Just a little mistake
I have corrected your code . hope u will get it

// We have populated the solutions for the 10 easiest problems for your support.
// Click on the SUBMIT button to make a submission to this problem.

import java.util.*;
import java.io.*;

class Solution{
    public static void main(String[] args) {
        Scanner s=new Scanner(System.in);
        int x=s.nextInt();
        double y=s.nextDouble();
        double result=0;
        if(x%5!=0){
            result=y;
        }
        else if(x+0.5 > y){
            result=y;
        }
        else{
            result=(y-x)-0.50;
        }
        System.out.print(result);
    }
}