Buggy python submission (verdict: Runtime Error):
m = int(input())
dc = [list(map(int, input().split())) for _ in range(m)]
 
d = [dc[i][0] for i in range(m)]
c = [dc[i][1] for i in range(m)]
  
cnt = sum(c) - 1
add_two = 0
 
for i in range(m):
  add_two += d[i] * c[i]
  if add_two % 9 == 0:
    cnt += add_to // 9
    add_two = 9
  else:
    cnt += add_two // 9
    add_two = add_two % 9
 
print(cnt)

Fixed submission:
#https://atcoder.jp/contests/ddcc2020-qual/submissions/8587774

M = int(input())
dc = [list(map(int, input().split())) for _ in range(M)]
 
d = [dc[i][0] for i in range(M)]
c = [dc[i][1] for i in range(M)]
 
ans = sum(c) - 1
s = 0
 
for i in range(M):
    s += c[i] * d[i]
    if s % 9 != 0:
        ans += s // 9
        s = s % 9
    else:
        ans += s//9 - 1 
        s = 9
print(ans)

Buggy python submission (verdict: Runtime Error):
m = int(input())
dc = [list(map(int, input().split())) for _ in range(m)]
 
d = [dc[i][0] for i in range(m)]
c = [dc[i][1] for i in range(m)]
  
cnt = sum(c) - 1
add_two = 0

for i in range(m):
  add_two += int(dc[i][0]) * int(dc[i][1])
  if add_two % 9 == 0:
    cnt += add_to // 9
    add_two = 9
  else:
    cnt += add_two // 9
    add_two = add_two % 9

print(cnt)

Fixed submission:
#https://atcoder.jp/contests/ddcc2020-qual/submissions/8587774

M = int(input())
dc = [list(map(int, input().split())) for _ in range(M)]
 
d = [dc[i][0] for i in range(M)]
c = [dc[i][1] for i in range(M)]
 
ans = sum(c) - 1
s = 0
 
for i in range(M):
    s += c[i] * d[i]
    if s % 9 != 0:
        ans += s // 9
        s = s % 9
    else:
        ans += s//9 - 1 
        s = 9
print(ans)

Buggy python submission (verdict: Runtime Error):
m = int(input())
dc = []

sum_c = 0
before_num = 0
add_two = 0
kuriage = 0

dc = [list(map(int, input().split())) for _ in range(m)]
 
d = [dc[i][0] for i in range(m)]
c = [dc[i][1] for i in range(m)]
  
cnt =sum(c) - 1

for i in range(m):
  add_two += int(dc[i][0]) * int(dc[i][1])
  if add_two % 9 == 0:
    cnt += add_to // 9
    add_two = 9
  else:
    cnt += add_two // 9
    add_two = add_two % 9

print(cnt)

Fixed submission:
#https://atcoder.jp/contests/ddcc2020-qual/submissions/8587774

M = int(input())
dc = [list(map(int, input().split())) for _ in range(M)]
 
d = [dc[i][0] for i in range(M)]
c = [dc[i][1] for i in range(M)]
 
ans = sum(c) - 1
s = 0
 
for i in range(M):
    s += c[i] * d[i]
    if s % 9 != 0:
        ans += s // 9
        s = s % 9
    else:
        ans += s//9 - 1 
        s = 9
print(ans)

Buggy python submission (verdict: Runtime Error):
import math

m = int(input())
dc = []

sum_c = 0
before_num = 0
add_two = 0
kuriage = 0

for i in range(m):
  array = list( map(int, input().split()) )
  dc.append(array)
  sum_c += int(dc[i][1])
  
cnt = sum_c - 1

for i in range(m):
  add_two += int(dc[i][0]) * int(dc[i][1])
  if add_two % 9 == 0:
    cnt += add_to // 9 - 1
    add_two = 9
  else:
    cnt += add_two // 9
    add_two = add_two % 9

print(cnt)

Fixed submission:
#https://atcoder.jp/contests/ddcc2020-qual/submissions/8587774

M = int(input())
dc = [list(map(int, input().split())) for _ in range(M)]
 
d = [dc[i][0] for i in range(M)]
c = [dc[i][1] for i in range(M)]
 
ans = sum(c) - 1
s = 0
 
for i in range(M):
    s += c[i] * d[i]
    if s % 9 != 0:
        ans += s // 9
        s = s % 9
    else:
        ans += s//9 - 1 
        s = 9
print(ans)

Buggy python submission (verdict: Runtime Error):
import math

m = int(input())
dc = []

sum_c = 0
before_num = 0
add_two = 0
kuriage = 0

for i in range(m):
  array = list( map(int, input().split()) )
  dc.append(array)
  sum_c += int(dc[i][1])
  
cnt = sum_c - 1

for i in range(m):
  add_two += int(dc[i][0]) * int(dc[i][1])
  if add_two % 9 == 0:
    cnt += add_to // 9
    add_two = 9
  else:
    cnt += add_two // 9
    add_two = add_two % 9

print(cnt)

Fixed submission:
#https://atcoder.jp/contests/ddcc2020-qual/submissions/8587774

M = int(input())
dc = [list(map(int, input().split())) for _ in range(M)]
 
d = [dc[i][0] for i in range(M)]
c = [dc[i][1] for i in range(M)]
 
ans = sum(c) - 1
s = 0
 
for i in range(M):
    s += c[i] * d[i]
    if s % 9 != 0:
        ans += s // 9
        s = s % 9
    else:
        ans += s//9 - 1 
        s = 9
print(ans)