#include <stdio.h>
#include <stdlib.h>			// for exit()

#define MAX_SEATS	1500
#define INDENT		"\t\t\t\t\t"

#define myexit(x)						\
	char mys[256]; printf("\npathste ENTER gia ejodo...");	\
	fflush(stdin); fgets(mys, 256, stdin); exit( (x) )

// -------------------------------------------------------------------------------------
int nsupers( int rseats )
{
	if (rseats > 23)
		return 3;

	if (rseats > 15)
		return 2;

	return 1;
}

// -------------------------------------------------------------------------------------
int main( void )
{
	int iroom;			// μετρητής αιθουσών (δεν ζητήθηκε, είναι έξτρα)
	int rseats;			// θέσεις αίθουσας (user input)
	register int booked = 0;	// θέσεις που έχουν ήδη γεμίσει

	booked = 0; iroom = 1;
	while ( booked < MAX_SEATS )	// για όσο οι γεμισμένες είναι λιγότερες της ζήτησης
	{
		printf("\nXwrhtikothta %dhs aithoysas? ", iroom++ );
		fflush(stdin);
		scanf("%d", &rseats);
		printf("%sapaitoymenoi Epithrhtes: %d\n", INDENT, nsupers( rseats ) );

		booked += rseats;	// αύξηση των γεμισμένων θέσεων κατά rseats

		/*
		 * από δω και κάτω δεν χρειάζεται, το έβαλα για εφέ :)
		 */

		int needmore = MAX_SEATS - booked;
		if ( needmore > 0)
			printf("%s(xreiazomaste akoma %d theseis)\n", INDENT, needmore);
		else if ( needmore == 0 )
			printf("%s(tsima tsima hrthame)", INDENT);
		else
			printf("%s(mas peirssepsan kai %d theseis)\n", INDENT, -needmore);
	}

	myexit(0);
}
