Optimizing Number of Tables in a Room
I'm trying to make a code for optimal seating arrangement to find the maximum number of people that can be seated given length and with or room, tables, and the space between each table.
How can I make my program optimize the number of tables the the room can fit, given the room's restrictions?
I'm thinking of using if and then statements, as well as greater than, less than, or greater to or equal to statements. But I dont know how to utilize them. Or if it would even be efficient to do so.
I started writing the code. But I cant even write an arithmetic operational in order to find the total number of tables a room can fit
Code:
#studio.h
Int main( )
{
Int LengthandWidthofRoom;
Int LengthandWidthofTables;
Int PeoplePerTable;
Int SpaceBetweenTables;
Int NumberofTables;
Int TotalPeople;
LengthandWidthofRoom>=TotalNumberofTables+SpaceBetweenTables
Printf("What is the length and width of the room?" );
Scanf("%d", &LengthandWidthofRoom);
Printf("What is the length and width of each table?" );
Scanf("%d", &LengthandWidthofTables);
Printf("How many people are seated at each table?" );
Scanf("%d", PeoplePerTable);
Printf("How wide is the space between each table?" );
Scanf("%d", &SpaceBetweenTables);
TotalPeople = (PeoplePerTable*NumberofTables) + SpaceBetweenTables
return0;
}