import java.util.Scanner;
public class Main
{
public static void main(String[] args)
{
Scanner sc = new Scanner(System.in);
int index = 0;
while (true)
{
int n = sc.nextInt();
int m = sc.nextInt();
if (n == 0 && m == 0)
break;
int[][] array = new int[n][m];
for (int i = 0; i < 3; i++)
for (int j = 0; j < n; j++)
for (int k = 0; k < m; k++)
array[j][k] += sc.nextInt();
System.out.format("Case %d:\n", ++index);
for (int j = 0; j < n; j++)
{
for (int k = 0; k < m; k++)
{
System.out.print(array[j][k] / 3);
if (k != m - 1)
System.out.print(",");
}
System.out.println();
}
}
}
}
ZOJ-2857
最新推荐文章于 2017-01-11 17:15:16 发布