<a href="https://codeforces.com/contest/701/problem/B" target="_blank"><i class="fa fa-external-link" aria-hidden="true"> Link -> Cells Not Under Attack</i></a>
Input Format
check the link
Output Format
check the link
Constraints
check the link
Example
Input
3 3 1 1 3 1 2 2
Output
4 2 0