Tightly Packed
시간 제한1초메모리 제한1024 MB
한 변이 정수인 W와 H에 대해 H/2 ≤ W ≤ 2H를 만족하는 상자에 1x1 위젯 N개를 넣을 때 남는 빈칸 수의 최솟값을 구한다.
문제
Consider packing widgets for shipping where widgets cannot be stacked upon each other (2D packing). Each widget has a 1x1 footprint and is 1 unit high.
Boxes are available in any by by 1 size such that , with and being integers. The company wants to minimize the amount of packing material that will be needed to fill empty squares in a box.
Given , the number of widgets to be shipped, what is the smallest number of squares that will be left empty when those widgets are packed for shipping?
입력
Input consists of one line containing an integer , the number of widgets to be packed. .
출력
Print a single line containing an integer denoting the minimum number of empty squares.