Zito
In one far country somewhere in the of Antarctica the evil ruler Gustav has ruled. Since Gustav was very very evil, he gave all of his servants an order to make a list of grain fields in kingdom. The list was made of: number of different owners of the fields (fields have different owner if they are not connected, and they are connected if they touch each other in any of 8 directions), the size of the biggest field in kingdom and map of all fields together. Gustav wants to list add sizes of all fields which are on the map n or more times and number of different sizes. Help Gustav!
InputIn first line of input are 2 numbers r i s (1<r,s<2553).Next r lines contains s chars describing map of fields.Last line contains number n (0<n<(r*s/2)).
OutputIn first line of output print number of owners.In second line of output print the size of the biggest field.In third line print sizes of fields which are on the map n or more times separated by space!). (if there are not any print -1)In fourth line print number of different sizes of fields.
Input
Output
3 3
.*.
*.*
.*.
1Output
1
5
5
1Submit solution
Coming laterThe grading service will be connected in a later migration step. You can inspect the task and your previous results now.