Skip to content

Commit

Permalink
Update Mosaic_Decoration_I.py
Browse files Browse the repository at this point in the history
  • Loading branch information
Sta8is authored Oct 16, 2021
1 parent 99fab3a commit 36003c1
Showing 1 changed file with 16 additions and 20 deletions.
36 changes: 16 additions & 20 deletions Mosaic_Decoration_I/Mosaic_Decoration_I.py
Original file line number Diff line number Diff line change
@@ -1,22 +1,18 @@
import math
inp = list(map(int,input().split()))
N_rows = inp[0]
M_col = inp[1]
R_rows = inp[2]
C_col = inp[3]
costs = []
for i in range(R_rows):
costs.append(input().split())
# print(costs)'
a = math.ceil(N_rows/R_rows)
b = math.ceil(M_col/C_col)
if (a*R_rows)%N_rows != 0:
pass
if (b*C_col)%M_col !=0:
pass
R_C_cost = 0
tiles = a*b
for i in costs:
for j in i:
R_C_cost+=int(j)
print(a*b*R_C_cost)
ts = inp[0]
cb = inp[1]
cp = inp[2]
# print(ts)
# print(cb)
res = 0
bt = 0
pt = 0
for i in range(ts):
tiles = list(map(int,input().split()))
bt = bt + tiles[0]
pt = pt + tiles[1]
tbt = math.ceil(bt/10)
tpt = math.ceil(pt/10)
print(tbt*cb+tpt*cp)

0 comments on commit 36003c1

Please sign in to comment.