Problem F
Islands in the Data Stream
Given a sequence of integers
![\includegraphics[]{b1.png}](/problems/islands/file/statement/en/img-0001.png)
![\includegraphics[]{b2.png}](/problems/islands/file/statement/en/img-0002.png)
![\includegraphics[]{b3.png}](/problems/islands/file/statement/en/img-0003.png)
Write a program that takes as input a sequence of
Input
The first line of input contains a single integer
Each data set consists of a single line of input. It
contains the data set number,
Output
For each data set there is one line of output. The single
output line consists of the data set number,
Sample Input 1 | Sample Output 1 |
---|---|
4 1 0 0 1 1 2 2 1 1 0 1 2 0 2 0 1 2 4 3 1 3 4 5 2 1 0 3 0 1 2 4 4 1 0 2 4 1 0 0 4 0 1 2 3 4 5 6 7 8 9 10 0 |
1 4 2 8 3 6 4 10 |