Instead of doing the work alone, it decides to have its helper cats do the work. Each helper cat also has helper cats in its own hat, and so on. Eventually, the cats reach a smallest size. These smallest cats have no additional cats in their hats. These unfortunate smallest cats have to do the cleaning.
All heights are positive integers.
Each specification is a single line consisting of two positive integers, separated by white space. The first integer is the height of the initial cat, and the second integer is the number of worker cats. A pair of zeros on a line indicates the end of input. Write a computer program to help you identify when your opponent is in danger of getting five stones in a row. Each set of coordinates will consist of 2 integers in the range 1-19 separated by a single space.