Getting WA in "Tax Slab" (SLAB)

1st problem of Feb Cookoff
SLAB

This gives AC
https://www.codechef.com/viewsolution/29725394

But This gives WA
https://www.codechef.com/viewsolution/29723077

Getting different answer when use 0.30
But getting correct when use 30/100

I got AC when I used in decimal format and WA when i used fraction format :joy::joy::joy:

changing

cout<<n-tax<<endl

to

cout<<(long long)(n-tax)<<endl

or

cout<<fixed<<setprecision(0)<<n-tax<<endl

seems to fix the problem. You were outputting the number as a float, so it was outputting in scientific notation by default