Herbarium
A student has been assigned the task of creating a herbarium that includes at least K leaves from different types of trees. The student has access to a grove, which is organized into N rows, each with M square plots of equal size. Each plot contains trees of a single type.
The student plans to gather the herbarium from a square-shaped section of the grove and wants to determine the minimum number of plots that need to be traversed.
Given the information about which types of trees grow in each plot, you need to write a program that identifies the smallest square-shaped section of the grove that allows the student to collect the required herbarium, and calculates the number of plots in this section.
Note: The student will traverse all plots within the chosen square section of the grove.
Input
The first line contains three integers N, M, K separated by spaces (1 ≤ N, M ≤ 100, 1 ≤ K ≤ 10000).
The following N lines each contain M non-negative integers, separated by spaces. Each integer represents the type of trees growing in the i-th row at the j-th position (1 ≤ i ≤ N, 1 ≤ j ≤ M). The value of the tree type number does not exceed 10^9.
Output
The output should be a single integer — the number of plots in the smallest square-shaped section of the grove that the student needs to traverse to collect the herbarium. It is guaranteed that there is at least one suitable square section of the grove for the student.