\documentclass[12pt]{article}
\usepackage{fullpage}
\usepackage{amsmath}
\usepackage{amsfonts}
\usepackage{amstext}
\usepackage{graphics}
\begin{document}
\Large
\begin{center}
2005 Canadian Computing Competition\\
Day 2, Question 1 \\
\end{center}
\large
\setcounter{page}{1}
\noindent
Input file: {\tt primed.in} \\
Output file: {\tt primed.out} \\
Source file: \verb+n:\primed\primed.+\underline{\hspace{0.25in} } \\
\large
\noindent
Primed Sequences
\normalsize
\vspace{0.25in}
Given a sequence of positive integers of length $n$, we define a {\it primed subsequence} as a consecutive subsequence of length at least two that sums to a prime number greater than or equal to two.
For example, given the sequence:
\begin{verbatim}
3 5 6 3 8
\end{verbatim}
There are two primed subsequences of length 2 ($5 + 6 = 11$ and $3 + 8 = 11$), one primed subsequence of length 3 ($6 + 3 + 8 = 17$), and one primed subsequence of length 4 ($3 + 5 + 6 + 3 = 17$).
\vspace{0.25in}
{\bf Input}
Input consists of a series of test cases. The first line consists of an integer $t$ $(1 \leq t \leq 20)$, the number of test cases.
Each test case consists of one line. The line begins with the integer $n$, $0 < n \leq 10000$, followed by $n$ non-negative numbers less than $10000$ comprising the sequence. You should note that 80\% of the test cases will have
at most $1000$ numbers in the sequence.
\vspace{0.25in}
{\bf Output}
For each sequence, print the ``Shortest primed subsequence is length $x$:'', where $x$ is the length of the shortest primed subsequence, followed by the shortest primed subsequence, separated by spaces. If there are multiple such sequences, print the one that occurs first.
If there are no such sequences, print ``This sequence is anti-primed.''.
\vspace{0.25in}
{\bf Sample Input}
\begin{verbatim}
3
5 3 5 6 3 8
5 6 4 5 4 12
21 15 17 16 32 28 22 26 30 34 29 31 20 24 18 33 35 25 27 23 19 21
\end{verbatim}
\vspace{0.25in}
{\bf Sample Output}
\begin{verbatim}
Shortest primed subsequence is length 2: 5 6
Shortest primed subsequence is length 3: 4 5 4
This sequence is anti-primed.
\end{verbatim}
\end{document}