Surveillance
문제
A crime has been committed in the city of <insert name here>! All of the donuts in the bakery next to the police station has mysteriously disappeared. Since this is the favourite bakery of the police, every resource available will be used to find the thief.
The police has made a list of suspected donut thieves, but there is no evidence against anyone yet. Luckily, there is security footage from the scene of the crime. Unfortunately it takes way too long time to watch all of the footage to be done before the expiry date of the donuts has passed.
Therefore, you have been tasked with writing a program to find the cookie thieves in the images. Your program will be given a image of a suspected cookie thief, and a image from the security footage. An image consists of a rectangular array of pixels, which we represent as integers.
Your program should count the number of occurances of the cookie thief image inside the security footage image. We say that a subrectangle of the security footage contains the cookie thief image if there exists some constant such that every pixel in the subrectangle equals the corresponding pixel in the cookie thief image plus . This is because the images may have been taken using different exposure settings, meaning one of the images can be lighter than the other.
입력
The sample judge reads input in the following format:
- line :
B W - line to :
B[i][0] B[i][1] ... B[i][B - 1] - line to :
W[i][0] W[i][1] ... W[i][B - 1]
출력
The judge writes a single line containing the return value of surveillance(B, W, S, T).
예제
예제 1
4 2 1 2 3 4 1 2 3 4 4 3 3 4 4 3 3 4 0 1 0 1
5