#include <stdio.h>

int main() {
    int total,i,j,k;
    scanf("%d",&total);
    total-=1500;

    for (i=1; 500*i<=total; i++) {
        for (j=1; 700*j+500*i<=total; j++) {
            for (k=1; 700*j+500*i+400*k <=total; k++) {
                if (total==700*j+500*i+400*k) printf("%d %d %d\n",i ,j ,k);
            }
        }
    }
    return 0;
}

Embed on website

To embed this project on your website, copy the following code and paste it into your website's HTML: