\documentclass{article}
\usepackage{tikz}
\usepackage{pdflscape}
\usepackage[top=1.6cm, bottom=1.6cm, left=1.6cm, right=1.6cm]{geometry}
\pagestyle{empty}
\newcommand\genkoyoshi[4]{% maxrow, maxcol, size, sep
  \def\maxrow{#1}%
  \def\maxcol{#2}%
  \def\size{#3}%
  \def\sep{#4}%
  \begin{tikzpicture}
    \pgfmathsetmacro{\inc}{\size+\sep}
    \foreach \col in {1,...,\maxcol}{
      \foreach \row in {1,...,\maxrow}{
        \draw ({(\col-1)*\inc pt},{\row*\size})
        rectangle ++ (\size,\size);
      }
      \draw ({(\col-1)*\inc-\sep},{\size})
      rectangle ++ (\sep,\maxrow*\size);
    }
  \end{tikzpicture}%
}
\begin{document}
\begin{landscape}
\genkoyoshi{20}{20}{9mm}{3mm}
\end{landscape}
\end{document}
