public virtual int placeSizeX { get { return 120; } }
public virtual int placeSizeY { get { return 70; } }
public virtual int corridorWidth { get { return 100; } }
public virtual int placeLoss { get { return 3; } }
private static float TryGetInput()
try { return float.Parse(Console.ReadLine()) * 100; }
catch(System.FormatException _) {
Console.WriteLine("Not a valid number! Please try again.");
public static void Main()
Console.Write("Width (in meters): ");
if(widthCm == 0.0f || widthCm < 3)
Console.WriteLine("Width must be greater than 3 and must not be 0.");
Console.Write("Length (in meters): ");
lengthCm = TryGetInput();
if(lengthCm == 0.0f || lengthCm < widthCm || lengthCm > 100 * 100)
Console.WriteLine("Length must not be 0, lesser than the width, or greater than 100.");
int originalWidth = (int)widthCm;
int originalLength = (int)lengthCm;
var _this = new Program();
widthCm -= _this.corridorWidth;
Console.WriteLine(widthCm);
int lengthPlaces = (int)lengthCm / _this.placeSizeX;
int widthPlaces = (int)widthCm / _this.placeSizeY;
int places = (widthPlaces * lengthPlaces) - _this.placeLoss;
Console.WriteLine("There would be " + places + " places in a room wide " + originalWidth + " centimeters and long " + originalLength + " centimeters.");