I am getting a wrong answer for atm practice question

#include<stdio.h>
int main()
{
int x;
float y;
scanf("%d%f",&x,&y);
if(x<y)
{
if(x%5==0)
{
y=y-x-0.50;
printf("%f",y);
}
else
{
printf("%f",y);
}
}
else
{
printf("%f",y);
}
return 0;
}

There you go with an AC Code:

#include <iostream>

using namespace std;

int main() {
    long long x;
    long double y;
    cin >> x >> y;
    if (x < y) {
        if (x % 5 == 0 && x + 0.50 <= y) {
            y = y - x - 0.50;
            cout << y << '\n';
        } else
            cout << y << '\n';
    } else
        cout << y << '\n';
    return 0;
}