static int NumberOfRows(double width)
return Convert.ToInt32(Math.Floor(width / 1.2));
static int NumberOfWorkplacesOnRow(double height)
return Convert.ToInt32(Math.Floor(height / 0.7));
static void FindNumberOfWorkplaces(double width, double height)
int NumberOfWorkplaces = NumberOfWorkplacesOnRow(height) * NumberOfRows(width) - 3;
Console.WriteLine("The workplaces are " + NumberOfWorkplaces + ".");
static double CheckWidth(double width)
while(width < 3 || 100 < width)
Console.WriteLine("The width must be between 3 and 100. Enter it again.");
width = double.Parse(Console.ReadLine());
static double CheckHeight(double height, double width)
while(height < 3 || 100 < height || width < height)
Console.WriteLine("The height must be between 3 and 100 and it must be smaller than the width. Enter it again.");
height = double.Parse(Console.ReadLine());
public static void Main()
double w = CheckWidth(double.Parse(Console.ReadLine()));
double h = CheckHeight(double.Parse(Console.ReadLine()), w);
FindNumberOfWorkplaces(w, h);