\section{Slightly harder problems}

% Sherlock, A matter of direction
\problem{A matter of direction}
%\difficulty{3}{5}
\starvalue{4}

The results of a game of chess are shown below. \par
Did White start on the north or south side of the board? \par
\manyboards{
	ka8,Kc8,
	Qe7,
	Bc5,Pe5,
	Pd4,
	Ph3,
	Bh1
}

\begin{hintlist}
	Part 1: \tab\threestars{0}{1}{3} \par
	\hintcontentnew{
		The bishop on H1 is important. How did White deliver this check?
	}
	\vspace{2mm}
	Done: \tab\threestars{1}{3}{0}
\end{hintlist}

\begin{solution}
	Let us first find White's last move. It wasn't with the pawns on D4 and E5, since Black wouldn't have a move before that.
	(Note the double-check on A7).

	\vspace{2mm}

	How, then, did White put Black in check? There are no pieces that could've uncovered this check, and the bishop on H1 couldn't
	have moved from anywhere. We thus see that that bishop must be a promoted pawn, proving that White started on the north side of the board.
\end{solution}

\vfill
\pagebreak
















% Arabian Knights 1
\problem{Where is the king?}
%\difficulty{3}{5}
\startimes{8}

The white king has again become invisible. Find him. \par
\hint{White started on the bottom. En passant.} \par

\manyboards{
	rb5,bd5,
	Ba4,
	kd1
}


\begin{hintlist}
	Part 1: \tab\threestars{0}{2}{6} \par
	\hintcontentnew{
		Either the white king is on B3, or Black is in check. \par
		First, show that the latter implies the former.
	}

	Part 2: \tab\threestars{2}{2}{4} \par
	\hintcontentnew{
		Moving back in time, you'll need to add two pieces to the board (not counting the king). \par
		They have been captured!
	}

	\vspace{2mm}
	Done: \tab\threestars{4}{4}{0}
\end{hintlist}


\makeatletter
\if@solutions
	\vfill
	\pagebreak
\fi
\makeatother

\begin{solution}
	Looking at the board, we see that the white king is on B3 or Black is in check.

	\vspace{2mm}

	First, we show that the latter implies the former: assume the black king is not on B3. \par
	How did White deliver this check?
	Not by moving the bishop, so this check must have been discovered by the white king moving from B3.
	Therefore, if the white king isn't on B3 now, he was there on the previous move.

	\vspace{4mm}

	How did the white king end up on B3? That seems to be an impossible double-check from both the rook and bishop!
	Looking at the hint, we place a black pawn on B4 to block check from the rook, and a white pawn on C2 that this black pawn will capture.
	The sequence of moves is now as follows:

	\begin{minipage}{0.5\linewidth}
		\begin{center}
			\chessboard[
				setpieces = {
					rb5,
					Ba4,pb4,be4,
					Kb3,
					Pc2,
					kd1
				}
			]
		\end{center}
	\end{minipage}
	\hfill
	\begin{minipage}{0.48\linewidth}
		Black: E4 $\to$ D5 \par
		White: C2 $\to$ C4 \par
		Black: B4 $\to$ C3 (en passant capture) \par
		White: B3 $\to$ C3 \par
		So, the white king must be on C3.
	\end{minipage}

\end{solution}

\vfill
\pagebreak














% Arabian Knights, intro (given with solution)
\problem{Double-checks}
%\difficulty{3}{5}
\startimes{10}

White to move. Which side of the board did each color start on? \par
\hint{What was Black's last move? }

\manyboards{
	Re3,
	Nc2,Rd2,
	Nd1,kf1,Kh1
}

\begin{hintlist}
	Part 1: \tab\threestars{0}{5}{5} \par
	\hintcontentnew{
		Double-checks make all positions seem impossible... \par
		Try E1 and F2 anyway. Can you add pieces to make it make sense? \par
		Don't forget about promotion.
	}

	\vspace{2mm}
	Done: \tab\threestars{5}{5}{0}
\end{hintlist}

\begin{solution}
	Black's last move was from F2, where his king was in double-check from both a rook and a knight.
	How did this happen?

	\vspace{2mm}

	White started on the north side of the board, and put Black in check by capturing a piece on D1 with
	a pawn and then promoting that pawn to a knight.

	\begin{center}
		\chessboard[
			smallboard,
			setpieces = {
				Re3,
				Nc2,Rd2,Pe2,
				bd1,kf2,Kh1
			}
		]
	\end{center}

\end{solution}

\vfill
\pagebreak














% Arabian Knights 4
\problem{A missing piece}
%\difficulty{4}{5}
\startimes{20}

There is a piece at G4, marked with a $\odot$. \par
What is it, and what is its color? \par

\manyboards{
	ra8,ke8,rh8,
	pc7,pd7,
	pb6,
	pa5,
	Ug4,
	Pb3,Pg3,Ph3,
	ba2,Pb2,Pc2,Pd2,Pf2,qg2,bh2,
	Kc1,Rd1,nf1,Bh1
}


\begin{hintlist}
	Part 1: \tab\threestars{0}{1}{19} \par
	\hintcontentnew{
		What color is the missing piece? Count captures.\par
		Look at the region bounded by A1 and B3. How did the bishop get there?
	}

	Part 2: \tab\threestars{1}{1}{18} \par
	\hintcontentnew{
		What was White's last move? \par
		What does this tell us about White's king?
	}

	Part 3: \tab\threestars{2}{1}{17} \par
	\hintcontentnew{
		Now, look at the region bounded by G1 and H3. \par
		In Part 1, we found that all of White's pieces were captured---including the H1 rook. \par
		How did it get off its home square to be captured? \par
		What does this tell us about the bishop on H1?
	}

	Part 4: \tab\threestars{3}{2}{15} \par
	\hintcontentnew{
		The black bishop on H2 must have been promoted on G1. \par
		Which pawn was it, and how did it get there? (Remember, we counted captures in Part 1). \par
		In what order did the cross capture by the G1 and H1 pawns occur?
	}

	Part 5: \tab\threestars{5}{2}{13} \par
	\hintcontentnew{
		Which black pieces are still missing? \par
		Remember that White cannot castle through check.
	}

	\vspace{2mm}
	Done: \tab\threestars{7}{13}{0}
\end{hintlist}



\vfill
\pagebreak

\begin{solution}
	\textbf{Part 1:}

	The black bishop on A2 cannot be original, since the white pawn on B3 would have prevented it from getting there.
	That bishop is a promoted bishop. \par

	The black pawn it was promoted from must have come from E7,
	captured four pieces to get to A3, then moved to A2, and then made a capture on B1, where it was promoted. \par

	Thus, the pawn from E7 has made five captures.

	\vspace{2mm}

	The white bishop from from C1 never left its home square
	(since neither of the pawns on B2 or D2 have moved), and hence was captured on C1. This makes six captures of
	white pieces, which tells us that the mystery piece is black.


	\vspace{2mm}

	\textbf{Part 2:}

	White's last move could not have been with the rook from E1, which would have checked Black,
	nor with the king (which could only come from B1, an impossible check),
	nor could it have been with any piece other than the rook or king.
	Therefore, White just castled, and thus the white king never moved before that.


	\vspace{2mm}

	\textbf{Part 3:}

	Among the white pieces captured by the black pawn from E7 was the white rook from H1. Since White has just castled,
	and the white king never moved before that, how did the rook from H1 get onto the board to be captured?

	The only possible explanation is that the pawns on G3 and H3 cross-captured to let out the rook:
	the pawn on G3 really came from H2 and vice-versa. Since the pawn on G3 comes from H2, the black bishop
	on H2 has always been confined to G1 and H2. How did the bishop get there? It must have been promoted.


	\vspace{2mm}

	\textbf{Part 4:}

	The promoted black bishop on H2 must have been promoted on G1. The pawn which was promoted must have come from G7,
	since neither of the pawns from F6 or H6 could make a capture to get to the G-file (all six missing white pieces have been accouted for).
	The Pawn from E7 has promoted to the bishop on A2.

	What happened was this: the white pawn from G2 made its capture on H3 while the pawn on G3 was still on H2. This allowed the black pawn
	to come down and be promoted (after the white rook from H1 got out), and then the pawn on H2 made its capture on G3.


	\vspace{2mm}

	\textbf{Conclusion:}

	We already know the mystery piece is black. It can't be a pawn, because we've accounted for all missing black pawns.
	It can't be a queen or a rook, since there couldn't have been any more promotions by Black. It is therefore a bishop or a knight.
	However, White has just castled and moved his king over D1, so the mystery piece cannot be a bishop (the king may not cross through
	check while castling). Therefore, the mystery piece must be \textbf{a black knight}.

\end{solution}

\vfill
\pagebreak