package quote_price;

public class TestMaxMin {
	public static void main(String[] args) {
		System.out.println(Math.abs(8.92) % 100);
//		System.out.println(getNum());
	}

	public static int getNum() {

		double length = 620;
		double width = 320;

		/*
		 * double l1 = Math.ceil(length/90); double w1 = Math.ceil(width/54); double l2
		 * = Math.ceil(width/90); double w2 = Math.ceil(length/54); int min = (int)
		 * Math.min(l1*w1, l2*w2); System.out.println(min);
		 */
//		length = (1194 - length);
		int ikai = 0;
		double price = 0.0;
		String kaiDa = getDa(length, width);
		String kaiZheng = getZheng(length, width);
		int intDa = Integer.parseInt(kaiDa);
		int intZheng = Integer.parseInt(kaiZheng);
		int maxDa = intDa > intZheng ? intDa : intZheng;
//		int maxDa = (int) Math.max(Integer.parseInt(kaiDa), Integer.parseInt(kaiZheng));
		String kai = "";
		if (intZheng >= intDa) {
			kai = "+" + maxDa;
		}
		if (kai.contains("+")) {
			kai = kai.replaceAll("[^(0-9)]", "");
			ikai = Integer.parseInt(kai);
			price = 1.1;
		} else {
			ikai = maxDa;
			price = 1.35;
		}
		return ikai;
	}

	private static String getDa(double length, double width) {
		double l1 = Math.floor(1194 / length);
		double w1 = Math.floor(889 / width);
		double l2 = Math.floor(1194 / width);
		double w2 = Math.floor(889 / length);
		int maxDa = (int) Math.max(l1 * w1, l2 * w2);
		if (w1 != 2) {
			return "" + maxDa;
		} else {
			double ll1 = Math.floor(length / length);
			double ww1 = Math.floor(889 / width);
			double ll2 = Math.floor(length / width);
			double ww2 = Math.floor(889 / length);
			int maxxa = (int) Math.max(ll1 * ww1, ll2 * ww2);

			double lll1 = Math.floor((1194 - length) / length);
			double www1 = Math.floor(889 / width);
			double lll2 = Math.floor(length / width);
			double www2 = Math.floor(889 / length);
			int maxxb = (int) Math.max(lll1 * www1, lll2 * www2);
			maxDa = maxxb + maxxa;
			return "" + maxDa;
		}
	}

	private static String getZheng(double length, double width) {
		double l1 = Math.floor(1092 / length);
		double w1 = Math.floor(787 / width);
		double l2 = Math.floor(1092 / width);
		double w2 = Math.floor(787 / length);
		int maxZheng = (int) Math.max(l1 * w1, l2 * w2);
		if (w1 != 2) {
			return "+" + maxZheng;
		} else {
			double ll1 = Math.floor(length / length);
			double ww1 = Math.floor(787 / width);
			double ll2 = Math.floor(length / width);
			double ww2 = Math.floor(787 / length);
			int maxxa = (int) Math.max(ll1 * ww1, ll2 * ww2);

			double lll1 = Math.floor((1092 - length) / length);
			double www1 = Math.floor(787 / width);
			double lll2 = Math.floor(length / width);
			double www2 = Math.floor(787 / length);
			int maxxb = (int) Math.max(lll1 * www1, lll2 * www2);
			return "+" + maxxb + maxxa;
		}
	}
}
