\section{Packing a square just below an integer}\label{sec:construction} Fix a prescribed side \(x=K-\delta\), where \(K=\lceil x\rceil\) and \(0\le\delta<1\). For a particular packing \(\mathcal P\), write \(W_{\mathcal P}=x^2-\#\mathcal P\). At an integer side the grid has zero waste. For positive shortfall, Proposition~\ref{prop:construct-rate} constructs a packing with waste at most \(C\max\{\sqrt K,K^{3/5}\delta^{2/5}\}\). The layout has three kinds of regions (Figure~\ref{fig:layout}). An integer grid of side \(G\) fills one corner. Two bands of width \(w\), along the right and the top, are filled by rows of \(m\) units tilted by a small angle \(\theta\), so that a row of \(m\) units spans the width \(w=m\cos\theta+\sin\theta\), which is less than \(m\). This is how the side \(K\) is shortened to \(K-\delta\). Each row wastes only \(\tan\theta\). Where the rows stop, at the two ends of each band, a trapezoid remains whose roof has the small slope \(\tan\theta\). Filling such an end with columns of axis-parallel units loses about half a unit per unit of width, hence of order \(w\). For wide ends this is too much, and the rest of the construction concerns the ends. Section~\ref{sec:joined-ends} fills a piece of an end, a \emph{cap}, with columns of units tilted by a larger angle, whose heights can be adjusted in small steps, and with horizontal rows beside them. Section~\ref{sec:chain} places the cuts between consecutive caps so that the horizontal rows can be joined across the cuts with almost no rounding loss. Section~\ref{sec:construct-rate} sums the losses, and Section~\ref{sec:shallow} gives a shallower variant for very small shortfalls. The tilt and end constructions use ideas of Ryu and the geometry formalized by Daniel~\cite{Ryu,Daniel}. Karimi analyzes a packing with cropped rows in such bands~\cite{Karimi}. In this section the letters \(c,s\) without subscript are reserved for the cosine and sine of the column angle of a cap; those of the band angle are \(\cth,\sth\). \subsection{The integer core and the two tilted bands}\label{sec:band-body} Write \(\cth=\cos\theta,\ \sth=\sin\theta,\ \mu=\sth/\cth\) for the band angle. In this subsection and in the joined-chain construction, choose an integer \(n\ge64\), set \(b=n^2\), and take \[ \tan(\theta/2)=1/b,\qquad \cth=\frac{b^2-1}{b^2+1},\quad \sth=\frac{2b}{b^2+1},\quad \mu=\frac{2b}{b^2-1}. \] The square choice gives the end construction the integer \(n=\sqrt b\), both for its initial half-angle tangent \(1/(2n)\) and for the maximum number of consecutive angle adjustments. \begin{lemma}[Band geometry and count]\label{lem:band-body} Suppose \(b^2\le K,\ \delta n^5\le K,\ 0<\delta<1\). Set \begin{equation}\label{eq:body-parameters} m=\left\lceil b+\delta(b^2+1)/2\right\rceil,\quad G=K-m,\quad w=m\cth+\sth,\quad S=G+w. \end{equation} The grid has side \(G\). The two bands have width \(w\); the band along the right side has length \(Y=S\) and the band along the top has length \(Y=G\). In a band of length \(Y\) place \(R_Y\) rows of \(m\) units, where \[ y_0=32b+\sth\mu,\qquad u=m\sth+\cth,\qquad R_Y=1+\lfloor (Y-u-2y_0)\cth\rfloor . \] They leave two end trapezoids. In the local coordinates \((X,Z)\) of each end the roof is \(Z=L+\mu X\), \(0\le X\le w\). At the lower end \(L=32b\); at the upper end \(32b\le L<32b+1/\cth\). The area between these trapezoids exceeds \(mR_Y\) by \(R_Y\mu\le Y\sth\). The grid, rows, and four trapezoids are inside \([0,x]^2\); the outer strip has area at most \(4K/(b^2+1)\). \end{lemma} \begin{proof} The identities \(\sth=b(1-\cth)\) and \(w=m-(m-b)(1-\cth)\) give \(S=K-(m-b)(1-\cth)\). The ceiling in \eqref{eq:body-parameters} therefore gives \(0\le x-S<1-\cth\), so \(x^2-S^2\le2K(1-\cth)=4K/(b^2+1)\). Since \(n\ge64\), we have \(\delta b^2\le K/n\), \(b\le K/4096\), and \(m\le b+K/128+23K/4\), and \(u+2y_0\le m+64b+5={Stealth[length=1.8mm]}] % integer core \fill[gray!12] (0,0) rectangle (7,7); \foreach \i in {0.5,1,...,6.5} {\draw[gray!55,line width=0.2pt] (\i,0)--(\i,7); \draw[gray!55,line width=0.2pt] (0,\i)--(7,\i);} % right band: ends and rows \fill[gray!45] (7,0)--(9.6,0)--(9.6,1.55)--(7,1.2)--cycle; \fill[gray!45] (7,8.05)--(9.6,8.4)--(9.6,9.6)--(7,9.6)--cycle; \foreach \k in {0,...,15} \draw[line width=0.3pt] (7,1.2+0.45667*\k)--(9.6,1.55+0.45667*\k); % top band: ends and rows \fill[gray!45] (0,7)--(1.2,7)--(1.55,9.6)--(0,9.6)--cycle; \fill[gray!45] (5.45,7)--(7,7)--(7,9.6)--(5.8,9.6)--cycle; \foreach \k in {0,...,9} \draw[line width=0.3pt] (1.2+0.47222*\k,7)--(1.55+0.47222*\k,9.6); % outlines \draw[line width=0.6pt] (0,0) rectangle (7,7); \draw[line width=0.6pt] (7,0) rectangle (9.6,9.6); \draw[line width=0.6pt] (0,7) rectangle (7,9.6); \draw[line width=0.9pt] (0,0) rectangle (10,10); % labels \node at (3.5,3.5) {integer grid \(G\times G\)}; \node[font=\small] at (8.3,0.55) {end}; \node[font=\small] at (8.3,9.0) {end}; \node[font=\small] at (0.6,8.3) {end}; \node[font=\small] at (6.45,8.3) {end}; \node[font=\small,fill=white,inner sep=1.5pt] at (8.3,4.8) {rows}; \node[font=\small,fill=white,inner sep=1.5pt] at (3.5,8.3) {rows}; \draw[<->] (0,-0.5)--(7,-0.5) node[midway,below] {\(G\)}; \draw[<->] (7,-0.5)--(9.6,-0.5) node[midway,below] {\(w\)}; \draw[<->] (0,-1.45)--(10,-1.45) node[midway,below] {\(x=K-\delta\)}; \draw[<->] (-0.5,0)--(-0.5,9.6) node[midway,left] {\(S\)}; \draw[<->] (10.5,0)--(10.5,9.6) node[midway,right] {\(Y=S\)}; \draw[<->] (0,10.5)--(7,10.5) node[midway,above] {\(Y=G\)}; \end{tikzpicture} \caption{The layout of Lemma~\ref{lem:band-body}, not to scale. The core is an integer grid. In each band the rows of \(m\) tilted units cross the band; the four shaded ends are the trapezoids filled in Sections~\ref{sec:joined-ends} and~\ref{sec:chain}. The outer strip between the inner square of side \(S\) and the container has width less than \(1-\cos\theta\).} \label{fig:layout} \end{figure}