#include <stdio.h>
int main ()
{
	int p, k, i, j, temp = 1;
	printf ("\nMeghdare pool = ");
	scanf("%d", &p);
	for (i = 1; i < p/20 && temp; i++)
		for (j = 1; j < p/30 && temp; j++)
			for (k = 1; k < p/50 && temp; k++)
				if (i * 20 + j * 30 + k * 50 == p)
				{
					printf ("\n %3d sekke 20 riali \n %3d sekke 30 riali \n %3d sekke 50 riali \n jam kol = %d rial", i, j, k, p);
					temp = 0;
				}
	//shodani nist
	if (temp == 1)
		printf ("Mablaghe %d ba seka haye 20, 30 va 50 khord nemishavad.", p);
	getch();
}

