using System;
public class Program
{
public static void Main()
int width = 200;
int height = 300;
int max = 150;
var scale = (width - ((width - height >> 31) & 0x1) * (width - height)) / max;
int newHeight = height / scale;
int newWidth = width / scale;
Console.WriteLine($"Height: {newHeight}, Width: {newWidth}");
}