\documentclass[11pt,b4j,landscape,twocolumn,papersize]{jsarticle}

% furikana.sty	http://xymtex.com/fujitas2/texlatex/index.html#tategumi
\usepackage{ascmac,bm,amssymb}
\usepackage[deluxe]{otf}
\usepackage[dvipdfmx]{graphicx,color}
%\usepackage[dvipdfmx,pdfpagemode=FullScreen,setpagesize=false]{hyperref}
%\usepackage[dvipdfmx,pdfstartview={XYZ null null 1.75},setpagesize=false]{hyperref}
\usepackage{tikz}
%\usetikzlibrary{calc}
%\usetikzlibrary{intersections,patterns,angles,backgrounds,positioning}

%\AtBeginDvi{\special{pdf:pagesize width 364mm height 257mm}}
\textwidth=330truemm \textheight=226truemm \columnseprule=0pt
\topmargin=-24truemm \oddsidemargin=-8truemm

\newenvironment{nidan}{\begin{minipage}[t]{.225\textwidth}}{\end{minipage}}
\def\nidangumi#1#2{\begin{nidan}{#1}\end{nidan}\quad%
\begin{nidan}{#2}\end{nidan}}

% ■■■ 0より大きいときはdvipdfmxで印刷用PDFを作ることを想定（答えはプリント
% 下部に出力される）
%        0 のときはdvipdfmxでデジタル教材用PDFを作ることを想定（答えは問題の
% すぐ横に赤で出力され、後でOneNoteで黒く塗りつぶし）
\def\make_pdf_with_insatsu{1}

\everymath{\displaystyle}
\parindent=0zw \columnsep=3zw
\lineskiplimit=1ex \normallineskiplimit=\lineskiplimit 
\lineskip=\lineskiplimit \normallineskip=\lineskiplimit

\newcounter{toi} \newcounter{subtoi}[toi]
\newcounter{subsubtoi}[subtoi]

\def\toi{\refstepcounter{toi}\par          % 問
  \makebox[2zw][r]{\Large\ajKaku{\value{toi}}\hspace{0.5zw}}%
  \hangindent=2zw}

\newcounter{subtoihyoji}
\def\subtoi{\refstepcounter{subtoi}\par    % 小問
  \setcounter{subtoihyoji}{\value{subtoi}}
	\ifnum\thesubtoi>20
		\addtocounter{subtoihyoji}{9873}
	\else
		\addtocounter{subtoihyoji}{8070}
	\fi
  \makebox[3.4zw][r]{\CID{\thesubtoihyoji}\hspace{1zw}}%
  \hangindent=3.4zw}

\newcounter{subsubtoihyoji}
\def\subsubtoi{\refstepcounter{subsubtoi}\par    % 小小問
  \setcounter{subsubtoihyoji}{\value{subsubtoi}}
  \addtocounter{subsubtoihyoji}{7554}
  \makebox[4.2zw][r]{\CID{\thesubsubtoihyoji}\hspace{1zw}}%
  \hangindent=4.2zw}

\ifnum\make_pdf_with_insatsu>0
	\def\kotae#1{\relax}
\else
	\def\kotae#1{\hfill \textcolor{red}{\footnotesize\gtfamily\bfseries\(\boldsymbol{#1} \)}}
\fi

\makeatletter
\def\hooklen#1#2{\settowidth{\@tempdima}{\(#1\)}
%\advance\@tempdima by.3ex
% ↑ 数式モードで式の前後に入るスペースを制御したかったが、
%    難しいのでやめた。段々難解なコードになっているのでやめた方がよい？
\hbox to\@tempdima{\hfil \(#2\)\hfil}}
\makeatother

\newcommand{\Slash}[1]{\ooalign{\hfil\kern-2pt／\hfil\crcr$#1$}}
\pagestyle{empty}

\begin{document}
%
%  ===========================以下本文===============================
%
\def\namae{%
{\Large\gtfamily\bfseries 数学I\kern-2pt I \quad 改訂版プリント\# 3}\hfill
年\hskip8ex 組\hskip8ex 号 \hskip5ex

\hfill 
\underline{氏名\rule[-2ex]{0cm}{6ex}\hskip30ex}}

\namae

\vskip-3ex

\begin{tikzpicture}[rotate=-135, scale=1.7, >=stealth,
	baseline=(current bounding box.north)]
\draw(0,6)--(0,0)--(6,0);
\foreach \i in {1,...,5}{\draw(0,6-\i)--(\i,6-\i)--(\i,0);}
\draw(2,-1.8) node{\large\gtfamily\bfseries ■パスカルの三角形};
\foreach \i in {0,...,6}{\draw(\i,0) node[yshift=-3ex]{\textcolor{red}{\Large 1}};}\foreach \i in {1,...,6}{\draw(0,\i) node[yshift=-3ex]{\textcolor{red}{\Large 1}};}\draw(1,1) node[yshift=-3ex]{\textcolor{red}{\Large 2}};
\draw(1,2) node[yshift=-3ex]{\textcolor{red}{\Large 3}};
\draw(2,1) node[yshift=-3ex]{\textcolor{red}{\Large 3}};
\draw(1,3) node[yshift=-3ex]{\textcolor{red}{\Large 4}};
\draw(2,2) node[yshift=-3ex]{\textcolor{red}{\Large 6}};
\draw(3,1) node[yshift=-3ex]{\textcolor{red}{\Large 4}};
\draw(1,4) node[yshift=-3ex]{\textcolor{red}{\Large 5}};
\draw(2,3) node[yshift=-3ex]{\textcolor{red}{\Large 10}};
\draw(3,2) node[yshift=-3ex]{\textcolor{red}{\Large 10}};
\draw(4,1) node[yshift=-3ex]{\textcolor{red}{\Large 5}};
\draw(1,5) node[yshift=-3ex]{\textcolor{red}{\Large 6}};
\draw(2,4) node[yshift=-3ex]{\textcolor{red}{\Large 15}};
\draw(3,3) node[yshift=-3ex]{\textcolor{red}{\Large 20}};
\draw(4,2) node[yshift=-3ex]{\textcolor{red}{\Large 15}};
\draw(5,1) node[yshift=-3ex]{\textcolor{red}{\Large 6}};
\end{tikzpicture}

\begin{eqnarray*}
(x+1)^1 &=& \hooklen{x^5+5x^4+10x^3+10x^2+5x+1}{x+1}\\
(x+1)^2 &=& \hooklen{x^5+5x^4+10x^3+10x^2+5x+1}{x^2+2x+1}\\
(x+1)^3 &=& \hooklen{x^5+5x^4+10x^3+10x^2+5x+1}{x^3+3x^2+3x+1}\\
(x+1)^4 &=& \hooklen{x^5+5x^4+10x^3+10x^2+5x+1}{x^4+4x^3+6x^2+4x+1}\\
(x+1)^5 &=& x^5+5x^4+10x^3+10x^2+5x+1
\end{eqnarray*}


\toi 次の式を展開しなさい。%{\gtfamily\bfseries 難しい問題}

\nidangumi{\subtoi \( (x+2)^3 \) \kotae{x^3+6x^2+12x+8} }
	{\subtoi \( (x+2)^4 \) \kotae{x^4+8x^3+24x^2+32x+16} }\vfill


\ifnum\make_pdf_with_insatsu>0
	\rotatebox{180}{{\normalsize\gtfamily\bfseries 改訂版プリント\#3}\scriptsize
	{\normalsize\ajKaku{3}}~
	\ajKakko{1}~\( a^5+5a^4b+10a^3b^2+10a^2b^3+5ab^4+b^5 \)\ 
	\ajKakko{2}~\( 16a^4+96a^3+216a^2+216a+81 \)\  
	{\normalsize\ajKaku{4}}~\( 15 \)\ 
	{\normalsize\ajKaku{5}}~\( -280 \)
	}
\fi



%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\newpage


\nidangumi{\subtoi \( (x+2)^5 \) \\\kotae{x^5+10x^4+40x^3+80x^2+80x+32} }
	{\subtoi \( (x-1)^4 \) \kotae{x^4-4x^3+6x^2-4x+1} }\vfill

{\large\gtfamily\bfseries ■　二項定理}

\vspace*{-3ex}
\begin{center}
\begin{minipage}[t]{0.4\textwidth}
\begin{shadebox}
\vspace*{0.5ex}

組合せCの計算

\hskip6zw \( {}_8 \mbox{C}_3 = %
%{8から始めて数字を1ずつ減らしながら3個の数字をかけ算 \over 3から1までの数字をかけ算} =
		{8 \times 7 \times 6 \over 3 \times 2 \times 1} =
		{8 \times 7 \times \Slash{6}^{\displaystyle\Slash{3}^{\displaystyle1}} \over %
{}_{\displaystyle1}\Slash{3} \times \Slash{2}_{\displaystyle1} \times 1} = 8 \times 7 = 56\)

\vspace*{0.5ex}
\end{shadebox}
\end{minipage}
\end{center}


\fbox{その他の例} \mbox{}\hskip7zw \( {}_9 \mbox{C}_2 = %
		{9 \times 8 \over 2 \times 1} =
		{9 \times \Slash{8}^{\displaystyle4} \over {}_{\displaystyle1}\Slash{2} \times 1} = 9 \times 4=36\)\ \□答

\vskip1zh

\mbox{}\hskip12zw \( {}_6 \mbox{C}_4 = %
		{6 \times 5 \times 4 \times 3 \over 4 \times 3 \times 2 \times 1} =
		{{}^{\displaystyle3}\Slash{6} \times 5 \times \Slash{4}^{\displaystyle1} \times \Slash{3}^{\displaystyle1} \over %
{}_{\displaystyle1}\Slash{4} \times \Slash{3}_{\displaystyle1} \times \Slash{2}_{\displaystyle1} \times 1} =
		3 \times 5=15\)\ \□答

\vskip1zh

\mbox{}\hskip5zw \( {}_5 \mbox{C}_0 = 1, \quad {}_9 \mbox{C}_0 = 1, \quad {}_{12} \mbox{C}_0 = 1 \)と決めます。
【\ 右側の小さな数字が0のときは{\LARGE\boldsymbol{$1$}} \ 】

\vskip1zh

\toi 次の値を計算しなさい。

\nidangumi{\subtoi \( {}_6 \mbox{C}_3 \) \kotae{20} }
	{\subtoi \( {}_8 \mbox{C}_4 \) \kotae{70} }\vskip7ex

%\nidangumi{\subtoi \( {}_5 \mbox{C}_4 \) \kotae{5} }
%	{\subtoi \( {}_9 \mbox{C}_7 \) \kotae{36} }\vskip7ex

\nidangumi{\subtoi \( {}_{10}\mbox{C}_{2} \) \kotae{45} }
	{\subtoi \( {}_{9}\mbox{C}_{6} \) \kotae{84} }\vskip7ex

%\nidangumi{\subtoi \( {}_{11}\mbox{C}_{4} \) \kotae{330} }
%	{\subtoi \( {}_{10}\mbox{C}_{7} \) \kotae{120} }\vskip7ex

\nidangumi{\subtoi \( {}_7 \mbox{C}_3 \) \kotae{35} }
	{\subtoi \( {}_{12} \mbox{C}_5 \) \kotae{792} }\vskip7ex

\nidangumi{\subtoi \( {}_5 \mbox{C}_5 \) \kotae{1} }
	{}\vskip7ex


%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\newpage


%\ifnum\make_pdf_with_insatsu>0
%	\rotatebox{180}{{\normalsize\gtfamily\bfseries 改訂版プリント\#3}\scriptsize
%	{\normalsize\ajKaku{3}}~15\ 
%	{\normalsize\ajKaku{4}}~\(-280\)\ 
%	}
%\fi



\begin{center}
\begin{minipage}[t]{0.4\textwidth}
\begin{shadebox}
\vspace*{0.5ex}

{\gtfamily\bfseries 二項定理}

\( (a+b)^n={}_n\mbox{C}_0 \ a^n + {}_n\mbox{C}_1 \ a^{n-1}\,b
	 + {}_n\mbox{C}_2 \ a^{n-2}\,b^2 + \cdots \)

\hskip9zw \( \cdots +{}_n\mbox{C}_r \ a^{n-r}\,b^r + \cdots
	 +{}_n\mbox{C}_{n-1} \ a\,b^{n-1}
	 + {}_n\mbox{C}_n \ b^n  \)

\vspace*{0.5ex}
\end{shadebox}
\end{minipage}
\end{center}


\toi 次の式を展開しなさい。%{\gtfamily\bfseries 難しい問題}

\nidangumi{\subtoi \( (a+b)^5 \) \\
	\kotae{a^5+5a^4b+10a^3b^2+10a^2b^3+5ab^4+b^5} }
	{\subtoi \( (2a+3)^4 \) \\
	\kotae{16a^4+96a^3+216a^2+216a+81} }\vfill

%\nidangumi{\subtoi \( (x+1)^5 \) \\\kotae{x^5+5x^4+10x^3+10x^2+5x+1} }
%	{\subtoi \( (2x+1)^5 \) \\\kotae{32x^5+80x^4+80x^3+40x^2+10x+1} }\vfill

\toi \( (a+b)^6 \)の展開式における\(a^4b^2\)の係数を求めよ。
{\gtfamily\bfseries 分かりにくい問題}\kotae{15} \vfill

\toi \( (x-2)^7 \)の展開式における\(x^4\)の係数を求めよ。
{\gtfamily\bfseries 分かりにくい問題} \kotae{-280} \vfill



\ifnum\make_pdf_with_insatsu>0
	\rotatebox{180}{{\normalsize\gtfamily\bfseries 改訂版プリント\#3}\scriptsize
	{\normalsize\ajKaku{1}}~\ajKakko{1}~\( x^3+6x^2+12x+8 \)\ 
	\ajKakko{2}~\( x^4+8x^3+24x^2+32x+16 \)\ 
	\ajKakko{3}~\( x^5+10x^4+40x^3+80x^2+80x+32 \)\ 
	\ajKakko{4}~\( x^4-4x^3+6x^2-4x+1 \)\ 
	{\normalsize\ajKaku{2}}~
	\ajKakko{1}~\( 20 \)\ 
	\ajKakko{2}~\( 70 \)\ 
	\ajKakko{3}~\( 45 \)\ 
	\ajKakko{4}~\( 84 \)\ 
	\ajKakko{5}~\( 35 \)\ 
	\ajKakko{6}~\( 792 \)\ 
	\ajKakko{7}~\( 1 \)
	}
\fi


\end{document}
