i have corrected my last if even then i am not getting correct answer

here is my code

#include

using namespace std;

int main() {

int t;

cin>>t;

while(t–)

{

long long int n,total;

cin>>n;

```
if(n>=0&&n<=250000)
total=n;
else
if(n>=250001&&n<=500000)
total=n-((250001-n)*0.05);
else
if(n>=500001&&n<=750000)
total=n-((n-500000)*0.1)-12500;
else
if(n>=750001&&n<=1000000)
total=n-((n-750000)*0.15)-37500;
else
if(n>=1000001&&n<=1250000)
total=n-((n-1000000)*0.2)-75000;
else
if(n>=1250001&&n<=1500000)
total=n-((n-1250000)*0.25)-125000;
else
if(n>1500000)
total=n-((n-1500000)*0.3)-187500;
cout<<total<<endl;
}
```

}