Logo
(追記) (追記ここまで)

32023번 - Tightly Packed 다국어

시간 제한메모리 제한제출정답맞힌 사람정답 비율
1 초 1024 MB111643949.367%

문제

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 $W$ by $H$ by 1 size such that $H/2 \leq W \leq 2H,ドル with $W$ and $H$ being integers. The company wants to minimize the amount of packing material that will be needed to fill empty squares in a box.

Given $N,ドル 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 $N,ドル the number of widgets to be packed. 1ドル \leq N \leq 10^{16}$.

출력

Print a single line containing an integer denoting the minimum number of empty squares.

제한

예제 입력 1

47

예제 출력 1

1

예제 입력 2

523

예제 출력 2

2

예제 입력 3

10000000000001

예제 출력 3

6

힌트

출처

ICPC > Regionals > North America > Mid-Atlantic Regional > 2018 Mid-Atlantic USA Regional Contest H번

(追記) (追記ここまで)

출처

대학교 대회

  • 사업자 등록 번호: 541-88-00682
  • 대표자명: 최백준
  • 주소: 서울시 서초구 서초대로74길 29 서초파라곤 412호
  • 전화번호: 02-521-0487 (이메일로 연락 주세요)
  • 이메일: contacts@startlink.io
  • 통신판매신고번호: 제 2017-서울서초-2193 호

AltStyle によって変換されたページ (->オリジナル) /