Find the Parts

아직 제출이 없습니다시간 제한4초메모리 제한2048 MB

문제

Two robots, Carl and Clara, are a part of a secret network designed to pass messages.

Robot Clara has got a secret message. The message has a form of a black-and-white rectangle of rr rows and cc columns which contains r×cr \times c pixels. Each pixel is characterized by brightness: an integer from 00 to 255255 (a byte) where 00 is black, 255255 is white, and the numbers in between correspond to different shades of gray.

Clara does not know whether the message has some hidden meaning, but it definitely looks like "white noise": each pixel can be considered to have a random value which is independent from other pixels and uniformly distributed among the 256256 possible colors.

Clara's job is to answer questions by robot Carl. Each question is formulated as a small black-and-white rectangle. The answer is the coordinates of that rectangle in the original message.

However, before answering questions, Clara has to delete the message. Unfortunately, her memory is limited to a mere 400400 kibibytes, so the message may not fit there...

How should Clara act to nevertheless answer all the questions correctly?