#include const int MMAX=1000; int map[MMAX][MMAX]; int main() { int N, K; std::cin >> N >> K; int m=0; while (m*K