#include #include #include #include int main() { long long int maney = 0; long long int children = 0; long long int divisionManey = 0; long long int giveManey = 0; scanf("%d", &maney); scanf("%d", &children); divisionManey = maney / children; if (divisionManey < 1000) { printf("0\n"); return 0; } while (divisionManey >= 1000) { giveManey += 1000; divisionManey -= 1000; } printf("%d\n", giveManey); }