B. Square Filling(贪心,矩阵)
B. Square Filling time limit per test1 second memory limit per test256 megabytes inputstandard input outputstandard output You are given two matrices 𝐴 and 𝐵. Each matrix contains exactly 𝑛 rows and 𝑚 columns. Each element of 𝐴 is either 0 or 1; each element of 𝐵 is initially 0. You may perform some operations with matrix 𝐵. During each operation, you choose any submatrix of 𝐵 having size 2×2, and replace every element in the chosen submatrix with 1. In other words, you choose two integers 𝑥 and 𝑦 such that 1≤𝑥<𝑛 and 1≤𝑦<𝑚, and then set 𝐵𝑥,𝑦, 𝐵𝑥,𝑦+1, 𝐵𝑥+1,𝑦 and 𝐵𝑥+1,𝑦+1 to 1. Your goal is to