Problem E. Matrix from Arrays

HDU - 6336