Problem:

Official House

You manage 4 buildings, each of which has 3 floors, each of which consists of 10 rooms. Write a program which reads a sequence of tenant/leaver notices, and reports the number of tenants for each room.

  For each notice, you are given four integers b, f, r and v which represent that v persons entered to room r of fth floor at building b. If v is negative, it means that &minus;v persons left.

Assume that initially no person lives in the building. 

Input

  In the first line, the number of notices n is given. In the following n lines, a set of four integers b, f, r and v which represents ith notice is given in a line. 

Output

For each building, print the information of 1st, 2nd and 3rd floor in this order. For each floor information, print the number of tenants of 1st, 2nd, .. and 10th room in this order. Print a single space character before the number of tenants. Print "####################" (20 '#') between buildings.

Constraints

No incorrect building, floor and room numbers are given.

0 ≤ the number of tenants during the management ≤ 9

Sample Input

3
1 1 3 8
3 2 2 7
4 3 8 1

Sample Output

 0 0 8 0 0 0 0 0 0 0
 0 0 0 0 0 0 0 0 0 0
 0 0 0 0 0 0 0 0 0 0
####################
 0 0 0 0 0 0 0 0 0 0
 0 0 0 0 0 0 0 0 0 0
 0 0 0 0 0 0 0 0 0 0
####################
 0 0 0 0 0 0 0 0 0 0
 0 7 0 0 0 0 0 0 0 0
 0 0 0 0 0 0 0 0 0 0
####################
 0 0 0 0 0 0 0 0 0 0
 0 0 0 0 0 0 0 0 0 0
 0 0 0 0 0 0 0 1 0 0



Sample input:
3
1 1 3 8
3 2 2 7
4 3 8 1


Sample output:
 0 0 8 0 0 0 0 0 0 0
 0 0 0 0 0 0 0 0 0 0
 0 0 0 0 0 0 0 0 0 0
####################
 0 0 0 0 0 0 0 0 0 0
 0 0 0 0 0 0 0 0 0 0
 0 0 0 0 0 0 0 0 0 0
####################
 0 0 0 0 0 0 0 0 0 0
 0 7 0 0 0 0 0 0 0 0
 0 0 0 0 0 0 0 0 0 0
####################
 0 0 0 0 0 0 0 0 0 0
 0 0 0 0 0 0 0 0 0 0
 0 0 0 0 0 0 0 1 0 0

Submission status: WA: Presentation Error

Solution code:
class Residents:

    def __init__(self):  
        self.official_house = []

        for b in range(4):
            self.official_house.append([])
            for f in range(3):
                self.official_house[b].append([])
                for r in range(10):
                    self.official_house[b][f].append(0)

    def move_in(self, building, floor, room, num):
        building -= 1
        floor -= 1
        room -= 1
        if self.official_house[building][floor][room] + num > 9:
            self.official_house[building][floor][room] = 9
        else:
            self.official_house[building][floor][room] += num

    def move_out(self, building, floor, room, num):
        building -= 1
        floor -= 1
        room -= 1
        if self.official_house[building][floor][room] < num:
            self.official_house[building][floor][room] = 0
        else:
            self.official_house[building][floor][room] -= num

    def show(self, building, floor, room):
        building -= 1
        floor -= 1
        room -= 1
        return self.official_house[building][floor][room]

    def output(self):
        result = ''
        for b in range(4):
            if b > 0:
                result += '#' * 20 + '\n'
            for f in range(3):
                for r in range(10):
                    result += ' ' + str(self.official_house[b][f][r])
                result += '\n'

        return result


if __name__ == '__main__':

    residents = Residents()
    rows = int(input())  

    for i in range(rows):
        (b, f, r, num) = [int(i) for i in input().split(' ')]
        if num > 0:
            residents.move_in(b, f, r, num)
        else:
            residents.move_out(b, f, r, num * -1)

    print(residents.output())

Submission status: WA: Presentation Error

Solution code:
res = ('0' * 30) * 30
for mak in range(int(input())) :
    tem = [int(temp) for temp in input().split()]
    num = (30 * (tem[0] - 1)) + (10 * (tem[1] - 1)) + (tem[2] - 1)
    res = res[: num] + str(tem[3])+ res[num + 1 :]
for mak in range(12) :
    if   mak != 0 and mak % 3 == 0 : print('#' * 20)
    print(res[(10 * mak):(10 * (mak + 1))])

Submission status: WA: Presentation Error

Solution code:
res = ('0' * 30) * 30
for mak in range(int(input())) :
    tem = [int(temp) for temp in input().split()]
    num = (30 * (tem[0] - 1)) + (10 * (tem[1] - 1)) + (tem[2] - 1)
    res = res[: num] + str(tem[3])+ res[num + 1 :]

for mak1 in range(12) :
    res2 = []
    for mak2 in res[(10 * mak1) : (10 * (mak1 + 1))] :
        res2.append(mak2)
    if   mak1 != 0 and mak1 % 3 == 0 : print('#' * 20)
    print(' '.join(res2))

Submission status: WA: Presentation Error

Solution code:
res = ['-']
for mak in range(12) :
    tem = ['0' for temp in range(10)]
    res.append(tem)

for mak in range(int(input())) :
    a, b, c, d    = [int(temp) for temp in input().split()]
    if   d > 0 : res[((a - 1) * 3) + b][c - 1] = str(d)
    else       : res[((a - 1) * 3) + b][c - 1] = str(int(res[a * b][c]) - d)

for mak in range(1,13) :
    if mak != 1 and mak % 3 == 1 :
        print('#' * 20)
    print(' '.join(res[mak]))

Submission status: WA: Presentation Error

Solution code:
res = ['-']
for mak in range(12) :
    tem = ['0' for temp in range(10)]
    res.append(tem)

for mak in range(int(input())) :
    a, b, c, d    = [int(temp) for temp in input().split()]
    if   d > 0 : res[((a - 1) * 3) + b][c - 1] = str(d)
    else       : res[((a - 1) * 3) + b][c - 1] = str(int(res[a * b][c]) - d)

for mak in range(1,13) :
    if mak != 1 and mak % 3 == 1 :
        print('#' * 20)
    print(' '.join(res[mak]), end ='\n')

Submission status: WA: Presentation Error

Solution code:
res = ['-']
for mak in range(12) :
    tem = ['0' for temp in range(10)]
    res.append(tem)

for mak in range(int(input())) :
    a, b, c, d    = [int(temp) for temp in input().split()]
    if   d > 0 : res[((a - 1) * 3) + b][c - 1] = str(d)
    else       : res[((a - 1) * 3) + b][c - 1] = str(int(res[a * b][c]) - d)

for mak in range(1,13) :
    if mak != 1 and mak % 3 == 1 :
        print('#' * 20)
    print(' '.join(res[mak]).strip())

Submission status: WA: Presentation Error

Solution code:
res = ['-']
for mak in range(12) :
    tem = ['0' for temp in range(10)]
    res.append(tem)

for mak in range(int(input())) :
    a, b, c, d    = [int(temp) for temp in input().split()]
    if   d > 0 : res[((a - 1) * 3) + b][c - 1] = str(d)
    else       : res[((a - 1) * 3) + b][c - 1] = str(int(res[a * b][c]) - d)

for mak in range(1,13) :
    if mak != 1 and mak % 3 == 1 :
        print(('#' * 20).strip())
    print(' '.join(res[mak]).strip())

Submission status: WA: Presentation Error

Solution code:
res = ['-']
for mak in range(12) :
    tem = ['0' for temp in range(10)]
    res.append(tem)

for mak in range(int(input())) :
    a, b, c, d    = [int(temp) for temp in input().split()]
    if   d > 0 : res[((a - 1) * 3) + b][c - 1] = str(d)
    else       : res[((a - 1) * 3) + b][c - 1] = str(int(res[a * b][c]) - d)

for mak in range(1,13) :
    if mak != 1 and mak % 3 == 1 :
        print('#' * 20)
    print(' ',' '.join(res[mak]))

Submission status: WA: Presentation Error

Solution code:
n = int(input())
array = [input().split() for i in range(n)]
b_1 = []
b_2 = []
b_3 = []
b_4 = []
zero = "0 0 0 0 0 0 0 0 0 0"
for i in range(3):
    b_1.append(zero.split())
    b_2.append(zero.split())
    b_3.append(zero.split())
    b_4.append(zero.split())
for i in range(n):
    b = int(array[i][0])
    f = int(array[i][1])
    r = int(array[i][2])
    v = int(array[i][3])
    if b == 1:
        b_1[f-1][r-1] = str(int(b_1[f-1][r-1])+v)
    elif b == 2:
        b_2[f-1][r-1] = str(int(b_2[f-1][r-1])+v)
    elif b == 3:
        b_3[f-1][r-1] = str(int(b_3[f-1][r-1])+v)
    else:
        b_4[f-1][r-1] = int(b_4[f-1][r-1])+v
for i in range(4):
    for i2 in range(3):
        for i3 in range(10):
            if i == 0:
                if i3 == 9:
                    print(b_1[i2][i3])
                else:
                    print(b_1[i2][i3],end=" ")
            elif i == 1:
                if i3 == 9:
                    print(b_2[i2][i3])
                else:
                    print(b_2[i2][i3],end=" ")
            elif i == 2:
                if i3 == 9:
                    print(b_3[i2][i3])
                else:
                    print(b_3[i2][i3],end=" ")
            else:
                if i3 == 9:
                    print(b_4[i2][i3])
                else:
                    print(b_4[i2][i3],end=" ")
    if i == 3:
        break
    else:
        print("####################")

Submission status: WA: Presentation Error

Solution code:
x = [[[0 for k in range(10)]for j in range(3)]for i in range(4)]
n = int(input())
for i in range(n):
    [b, f, r, v] = map(int, input().split())
    x[b-1][f-1][r-1] += v

for b in range(4):
    for f in range(3):
        tmp = list(map(str, x[b][f]))
        print(" ".join(tmp))
    if b!=3:
        print("#"*20)

Submission status: WA: Presentation Error

Solution code:
# coding: utf-8

c1 = {1:[0]*10,2:[0]*10,3:[0]*10}
c2 = {1:[0]*10,2:[0]*10,3:[0]*10}
c3 = {1:[0]*10,2:[0]*10,3:[0]*10}
c4 = {1:[0]*10,2:[0]*10,3:[0]*10}

n = int(input())

for i in range(n):
    b,f,r,v = input().rstrip().split(" ")
    if int(b) == 1:
        c1[int(f)][int(r)-1] = c1[int(f)][int(r)-1] + int(v)
    elif int(b) == 2:
        c2[int(f)][int(r)-1] = c2[int(f)][int(r)-1] + int(v)
    elif int(b) == 3:
        c3[int(f)][int(r)-1] = c3[int(f)][int(r)-1] + int(v)
    else:
        c4[int(f)][int(r)-1] = c4[int(f)][int(r)-1] + int(v)


for i in (1,2,3):
    result = str(c1[i][0])
    for j in range(1,10):
        result = result + " " + str(c1[i][j])
    print(result)
print("####################")
for i in (1,2,3):
    result = str(c2[i][0])
    for j in range(1,10):
        result = result + " " + str(c2[i][j])
    print(result)
print("####################")
for i in (1,2,3):
    result = str(c3[i][0])
    for j in range(1,10):
        result = result + " " + str(c3[i][j])
    print(result)
print("####################")
for i in (1,2,3):
    result = str(c4[i][0])
    for j in range(1,10):
        result = result + " " + str(c4[i][j])
    print(result)

Submission status: WA: Presentation Error

Solution code:
n = int(input())
info = []

for i in range(n):
    b, f, r, v = input().split()
    b = int(b)
    f = int(f)
    r = int(r)
    v = int(v)
    if info == []:
        info.append([b, f, r, v])
    else:
        for x in info:
            if b == x[0] and f  == x[1] and r == x[2]:
                x[3] += v 
            else:
                info.append([b, f, r, v])
            break

for building in range(4):
    for floor in range(3):
        for room in range(10):
            arePeople = False
            for y in info:
                if building + 1 == y[0] and floor + 1 == y[1] and room + 1 == y[2]:
                    print(y[3], end = '')
                    arePeople = True
            if arePeople == False:
                print("0", end = '')             
        print('')
    if building < 3:
        print("####################")

Submission status: WA: Presentation Error

Solution code:

n = int(input())
info = []

for i in range(n):
    b, f, r, v = input().split()
    b = int(b)
    f = int(f)
    r = int(r)
    v = int(v)
    if info == []:
        info.append([b, f, r, v])
    else:
        for x in info:
            if b == x[0] and f  == x[1] and r == x[2]:
                x[3] += v 
            else:
                info.append([b, f, r, v])
            break

for building in range(4):
    for floor in range(3):
        for room in range(10):
            arePeople = False
            for y in info:
                if building + 1 == y[0] and floor + 1 == y[1] and room + 1 == y[2]:
                    print(y[3], end = '')
                    arePeople = True
            if arePeople == False:
                print("0", end = '')             
        if floor == 2 and building == 3:
            break
        print('')
    if building < 3:
        print("####################")

Submission status: WA: Presentation Error

Solution code:
n = int(input())
info = []

for i in range(n):
    b, f, r, v = input().split()
    b = int(b)
    f = int(f)
    r = int(r)
    v = int(v)
    if info == []:
        info.append([b, f, r, v])
    else:
        for x in info:
            if b == x[0] and f  == x[1] and r == x[2]:
                x[3] += v 
            else:
                info.append([b, f, r, v])
            break

for building in range(4):
    for floor in range(3):
        for room in range(10):
            arePeople = False
            for y in info:
                if building + 1 == y[0] and floor + 1 == y[1] and room + 1 == y[2]:
                    print(y[3], end = '')
                    if room < 9:
                        print(" ", end = '')
                    arePeople = True
            if arePeople == False:
                print("0", end = '')
                if room < 9:
                    print(" ", end = '')
        #if floor == 2 and building == 3:
            #break
        print('')
    if building < 3:
        print("####################")

Submission status: WA: Presentation Error

Solution code:

n = int(input())
info = []

for i in range(n):
    b, f, r, v = input().split()
    b = int(b)
    f = int(f)
    r = int(r)
    v = int(v)
    if info == []:
        info.append([b, f, r, v])
    else:
        for x in info:
            if b == x[0] and f  == x[1] and r == x[2]:
                x[3] += v 
            else:
                info.append([b, f, r, v])
            break

for building in range(4):
    for floor in range(3):
        for room in range(10):
            arePeople = False
            for y in info:
                if building + 1 == y[0] and floor + 1 == y[1] and room + 1 == y[2]:
                    print(y[3], end = '')
                    if room < 9:
                        print(" ", end = '')
                    arePeople = True
            if arePeople == False:
                print("0", end = '')
                if room < 9:
                    print(" ", end = '')
        if floor == 2 and building == 3:
            break
        print('')
    if building < 3:
        print("####################")

Submission status: WA: Presentation Error

Solution code:
n = int(input())
record = [ [ [0 for r in range(10)] for f in range(3)] for b in range(4)]

for _ in range(n):
    b,f,r,v = [int(i) for i in input().split(" ")]
    record[b - 1][f - 1][r - 1] += v
for b1 in range(4):
    for f in record[b1]:
        print(" ".join([str(x) for x in f]))
    if b1 != 3:
        print("#" * 20)

Submission status: WA: Presentation Error

Solution code:
n = int(input())
record = [ [ [0 for r in range(10)] for f in range(3)] for b in range(4)]
for _ in range(n):
    b,f,r,v = [int(i) for i in input().split(" ")]
    record[b - 1][f - 1][r - 1] += v
for b1 in range(4):
    for f in record[b1]:
        print(" ".join([str(x) for x in f]))
    if b1 != 3:
        print("#" * 20)

Submission status: WA: Presentation Error

Solution code:
N = int(input())
arr = [[[0 for i in range(10)] for j in range(3)]for r in range(4)]
for i in range(N):
    a=[]
    a.append(list(map(int,input().split())))
    b=a[0][0]-1
    f=a[0][1]-1
    r=a[0][2]-1
    v=a[0][3]
    arr[b][f][r]+=v

for i in range(0,3):
    for j in range(0,3):
        print(" ".join(map(str,arr[i][j])))
    print("#"*20)
for i in range(3):
    print(" ".join(map(str,arr[3][i])))

Submission status: WA: Presentation Error

Solution code:
bldgs = []
for k in range(4):
    bldgs.append([[0 for i in range(10)] for j in range(3)])

n = int(input())
for i in range(n):
    b,f,r,v = map(int, input().split(' '))
    bldgs[b-1][f-1][r-1] += v

for i, bldg in enumerate(bldgs):
    if i > 0:
        print('#'*20)

    for floor in bldg:
        print(' '.join([str(f) for f in floor]))

Submission status: WA: Presentation Error

Solution code:
n = int(input())

L11= [0] * 10
L12= [0] * 10
L13= [0] * 10
L21= [0] * 10
L22= [0] * 10
L23= [0] * 10
L31= [0] * 10
L32= [0] * 10
L33= [0] * 10
L41= [0] * 10
L42= [0] * 10
L43= [0] * 10

for i in range(n):
 b,f,r,v = map(int, input().split())
 r -= 1
 if b == 1:
  if f == 1:
   L11[r] += v
  if f == 2:
   L12[r] += v
  if f == 3:
   L13[r] += v
 if b == 2:
  if f == 1:
   L21[r] += v
  if f == 2:
   L22[r] += v
  if f == 3:
   L23[r] += v
 if b == 3:
  if f == 1:
   L31[r] += v
  if f == 2:
   L32[r] += v
  if f == 3:
   L33[r] += v
 if b == 4:
  if f == 1:
   L41[r] += v
  if f == 2:
   L42[r] += v
  if f == 3:
   L43[r] += v

def PV(L):
 for i in range(9):
  print(str(L[i]) + " ", end="")
 print(str(L[9]))

def PL():
 print("#" * 20)

PV(L11)
PV(L12)
PV(L13)
PL()
PV(L21)
PV(L22)
PV(L23)
PL()
PV(L31)
PV(L32)
PV(L33)
PL()
PV(L41)
PV(L42)
PV(L43)

Submission status: WA: Presentation Error

Solution code:
def print_residence(residence):
    for i in range(4):
        for j in range(3):
            print " ".join(map(str, residence[i][j]))
        if i != 3:
            print "####################"

n = int(raw_input())
residence = [[[0] * 10 for i in range(3)] for j in range(4)]
#print_residence(residence)

for i in range(n):
    info = map(int, raw_input().split())
    #print info
    #print residence
    residence[info[0]-1][info[1]-1][info[2]-1] += info[3] 
    #print residence

print_residence(residence)

Submission status: WA: Presentation Error

Solution code:
#coding:utf-8

n = int(input().rstrip())
tatemono=[
[[0 for i in range(10)],[0 for i in range(10)],[0 for i in range(10)]],
[[0 for i in range(10)],[0 for i in range(10)],[0 for i in range(10)]],
[[0 for i in range(10)],[0 for i in range(10)],[0 for i in range(10)]],
[[0 for i in range(10)],[0 for i in range(10)],[0 for i in range(10)]]]

for i in range(n):
    b,f,r,v = [int(i) for i in input().rstrip().split(" ")]
    tatemono[b-1][f-1][r-1] += v

for i in range(3):
    for j in range(3):
        print(" ".join(list(map(str, tatemono[i][j]))))

    print("####################")

for i in range(3):
    print(" ".join(list(map(str, tatemono[3][i]))))

Submission status: WA: Presentation Error

Solution code:
n=int(input())
data=[[int(num)for num in input().split(' ')] for i in range(n)]
state=[[[0 for i in range(10)]for j in range(3)]for k in range(4)] 
for datum in data:
    state[datum[0]-1][datum[1]-1][datum[2]-1]+=datum[3]
for i in range(4):
    for j in range(3):
        s=""
        for k in range(10):
            s+=str(state[i][j][k])
        print(s)
    if i!=3:
        print('####################')

Submission status: WA: Presentation Error

Solution code:
N=int(input())
l=[[[0 for i in range(10)]for j in range(3)]for k in range(4)]
for i in range(N):
    b, f, r, v = map(lambda x: int(x)-1, input().split())
    l[b][f][r]+=v+1
for j in range(4):
    for k in l[j]:
        print(" ".join(map(str, k)))
    if j < 3:
        print("####################")

Submission status: WA: Presentation Error

Solution code:
rooms = [0] * (4*3*10)
count = int(input())
for i in range(count):
    b, f, r, v = [int(x) for x in input().split()]
    rooms[30*(b-1) + 10*(f-1) + (r-1)] += v
 
for i, room in enumerate(rooms, start=1):
    if i%10 == 0:
        print(room)
    else:
        print(room, end=' ')
    if i%30 == 0 and i%120 != 0:
        print('#'*20)

Submission status: WA: Presentation Error

Solution code:
rooms = [0] * (4*3*10)
count = int(input())
for i in range(count):
    b, f, r, v = [int(x) for x in input().split()]
    rooms[30*(b-1) + 10*(f-1) + (r-1)] += v
  
for i, room in enumerate(rooms, start=1):
    if i%10 == 0:
        print(room)
    else:
        print(room, end=' ')
    if i%30 == 0 and i%120 != 0:
        print('#'*20)

Submission status: WA: Presentation Error

Solution code:


#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
??´?????????
"""

rooms = [[[0 for r in range(10)] for f in range(3)] for b in range(4)]

number = int(input())

for n in range(number):
    inp = input().split(" ")
    b = int(inp[0]) - 1
    f = int(inp[1]) - 1
    r = int(inp[2]) - 1
    v = int(inp[3])
    rooms[b][f][r] += v

for b in range(4):
    if b > 0:
        print("####################")
    for f in range(3):
        print(" ".join(map(str,rooms[b][f])))

Submission status: WA: Presentation Error

Solution code:
Residents = [[[0 for i in range(10)] for j in range(3)] for k in range(4)]
n = int(input())
for l in range(n):
    b, f, r, v = list(map(int, input().split()))
    Residents[b-1][f-1][r-1] += v
for k in range(4):
    for j in range(3):
        print(' '.join(map(str, Residents[k][j])))
    if k == 3:
        break
    print('####################')

Submission status: WA: Presentation Error

Solution code:
building = [[[0 for i in range(10)] for j in range(3)] for k in range(4)]
n = int(input())

for _ in range(n):
    b, f, r, v = input().split(" ")
    building[int(b)-1][int(f)-1][int(r)-1] += int(v)



for i, b in enumerate(building):
    for f in b:
        for r in f[:-1]:
            print("%d "%(r), end="")
        print("%d"%(f[-1]))
    if i != 3:
        print ("####################")

Submission status: WA: Presentation Error

Solution code:
n = int(input())
data = [[[0 for i in range(10)] for j in range(3)] for k in range(4)]

for i in range(n):
	b,f,r,v = [int(s) for s in input().split(' ')]
	data[b-1][f-1][r-1] += v

while data:
	building = data.pop(0)
	for floor in building:
		rooms = ' '.join([str(room) for room in floor])
		print(rooms)
	if data:
		print('####################')

Submission status: WA: Presentation Error

Solution code:
n = int(input())
cnt = [[[0 for _ in range(10)] for _ in range(3)] for _ in range(4)]

for _ in range(n):
  b, f, r, v = map(int, input().split())
  cnt[b-1][f-1][r-1] += v

for i in range(4):
  for j in range(3):
    print(' '.join(map(str, cnt[i][j])))

  if i != 3:
    print('#'*20)

Submission status: WA: Presentation Error

Solution code:

M1 = [[0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0]]
M2 = [[0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0]]
M3 = [[0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0]]
M4 = [[0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0]]

n = int(input())
a = []
for i in range(n):
    b = [int(i) for i in input().split()]
    a.append(b)

for j in a:
    if j[0] == 1:
        M1[j[1]-1][j[2]-1] += j[3]
    elif j[0] == 2:
        M2[j[1]-1][j[2]-1] += j[3]
    elif j[0] == 3:
        M3[j[1]-1][j[2]-1] += j[3]
    else:
        M4[j[1]-1][j[2]-1] += j[3]



for N in M1:
    print(' '.join(map(str, N)))
print("####################")
for N in M2:
    print(' '.join(map(str, N)))
print("####################")
for N in M3:
    print(' '.join(map(str, N)))
print("####################")
for N in M4:
    print(' '.join(map(str, N)))

Submission status: WA: Presentation Error

Solution code:
n=int(input())
nyukyo=[list(map(int, input().split())) for i in range(n)]
bld=[[[0 for i in range(10)] for j in range(3)] for k in range(4)]

for ny in nyukyo:
    bld[ny[0]-1][ny[1]-1][ny[2]-1]+=ny[3]

for i,b in enumerate(bld):
    for f in b:
        print(*f)
    if i != 3:
        print("####################")

Submission status: WA: Presentation Error

Solution code:
num = [[[0 for i in range(10)] for j in range(3)] for k in range(4)]
b, f, r, v, n, x, y, z  = 0, 0, 0, 0, 0, 0, 0, 0
n = int(input())
for i in range(n):
	b, f, r, v = list(map(int, input().split()))
	num[b - 1][f - 1][r - 1] = v
for i in range(4):
	if y >= 1:
		z = 0
		y = 0
		x += 1
		print()
		print('####################')
	for i in range(3):
		if z >= 1:
			z = 0
			y += 1
			print('')
		for i in range(10):
			print(num[x][y][z], end = ' ')
			z += 1

Submission status: WA: Presentation Error

Solution code:
num = [[[0 for i in range(10)] for j in range(3)] for k in range(4)]
b, f, r, v, n, x, y, z  = 0, 0, 0, 0, 0, 0, 0, 0
n = int(input())
for i in range(n):
	b, f, r, v = list(map(int, input().split()))
	num[b - 1][f - 1][r - 1] = v
for i in range(4):
	if y >= 1:
		z = 0
		y = 0
		x += 1
		print()
		print('####################')
	for i in range(3):
		if z >= 1:
			z = 0
			y += 1
			print('')
		for i in range(10):
			print('', num[x][y][z], end = '')
			z += 1

Submission status: WA: Presentation Error

Solution code:
data = [[[0 for i in range(10)] for j in range(3)] for h in range(4)]
n = int(input())
for o in range(n):
    a = input().split()
    b = int(a[0])
    f = int(a[1])
    r = int(a[2])
    v = int(a[3])
    data[b - 1][f - 1][r - 1] = v
    count = 0
    counta = 0
for c in data:
    for d in c:
        for e in d:
            print(e, end='')
            count += 1
            counta += 1
        if count == 10:
            print()
            count = 0
        if counta == 30 or counta==60 or counta ==90:
            print('#'*20)

Submission status: WA: Presentation Error

Solution code:
data = [[[0 for i in range(10)] for j in range(3)] for h in range(4)]
n = int(input())
for o in range(n):
    a = input().split()
    b = int(a[0])
    f = int(a[1])
    r = int(a[2])
    v = int(a[3])
    data[b - 1][f - 1][r - 1] = v
    count = 0
    counta = 0
for b in range(4):
    for f in range(3):
        for r in range(10):
            print(' ',data[b][f][r],end='')
        print()
    if b<3:
        print('#'*20)

Submission status: WA: Presentation Error

Solution code:
N = int(input())
residents = [[["0" for rooms in range(10)]for floor in range(3)]for builds in range(4)]

for i in range(N):
    b,f,r,v = list(map(int, input().split()))
    new_number = int(residents[b-1][f-1][r-1])+ v
    residents[b-1][f-1][r-1] = str(new_number)

for buils_num in range(4):
    for floor_num in range(3):
        print(' '.join(residents[buils_num][floor_num]))
    if buils_num < 3:
        print('#'*20)

Submission status: WA: Presentation Error

Solution code:
idx = int(input())
in_dict = {}

for i in range(idx):
    b, f, r, v = (int(x) for x in input().split())
    b -= 1
    f -= 1
    r -= 1
    in_dict[(b,f,r)] = in_dict.get((b,f,r),0) + v

for b in range(4):
    for f in range(3):
        for r in range(10):
            print(in_dict.get((b,f,r),0), end="")
        print("\n", end="")
    if b in range(3):print("#"*20)

Submission status: WA: Presentation Error

Solution code:
rooms = []
rooms.append([['0' for i in range(10)] for j in range(3)])
rooms.append([['0' for i in range(10)] for j in range(3)])
rooms.append([['0' for i in range(10)] for j in range(3)])
rooms.append([['0' for i in range(10)] for j in range(3)])

num = int(raw_input())
for i in range(num):
    b,f,r,v = map(int, raw_input().split())
    rooms[b-1][f-1][r-1] = str(v)

for number, i in enumerate(rooms):
    for j in i: 
        print(' '.join(j))
    if len(rooms) - 1 > number:
        print('####################')

Submission status: WA: Presentation Error

Solution code:
rooms = []
rooms.append([[0 for i in range(10)] for j in range(3)])
rooms.append([[0 for i in range(10)] for j in range(3)])
rooms.append([[0 for i in range(10)] for j in range(3)])
rooms.append([[0 for i in range(10)] for j in range(3)])

num = int(raw_input())
for i in range(num):
    b,f,r,v = map(int, raw_input().split())
    rooms[b-1][f-1][r-1] += v

for number, room in enumerate(rooms):
    for row in room:
        for r in row:
            print "%d" % r,
        print "\n",
    if len(rooms) - 1 > number:
        print('####################')

Submission status: WA: Presentation Error

Solution code:
rooms = []
rooms.append([[0 for i in range(10)] for j in range(3)])
rooms.append([[0 for i in range(10)] for j in range(3)])
rooms.append([[0 for i in range(10)] for j in range(3)])
rooms.append([[0 for i in range(10)] for j in range(3)])

num = int(raw_input())
for i in range(num):
    b,f,r,v = map(int, raw_input().split())
    rooms[b-1][f-1][r-1] += v

for number, room in enumerate(rooms):
    for row in room:
        print "",
        for r in row:
            print "%d" % r,
        print "\n",
    if len(rooms) - 1 > number:
        print('####################')

Submission status: WA: Presentation Error

Solution code:
a=[int('0') for i in range(10)]
w=["#" for i in range(20)]
z=[]
for i in range(15):
    z+=[a]
    if i == 3 or i== 7 or i== 11:
        z+=[w]
x=[[[0 for i in range(10)] for k in range(3)] for j in range(4)]
n=int(input())
for i in range(n):
    b,f,r,v=map(int,input().split())
    x[b-1][f-1][r-1]+=v

for i in range(4):
    for k in range(3):
        print(" ".join(str(x[i][k][o]) for o in range(10)))
    if i ==0 or i ==1 or i==2:
        print("#"*20)

Submission status: WA: Presentation Error

Solution code:
class OfficialHouse:
    def __init__(self):
        self.bill = [[[0,0,0,0,0,0,0,0,0,0],
                      [0,0,0,0,0,0,0,0,0,0],
                      [0,0,0,0,0,0,0,0,0,0]],
                     [[0,0,0,0,0,0,0,0,0,0],
                      [0,0,0,0,0,0,0,0,0,0],
                      [0,0,0,0,0,0,0,0,0,0]],
                     [[0,0,0,0,0,0,0,0,0,0],
                      [0,0,0,0,0,0,0,0,0,0],
                      [0,0,0,0,0,0,0,0,0,0]],
                     [[0,0,0,0,0,0,0,0,0,0],
                      [0,0,0,0,0,0,0,0,0,0],
                      [0,0,0,0,0,0,0,0,0,0]]]


    def input_bfrv(self, b, f, r, v):
        self.bill[b-1][f-1][r-1] += v

    def result(self):
        for i in range(4):
            for j in range(3):
                print(' '.join(map(str, self.bill[i][j])))
            if i != 3:
                print("####################")

oh = OfficialHouse()

n = int(input())

for i in range(n):
   bfrv = input().split()
   b = int(bfrv[0])
   f = int(bfrv[1])
   r = int(bfrv[2])
   v = int(bfrv[3])

   oh.input_bfrv(b, f, r, v)

oh.result()

Submission status: WA: Presentation Error

Solution code:
nyukyo = [[[0 for i in range(10)] for m in range(3)] for n in range(4)]
num = int(input())
for i in range(num):
    handan = input().split()
    handan = list(map(int, handan))
    nyukyo[handan[0]-1][handan[1]-1][handan[2]-1] += handan[3]

for m in nyukyo[0]:
    t = list(map(str, m))
    print(" ".join(t))
print("#"*20)
for m in nyukyo[1]:
    t = list(map(str, m))
    print(" ".join(t))
print("#"*20)
for m in nyukyo[2]:
    t = list(map(str, m))
    print(" ".join(t))
print("#"*20)
for m in nyukyo[3]:
    t = list(map(str, m))
    print(" ".join(t))

Submission status: WA: Presentation Error

Solution code:
box = [[[0]*10 for i in range(3)] for j in range(4)]
num = int(input())
for i in range(num):
    temp = list(map(int, input().split()))
    box[temp[0]-1][temp[1]-1][temp[2]-1] += temp[3]
    if box[temp[0]-1][temp[1]-1][temp[2]-1] < 0: box[temp[0]-1][temp[1]-1][temp[2]-1] = 0

for i in range(len(box)):
    [print(" ".join(map(str, box[i][j]))) for j in range(len(box[i]))]
    if i != 3:
        print("####################")

Submission status: WA: Presentation Error

Solution code:
a = [[[0 for i in range(10)] for j in range(3)] for k in range(4)]
e = '#' * 20
n = int(input())
for i in range(n):
    b,f,r,v = [int(i) for i in input().split()]
    a[b - 1][f - 1][r - 1] += v
for i in range(4):
        for j in range(3):
            print(' '.join(map(str,a[i][j])))
        if(i != 3):
            print(e)

Submission status: WA: Presentation Error

Solution code:
def Input(b, f, rn, h):
    A[b][f][rn] += h

def Output():
    for b in range(4):
        for f in range(4):
            for rn in range(10):
                if b == 3 and f == 3:
                    break
                if f < 3:
                    print(' ' + str(A[b][f][rn]), end = '')
                else:
                    print('##', end = '')
            print()

n = int(input())

A = [[[0 for rn in range(10)] for f in range(3)] for b in range(4)]

for idx in range(n):
    R = input().split()
    B = int(R[0]) - 1
    F = int(R[1]) - 1
    RN = int(R[2]) - 1
    H = int(R[3])
    Input(B, F, RN, H)
Output()