ATM problem C++ help

What is wrong in this code. it keeps saying wrong answer.

#include
#include
using namespace std;

int main() {
int x;
double y;
cin >> x >> y;
if(x > 0 && y > 0 && x <= 1200 && y <= 1200){
if ((x + 0.5) < y && x % 5 == 0)
{
y -= (x + 0.5);
printf("%.2f", y);
}
else{
printf("%.2f", y);
}
}

return 0;

}

What’s this for?

1 Like

Range of x and y…

Can you link to the Problem you’re trying to solve? It looks like this one, but if so, those are not the ranges of X and Y.

1 Like

Use x+0.5<=y, and also the ranges are given just to help you find the time and space complexity of your algorithm, no need to include them in the code

1 Like