매번 나오는 분할정복 문제. import sys input = sys.stdin.readline def check(n,s_x,s_y): pivot = matrix[s_x][s_y] for i in range(s_x,s_x+n): for j in range(s_y,s_y+n): if matrix[i][j] != pivot: return False return True def divide_paper(n,s_x,s_y): global papers pivot = n//3 if n==1: papers[matrix[s_x][s_y]] += 1 return if check(n,s_x,s_y): papers[matrix[s_x][s_y]] += 1 return for i in range(3): for j in rang..