Codechef ATM HS08TEST
Codechef ATM HS08TEST
The problem is totally straightforward. Only possible cause for wrong answer response is if x = y. In that case you should check if x+0.5 > y or not.
#include <stdio.h>
int main()
{
int x;
double y;
while (scanf("%d %lf",&x,&y)==2)
{
if (!(((double)x+0.5)>y) && !(x%5))
printf("%.2lf ",y-(double)x-0.5);
else
printf("%.2lf ",y);
}
return 0;
}
Go to link download