package quote_price;

public class Test {
	public static void main(String[] args) {
		double length = 380;
		double width = 250;

		Integer[] lntarray = { 880, 880, 580, 420, 285 };
		Integer[] wntarray = { 590, 380, 430, 285, 210 };
		System.out.println(getNumberThree(lntarray, 760));// 560*320
		System.out.println(getNumberThree(wntarray, 260));// 560*320

		if (length > 285 && length <= 420 && width <= 285) {
			if (length <= 390 && width <= 260) {
				System.out.println("正度8");
			} else {
				System.out.println(8);
			}
		} else if (length > 420 && length <= 580 && width <= 430) {
			if (length <= 540 && width <= 390) {
				System.out.println("正度4");
			} else {
				System.out.println(4);
			}
		} else if (length > 580 && length <= 880 && width <= 380) {
			if (length <= 780 && width <= 350) {
				System.out.println("正度3");
			} else {
				System.out.println(3);
			}
		} else if (length > 580 && length <= 880 && width > 380 && width <= 590) {
			if (length <= 780 && width <= 540) {
				System.out.println("正度2");
			} else {
				System.out.println(2);
			}
			;
		} else if (length <= 285 && width <= 210) {
			if (length <= 260 && width <= 190) {
				System.out.println("正度16");
			} else {
				System.out.println(16);
			}
		}
	}

	public static Integer getNumberThree(Integer[] lntarray, Integer number) {
		int index = Math.abs(number - lntarray[0]);
		int result = lntarray[0];
		for (int i : lntarray) {
			int abs = Math.abs(number - i);
			if (abs <= index && i > number) {
				index = abs;
				result = i;
			}
		}
		return result;
	}

}
