#include <iostream>
using namespace std;

int calc(double d)
{
    const long Factor = 1000;  // die 3 Nachkommazahlen nach links verschieben
    long x = static_cast<long>(d * Factor);
    long a = x * 40; // entspricht /25 * 1000
    
    int e = static_cast<int>((a / Factor) % 1000);
    
    return e;
}

int main() {
    
    std::cout << calc(90000.049) << endl;
    
    std::cout << calc(90000.050) << endl;
    
    std::cout << calc(90000.025) << endl;
    
    std::cout << calc(90000.024) << endl;

	return 0;
}
