
\documentclass[pstricks]{standalone}
\usepackage{fp}
% user defined macros
\FPeval\Width{21.0} % paper width
\FPeval\Height{29.7} % paper height
\FPeval\HM{1} % horizontal margin
\FPeval\Gap{0.7} % column gap
\FPeval\M{10} % number of columns
% auxiliary macros
\FPeval\Side{round((Width-Gap*(M-1)-2*HM)/M:2)}
\FPeval\N{round((Height-2*HM)/Side:0)}
\FPeval\VM{round((Height-N*Side)/2:2)}
\SpecialCoor
\begin{document}
\begin{pspicture}[showgrid=false](\Width,-\Height)
\multips(0,0)(0,-\Side){\N}{\multips(\HM,-\VM)(!\Side\space \Gap\space add 0){\M}{\psframe[dimen=middle](0,0)(\Side,-\Side)}}
\end{pspicture}
\end{document}
Animated version:
The scientific law: the smaller the column gap, the fewer the number of rows.

\documentclass[pstricks]{standalone}
\usepackage{fp}
\SpecialCoor
\usepackage{multido}
\begin{document}
\multido{\n=0.0+0.2}{10}{%
\FPeval\Width{21.0}
\FPeval\Height{29.7}
\FPeval\HM{1}
\FPeval\Gap{\n}
\FPeval\M{10}
\FPeval\Side{round((Width-Gap*(M-1)-2*HM)/M:2)}
\FPeval\N{round((Height-2*HM)/Side:0)}
\FPeval\VM{round((Height-N*Side)/2:2)}
\begin{pspicture}[showgrid=false](\Width,-\Height)
\multips(0,0)(0,-\Side){\N}{\multips(\HM,-\VM)(!\Side\space \Gap\space add 0){\M}{\psframe[dimen=middle](0,0)(\Side,-\Side)}}
\end{pspicture}}
\end{document}
Edit based on Doctor Kumar's comment
For those who use pdflatex or xelatex on Windows, compile the following with -shell-escape switch. I don't like auto-pst-pdf because of my personal preference.
\documentclass{article}
\usepackage{filecontents}
\begin{filecontents*}{GenkoYoshi.tex}
\documentclass[pstricks]{standalone}
\usepackage{fp}
% user defined macros
\FPeval\Width{21.0} % paper width
\FPeval\Height{29.7} % paper height
\FPeval\HM{1} % horizontal margin
\FPeval\Gap{0.7} % column gap
\FPeval\M{10} % number of columns
% auxiliary macros
\FPeval\Side{round((Width-Gap*(M-1)-2*HM)/M:2)}
\FPeval\N{round((Height-2*HM)/Side:0)}
\FPeval\VM{round((Height-N*Side)/2:2)}
\SpecialCoor
\begin{document}
\begin{pspicture}[showgrid=false](\Width,-\Height)
\multips(0,0)(0,-\Side){\N}{\multips(\HM,-\VM)(!\Side\space \Gap\space add 0){\M}{\psframe[dimen=middle](0,0)(\Side,-\Side)}}
\end{pspicture}
\end{document}
\end{filecontents*}
\begin{document}
\immediate\write18{latex GenkoYoshi}
\immediate\write18{dvips GenkoYoshi}
\immediate\write18{ps2pdf GenkoYoshi.ps}
% begin cleaning
% The following codes are written with Windows' shell commands only for Windows user.
% If you use Linux, then ask other people to translate the codes to Linux's equivalent.
% If you have no friend who can help you, just comment the code and manually remove the associated files.
\makeatletter
\@for\x:={tex,dvi,ps,log,aux}\do{\immediate\write18{cmd /c del GenkoYoshi.\x}}
\makeatother
% end cleaning
Done\ldots\ please open the generated GenkoYoshi.pdf!
\end{document}
\usepackage{auto-pst-pdf}or its latest counterpart (I don't remember it) as a default (since you are a pstricks expert) so that we, who use pdflatex, can directly compile it. +1. – Nov 14 '12 at 00:14\multips(0,0)(0,-\Side){\N}{\multips(\HM,-\VM)(!\Side\space \Gap\space add 0){\M}{\psframe[dimen=middle](0,0)(\Side,-\Side)}}. What could it be? – Alenanno Nov 17 '12 at 12:58filename.texbe the name for the file containing the last code snippet above. Use Windows machine and compile it withpdflatex -shell-escape filename. – kiss my armpit Nov 17 '12 at 14:55