Theater
Very easy
Execution time limit is 1 second
Runtime memory usage limit is 64 megabytes
The theater series M×N sites each. Given two matrices: the first recorded cost of tickets, and the second tells you what tickets have been sold, and what - no (1 - corresponding ticket sold, 0 - not sold).
Vasya with the company wants to go to the theater, but they are willing to buy only the cheapest, which are only in the theater. Determine what the maximum possible size of the company, which may go to the theater (in other words, how many more cheap tickets remained on sale).
Input
Set the number of first N then the number of M. then set the ticket price matrix (N rows by M numbers, each number an integer from 0 to 10000). Further, given a matrix of tickets sold (again N rows by M numbers). N and M do not exceed 100.
Output
Display the desired number.
Examples
Input #1
Answer #1
Submissions 634
Acceptance rate 47%