ATM problem

ATM problem
I’m new to codechef, I can’t understand what’s wrong in my code. It runs fine in custom input. please help!

#include<bits/stdc++.h>
using namespace std;
int main()
{
	int amt;
    float bal,ans;
    cin>>amt>>bal;
    if(amt%5==0 && amt+0.5<=bal)
    {
        ans=bal-amt-0.5;
        cout<<fixed<<setprecision(2)<<ans<<endl;
    }
    else
        cout<<fixed<<setprecision(2)<<bal<<endl;
    return 0;
}

it should be "< " in line 8. Hence it is not clearing the test cases.

1 Like