| 2437 - Pattern Finder Oceania - South Pacific - 2008/2009 | |||||
| Submit | Ranking | ||||
A number pattern is a sequence of two or more numbers that satisfies a certain rule. For instance, the sequence ``
3, 5, 7, 9,...
Mrs Brown's number pattern challenge for her 2nd
Mrs Brown has a large number of these grids, but she does not have the time to find the correct answer for each one. Your task is to help by writing a program to check the existence of a pattern of the required form in a given grid.
The input consists of a series of scenarios. The first line in each scenario consists of two positive integers N
Input is terminated by a challenge where N
This challenge should not be processed.
Output consists of one line for each grid. It will be in one of the following two formats:

For instance, the grid on the left has a pattern that starts at 4 and jumps by 2 and terminates at the largest value of 14, but no pattern can be found in the grid on the right.
Input
N, M
100
Output
At least one pattern exists.
No pattern can be found.
Sample Input
28
77 78 79 77 77 77 77 77
78 79 80 81 82 83 84 85
-1 -1
Sample Output
At least one pattern exists.
South Pacific 2008-2009