Java tutorial
//package com.java2s; public class Main { public static float getBalance(int h, int w, float height, float width) { return Math.min(h / height, w / width); } }