#include #include #include #include int main() { long long int maney = 0; int children = 0; int divisionManey = 0; 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); }