Problem:


Score : 100 points

Problem Statement

We have a grid with H rows and W columns, where all the squares are initially white.

You will perform some number of painting operations on the grid.
In one operation, you can do one of the following two actions:

Choose one row, then paint all the squares in that row black.

Choose one column, then paint all the squares in that column black.

At least how many operations do you need in order to have N or more black squares in the grid?
It is guaranteed that, under the conditions in Constraints, having N or more black squares is always possible by performing some number of operations.

Constraints

1 \leq H \leq 100

1 \leq W \leq 100

1 \leq N \leq H \times W

All values in input are integers.

Input

Input is given from Standard Input in the following format:

H
W
N

Output

Print the minimum number of operations needed.

Sample Input 1

3
7
10

Sample Output 1

2

You can have 14 black squares in the grid by performing the "row" operation twice, on different rows.

Sample Input 2

14
12
112

Sample Output 2

8

Sample Input 3

2
100
200

Sample Output 3

2



Sample input:
3
7
10


Sample output:
2

Submission status: Accepted

Solution code:
from collections import defaultdict,deque
import sys,heapq,bisect,math,itertools,string,queue,copy,time
sys.setrecursionlimit(10**8)
INF = float('inf')
mod = 10**9+7
eps = 10**-7
def inp(): return int(sys.stdin.readline())
def inpl(): return list(map(int, sys.stdin.readline().split()))
def inpl_str(): return list(sys.stdin.readline().split())

H = inp()
W = inp()
N = inp()

x = max(H,W)
print((N-1)//x+1)

Submission status: Accepted

Solution code:
h, w, n = [int(input()) for _ in range(3)]
print((n-1)//max(h, w)+1)

Submission status: Accepted

Solution code:
import sys,collections as cl,bisect as bs
sys.setrecursionlimit(100000)
input = sys.stdin.readline
mod = 10**9+7
Max = sys.maxsize
def l(): #intのlist
    return list(map(int,input().split()))
def m(): #複数文字
    return map(int,input().split())
def onem(): #Nとかの取得
    return int(input())
def s(x): #圧縮
    a = []
    aa = x[0]
    su = 1
    for i in range(len(x)-1):
        if aa != x[i+1]:
            a.append([aa,su])
            aa = x[i+1]
            su = 1
        else:
            su += 1
    a.append([aa,su])
    return a
def jo(x): #listをスペースごとに分ける
    return " ".join(map(str,x))
def max2(x): #他のときもどうように作成可能
    return max(map(max,x))
def In(x,a): #aがリスト(sorted)
    k = bs.bisect_left(a,x)
    if k != len(a) and a[k] ==  x:
        return True
    else:
        return False
"""
def nibu(x,n,r):
    ll = 0
    rr = r
    while True:
        mid = (ll+rr)//2

    if rr == mid:
        return ll
    if (ここに評価入れる):
        rr = mid
    else:
        ll = mid+1
"""

h = onem()
w = onem()

ma = max(h,w)

p = onem()

print(-(-p//ma))

Submission status: Accepted

Solution code:
#!usr/bin/env python3
from collections import defaultdict,deque
from heapq import heappush, heappop
from itertools import permutations
import sys
import math
import bisect
def LI(): return [int(x) for x in sys.stdin.readline().split()]
def I(): return int(sys.stdin.readline())
def LS():return [list(x) for x in sys.stdin.readline().split()]
def S():
    res = list(sys.stdin.readline())
    if res[-1] == "\n":
        return res[:-1]
    return res
def IR(n):
    return [I() for i in range(n)]
def LIR(n):
    return [LI() for i in range(n)]
def SR(n):
    return [S() for i in range(n)]
def LSR(n):
    return [LS() for i in range(n)]

sys.setrecursionlimit(1000000)
mod = 1000000007

def solve():
    h,w,n = IR(3)
    k = max(h,w)
    print(math.ceil(n/k))
    return

#Solve
if __name__ == "__main__":
    solve()

Submission status: Accepted

Solution code:
import sys, re
from collections import deque, defaultdict, Counter
from math import ceil, sqrt, hypot, factorial, pi, sin, cos, radians
from itertools import accumulate, permutations, combinations, product
from operator import itemgetter, mul
from copy import deepcopy
from string import ascii_lowercase, ascii_uppercase, digits
from bisect import bisect

def input(): return sys.stdin.readline().strip()
def INT(): return int(input())
def MAP(): return map(int, input().split())
def LIST(): return list(map(int, input().split()))
sys.setrecursionlimit(10 ** 9)
INF = float('inf')
MOD = 10 ** 9 + 7

H = INT()
W = INT()
N = INT()

print(ceil(N/max(H,W)))

Submission status: Accepted

Solution code:
h = int(input())
w = int(input())
n = int(input())
print((n - 1) // max(h, w) + 1)

Submission status: Accepted

Solution code:
h=int(input())
w=int(input())
n=int(input())
print((n-1)//max(h,w)+1)

Submission status: Accepted

Solution code:
#
# 　　  ⋀_⋀　 
#　　  (･ω･)  
# .／ Ｕ ∽ Ｕ＼
#  │＊　合　＊│
#  │＊　格　＊│ 
#  │＊　祈　＊│ 
#  │＊　願　＊│ 
#  │＊　　　＊│ 
#      ￣
#
import sys
sys.setrecursionlimit(10**6)
input=sys.stdin.readline
from math import floor,ceil,sqrt,factorial,hypot,log #log2ないｙｐ
from heapq import heappop, heappush, heappushpop
from collections import Counter,defaultdict,deque
from itertools import accumulate,permutations,combinations,product,combinations_with_replacement
from bisect import bisect_left,bisect_right
from copy import deepcopy
inf=float('inf')
mod = 10**9+7
def pprint(*A): 
    for a in A:     print(*a,sep='\n')
def INT_(n): return int(n)-1
def MI(): return map(int,input().split())
def MF(): return map(float, input().split())
def MI_(): return map(INT_,input().split())
def LI(): return list(MI())
def LI_(): return [int(x) - 1 for x in input().split()]
def LF(): return list(MF())
def LIN(n:int): return [I() for _ in range(n)]
def LLIN(n: int): return [LI() for _ in range(n)]
def LLIN_(n: int): return [LI_() for _ in range(n)]
def LLI(): return [list(map(int, l.split() )) for l in input()]
def I(): return int(input())
def F(): return float(input())
def ST(): return input().replace('\n', '')
def main():
    H=I()
    W=I()
    N=I()
    print(ceil(N/max(H,W)))
if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
h = int(input())
w = int(input())
n = int(input())

mx = max(h, w)
res = 0
cnt = 0
while cnt < n:
    res += 1
    cnt += mx
print(res)

Submission status: Accepted

Solution code:
h=int(input())
w=int(input())
n=int(input())
print(min(0--n//w,0--n//h))

Submission status: Accepted

Solution code:
import sys
sys.setrecursionlimit(10**9)
INF=10**18
MOD=10**9+7
def input(): return sys.stdin.readline().rstrip()

def main():
    H=int(input())
    W=int(input())
    N=int(input())
    print(-(-N//max(H,W)))

if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
import bisect
import cmath
import heapq
import itertools
import math
import operator
import os
import random
import re
import string
import sys
from collections import Counter, deque, defaultdict
from copy import deepcopy
from decimal import Decimal
from fractions import gcd
from functools import lru_cache, reduce
from operator import itemgetter, mul, add, xor

import numpy as np

if os.getenv("LOCAL"):
    sys.stdin = open("_in.txt", "r")

sys.setrecursionlimit(10 ** 9)
INF = float("inf")
IINF = 10 ** 18
MOD = 10 ** 9 + 7
# MOD = 998244353

h, w, n = [int(sys.stdin.buffer.readline()) for _ in range(3)]
ans = math.ceil(n / max(h, w))
print(ans)

Submission status: Runtime Error

Solution code:
a, b, n = map(int, input().split())
print(n // a + 1 if a >= b else n // b + 1)

Submission status: Runtime Error

Solution code:
h,w,m = map(int,input().split())
total = 0
if h < w:
  h,w = w,h
for i in range(w):
  total += h
  if total >= m:
    print(i+1)

Submission status: Runtime Error

Solution code:
import math
h,w,n=map(int,input().split())
print(math.ceil(n/max(h,w)))

Submission status: Runtime Error

Solution code:
# A - Painting
import sys

debug = lambda message: sys.stderr.write(message)


def main():
    H, W, N = map(int, open(0))
    debug(max(H, W))
    print((N + max(H, W) - 1) // max(H, W))


if __name__ == "__main__":
    main()

Submission status: Runtime Error

Solution code:
h = int(input())
w = int(input())
n = int(input())

if h < w:
    if n % w == 0:
        print(n % w)
    else:
        print(n % w + 1)
if n % h == 0:
        print(n % h)
    else:
        print(n % h + 1)

Submission status: Runtime Error

Solution code:
n,k,s = list(map(int, input().split()))
if s<10**9:
    ans=[s]*k+[s+1]*(n-k)
else:
    ans=[s]*k+[1]*(n-k)
print(*ans)

Submission status: Runtime Error

Solution code:
import math
H=input()
W=input()
N=input()
m=max(H,W)
print(math.ceil(N/m))

Submission status: Runtime Error

Solution code:
H,W,N=map(int,input().split())
B=max(H,W)
ans=(N+B-1)//B
print(ans)

Submission status: Runtime Error

Solution code:
def keyence20_a():
    H, W, N = map(int, readlines())
    lg = max(H, W)
    ans = (N + lg - 1) // lg
    print(ans)

keyence20_a()

Submission status: Runtime Error

Solution code:
n = int(input())
x, l = [0]*n, [0]*n
for i in range(n):
    x[i], l[i] = map(int, input().split())
hoge = []
for i in range(n):
    hoge.append(x+l)
t = 0
for i in range(n):
    if t < hoge[i]:
        ans += 1
        t = hoge[i]
print(ans)

Submission status: Runtime Error

Solution code:
H = int(input())
W = int(input())
N = int(input())

cnt = 0
while paint >= N:
	paint += max(H,W)
	cnt += 1
    
print(cnt)

Submission status: Runtime Error

Solution code:
H = int(input())
W = int(input())
N = int(input())
for i in range(min(H,W)):
    N -= max(H, W):
    if N <= 0:
        print(i+1)

Submission status: Runtime Error

Solution code:
h = input()
w = input()
n = input()
h = max(h,w)
print(n // h)

Submission status: Runtime Error

Solution code:
N = int(input())
X = []
for i in range(N):
    x,l=map(int,input().split())
    X.append([x-l,x+l])

X = sorted(X, key=lambda x:x[1])
a = X[0][0]-1
ans = 0
for i in range(N):
    if X[i][0] >= a:
        a =X[i][1]
        ans +=1
    else:
        continue
print(ans)

Submission status: Runtime Error

Solution code:
N = int(input())

arms_range_list =[]
for _ in range(N):
    X, L = map(int, input().split())
    arms_range_list.append((X-L, X+L))

arms_range_list = sorted(arms_range_list)


count = 0
max_arm_position_now = -float('inf')
for i in range(N):
    min_arm_position_next = arms_range_list[i][0]
    if min_arm_position_next >= max_arm_position_now:
        max_arm_position_now = arms_range_list[i][1]
        count += 1


print(int(count))

Submission status: Runtime Error

Solution code:
N = int(input())

arm = {}
for i in range(N):
    X, L = map(int, input().split())
    arm[X - L] = X + L

arm = sorted(arm.items(), key=lambda x: x[1])

count = 0
i = arm[0][0]
for item in arm:
    if item[0] >= i:
        i = item[1]
        count += 1

print(count)

Submission status: Runtime Error

Solution code:
    h=int(input())
    w=int(input())
    n=int(input())
     
    if h>w:
      if n%h==0:
        ct=n//h
      else:
        ct=n//h+1
    else:
      if n%w==0:
        ct=n//w
      else:
        ct=n//w+1
    print(ct)

Submission status: Runtime Error

Solution code:
h=int(input())
w=int(input())
n=int(input())
 
if h>w:
  if n%h==0:
    ct=n//h
  else:
    ct=n//h+1
else:
  if n%w=0:
    ct=n//w
  else:
    ct=n//w+1
print(ct)

Submission status: Runtime Error

Solution code:
h = input()
w = input()
n = input()
if h < w:
    h = w
print(int(n / h))

Submission status: Runtime Error

Solution code:
h = input()
w = input()
n = input()
if h < w:
    h = w
print(int(n / h)

Submission status: Runtime Error

Solution code:
h=int(input())
w=int(input())
n=int(input())
s=[[h*w for i in range(h)] for j in range(w)]
li=[]
for i in range(w):
  for j in range(h):
    s[i][j]=w*i+h*j-i*j
    if s[i][j]>=n:
      li.append(i+j)
print(min(li))

Submission status: Runtime Error

Solution code:
h=int(input())
w=int(input())
n=int(input())
s=[[n for i in range(h)] for j in range(w)]
li=[]
for i in range(w):
  for j in range(h):
    s[i][j]=w*i+h*j-i*j
    if s[i][j]>=n:
      li.append(i+j)
print(min(li))

Submission status: Runtime Error

Solution code:
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		sc.close();
	}
}

Submission status: Runtime Error

Solution code:
H = input()
W = input()
N = input()
M = max(H, W)
if N % M == 0:
  print(N // M)
else:
  print((N // M) + 1)

Submission status: Runtime Error

Solution code:
import math
a=int(input())
b=int(input())
x=int(input())
print(math.ceil(x/(max(a,b)))

Submission status: Runtime Error

Solution code:
H=input()
W=input()
N=input()

H=int(H)
W=int(W)
N=int(N)

if H*W=N:

Submission status: Runtime Error

Solution code:
def main(h, w, n)
  n_push = []

  for n_h in range(h):
    for n_w in range(w):
      n_tmp = n_h*w + n_w*h - (n_h*n_w)

      if n_tmp>n_push:
          n_push.append = n_h + n_w

  return min(n_push)

Submission status: Runtime Error

Solution code:
h = 14
w = 12
n = 112

n_push = []

for n_h in range(h):
  for n_w in range(w):
    n_tmp = n_h*w + n_w*h - (n_h*n_w)
    
    if n_tmp>n_push:
	    n_push.append = n_h + n_w
    
print min(n_push)

Submission status: Runtime Error

Solution code:
H = int(input())
W = int(input())
N = int(input())
import math
print(int(math.ceil(N // max(H, W)))

Submission status: Runtime Error

Solution code:
H,W,N = [int(input()) for i in range(3)]
o = []
a = N / o
for o in range(1,10000):
  if H < W and a <= W:
    print(o)
    break
  elif H> W and a<=H:
    print(o)
    break

Submission status: Runtime Error

Solution code:
H,W,N = [int(input()) for i in range(3)]
a = N / o
for o in range(1,10000):
  if H < W and a <= W:
    print(o)
    break
  elif H> W and a<=H:
    print(o)
    break

Submission status: Runtime Error

Solution code:
H,W,N = [int(input()) for i in range(3)]
o = int()
a = N / o
for o in range(1,10000):
  if H < W and a <= W:
    print(o)
    break
  elif H> W and a<=H:
    print(o)
    break

Submission status: Runtime Error

Solution code:
H,W,N = [int(input()) for i in range(3)]
o = 1
a = N / o
while a <= H or W:
  if H < W and a > W:
      o += 1
  else W < H and a > H:
      o += 1
print(o)

Submission status: Runtime Error

Solution code:
H,W,N = [int(input()) for i in range(3)]
o = 1
a = N / o
while a <= H or W:
  if H < W and a > W:
      o += 1
  elif W < H a > H:
      o += 1
print(o)

Submission status: Runtime Error

Solution code:
H,W,N = [int(input()) for i in range(3)]
n = 1
a = n * W
b = n * H
while a or b > N:
  if H < W and a > N:
    print(n)
	else:
      n += 1
  if W < H and b > N:
    print(n)
    else:
      n += 1

Submission status: Runtime Error

Solution code:
H,W,N = [int(input()) for i in range(3)]
a = N / W
b = N / H
if H < W :
  print(a)
  else:
    print(b)

Submission status: Runtime Error

Solution code:
H,W,N = [int(input()) for i in range(3)]
a = H / W
b = W / H
if H < W :
  print(b)
  else:
    print(a)

Submission status: Runtime Error

Solution code:
H,W,N = [int(input()) for i in range(3)]
a = H % W
b = W % H
if H < W :
  print(b)
  else:
    print(a)

Submission status: Runtime Error

Solution code:
h = int(input())
w = int(input())
n = int(input())

ans = 0
sum = 0

while(sum < n):
  if h >= w :
    sum += h
    ans += 1
    w -= 1
  else :
    sum += w
    asn += 1
    h -= 1
print(ans)

Submission status: Runtime Error

Solution code:
H = input()
W = input()
N = input()

ans = 0

for i in range(H):
  if (i+1)*W < N:
    ans += 1

print(ans+1)

Submission status: Runtime Error

Solution code:
H = input()
W = input()
N = input()

ans = 0

for i in range(H):
  if (i+1)*W < N:
    ans += 1
  else:
    break

print(ans+1)

Submission status: Runtime Error

Solution code:
H = input()
W = input()
N = input()

ans = 0

for i in range(H):
  if (i+1)*W < N:
    ans += 1
  else :
    break

print(ans)

Submission status: Runtime Error

Solution code:
class Robot:
    def __init__(self, x, l):
        self.x = x
        self.l = l
    
    def __lt__(self, other):
        return self.x < other.x

n = int(input().rstrip())
robos = [None] * n

for i in range(n):
    line = input().rstrip().split(' ')
    robos[i] = Robot(int(line[0]), int(line[1]))

robos.sort()

i = 0
ans = 0
while i < n:
    s = robos[i].x
    r = robos[i].l
    i += 1
    while i < n and robos[i].x <= s + r:
        i += 1
    
    p = robos[i - 1].x
    while i < n and robos[i].x <= p + robos[i].l:
        i += 1
    
    ans += 1

print(ans)

Submission status: Runtime Error

Solution code:
h = input()
w = input()
n = input()
count = 0
if h < w:
  a = w
  b = h
else:
  a = h
  b = w
 
x = int(n/a)
if n%a != 0:
  x += 1
print(x)

Submission status: Runtime Error

Solution code:
h = input()
w = input()
n = input()
count = 0
if h < w:
  a = w
  b = h
else:
  a = h
  b = w
 
x = int(n/a)
if n%a != 0:
  x += 1
return x

Submission status: Runtime Error

Solution code:
N = int(input())
H, W, N = [int(input()) for _ in range(N)]
print(min((N+H-1)//H, (W+W-1)//W))

Submission status: Runtime Error

Solution code:
H,W,N=map(int,input().split())
K=max(H,W)
print(-(-N//K))

Submission status: Runtime Error

Solution code:
N = int(input())
A = list(map(int,input().split()))
B = list(map(int,input().split()))
INF = N**3
max_ab = max(max(A),max(B))+1
dp = [[INF] * max_ab for _ in range(2**N)]
dp[0][0]=0
for i in range(2**N):
  done = 0
  for j in range(N):
    if (i>>j)&1:
      done += 1
  
  for right_end in range(max_ab):
    if dp[i][right_end]==INF:
      continue
    for add_last in range(N):
      if (i>>add_last)&1:
        continue
      if abs(add_last-done)%2==0:
        add_last_surface = A[add_last]
      else:
        add_last_surface = B[add_last]
        
      if right_end>add_last_surface:
        continue
        
      num = 0
      for k in range(add_last):
        if (i>>k)&1==0:
          num+=1
          
      dp[i|1<<add_last][add_last_surface]=min(dp[i|1<<add_last][add_last_surface],
                                              dp[i][right_end]+num)
      
ans = min(dp[-1])
if ans==INF:
  print(-1)
else:
  print(ans)

Submission status: Runtime Error

Solution code:
h = int(input())
w = int(input())
n = int(input())

print(max(h, x)%n)

Submission status: Runtime Error

Solution code:
h = list(input())
w = list(input())
n = list(input())

print(n//max(h,w))

Submission status: Runtime Error

Solution code:
#!/usr/bin/env python3
from collections import defaultdict,deque
from heapq import heappush, heappop
from bisect import bisect_left, bisect_right
import sys, random, itertools, math
sys.setrecursionlimit(10**5)
input = sys.stdin.readline
sqrt = math.sqrt
def LI(): return list(map(int, input().split()))
def LF(): return list(map(float, input().split()))
def LI_(): return list(map(lambda x: int(x)-1, input().split()))
def II(): return int(input())
def IF(): return float(input())
def LS(): return list(map(list, input().split()))
def S(): return list(input().rstrip())
def IR(n): return [II() for _ in range(n)]
def LIR(n): return [LI() for _ in range(n)]
def FR(n): return [IF() for _ in range(n)]
def LFR(n): return [LI() for _ in range(n)]
def LIR_(n): return [LI_() for _ in range(n)]
def SR(n): return [S() for _ in range(n)]
def LSR(n): return [LS() for _ in range(n)]
mod = 1000000007
inf = 1e10

#solve
def solve():
    h, w, n = IR(3)
    print(min(n // h + (n % h > 0), n // w + (n % w > 0))
    return


#main
if __name__ == '__main__':
    solve()

Submission status: Runtime Error

Solution code:
#!/usr/bin/env python3
from collections import defaultdict,deque
from heapq import heappush, heappop
from bisect import bisect_left, bisect_right
import sys, random, itertools, math
sys.setrecursionlimit(10**5)
input = sys.stdin.readline
sqrt = math.sqrt
def LI(): return list(map(int, input().split()))
def LF(): return list(map(float, input().split()))
def LI_(): return list(map(lambda x: int(x)-1, input().split()))
def II(): return int(input())
def IF(): return float(input())
def LS(): return list(map(list, input().split()))
def S(): return list(input().rstrip())
def IR(n): return [II() for _ in range(n)]
def LIR(n): return [LI() for _ in range(n)]
def FR(n): return [IF() for _ in range(n)]
def LFR(n): return [LI() for _ in range(n)]
def LIR_(n): return [LI_() for _ in range(n)]
def SR(n): return [S() for _ in range(n)]
def LSR(n): return [LS() for _ in range(n)]
mod = 1000000007
inf = 1e10

#solve
def solve():
    h, w, n = LIR(3)
    print(min(n // h + (n % h > 0), n // w + (n % w > 0))
    return


#main
if __name__ == '__main__':
    solve()

Submission status: Runtime Error

Solution code:
print "3"

Submission status: Runtime Error

Solution code:
n,k,s = map(int,input().split())
ans = [s]*k + [(s%(10**6)+1) for i in range(n-k)]
 
print(" ".join(map(str,ans)))

Submission status: Runtime Error

Solution code:
n,k,s = [int(i) for i in input().split()]
 
ans_list = []
for i in range(n):
  if i < k:
    ans_list.append(str(s))
  else:
    ans_list.append(str(s+1))
    
print(*ans_list)

Submission status: Runtime Error

Solution code:
N, K, S = map(int, input().split())
print(*([S]*K + [S+1]*(N-K)))

Submission status: Runtime Error

Solution code:
H, W, N = int(input()) * 3
x = max(H, W)
print((N+x-1)//x)

Submission status: Runtime Error

Solution code:
n = int(input())
l = []
for _ in range(n):
  x,y = map(int, input().split())
  l.append([x+y,x-y])
l.sort()

temp = l[0][1]
count = n
i = 1
for i in range(1,n):
  if temp <= l[i][1]:
    pass
  else:
    temp = min(temp,l[i][1])
    count -= 1
print(count)

Submission status: Runtime Error

Solution code:
lengthNum, countNum, sumNum = map(int, input().split())

aryAns = []
tmp = lengthNum - countNum
tNum = 2 if sumNum == 1 else sumNum-1
aryAns = [sumNum]*countNum + [sumNum-1]*tmp

print(" ".join([str(x) for x in aryAns]))

Submission status: Runtime Error

Solution code:
n = int(input())
arr = [list(map(int,input().split())) for i in range(n)]
arr.sort()
outcount = 0
#リストの数を減らすと最後の２つがぶつかってた場合が判定できない
#時間がかかりすぎ1回okだったところは次はパスしたい
outnum = 0
def saiki():
    global outcount
    global outnum
    for i in range(outnum, len(arr)-2):
        if arr[i][0] + arr[i][1] > arr[i+1][0] - arr[i+1][1]:#アウトの条件
            outcount += 1
            outnum = i-1
            if [i+1][0] + arr[i+1][1] <= arr[i+2][0] - arr[i+2][1]:#1つあとのやつがぶつかってるか
                arr.pop(i)
            else:
                arr.pop(i + 1)
            return 'no'


while saiki() == 'no':
    saiki()

print(n - outcount)

Submission status: Runtime Error

Solution code:
N, K, S = map(int, input().split())

l = [S] + [0]*(K-1) + [S%10**9]*(N-K) #長さKで要素が全てSの列（条件満たすK通り）と長さNーKの適当な列で長さN列を生成

print(*l) #*lは標準出力時にはいれつの[]を出力しないため

Submission status: Runtime Error

Solution code:
import math

N = int(input())

li = []

for i in range(N):
    x, l = map(int, input().split())
    li.append([x-l,x+l])

li.sort(key=lambda x:x[1])
li.sort(key=lambda x:x[0])

ans = 0
t = 0 - 10**9 + 99
for i in range(N):
    if t <= li[i][0]:
        ans += 1
        t = li[i][1]

print(ans)

Submission status: Runtime Error

Solution code:
n, k, s = map(int, input().split())
mod = 10**9
l = [s]*k + [(s+1)%mod]*(n-k)
print(*l)

Submission status: Runtime Error

Solution code:
n, k, s = map(int, input().split())
A = [0]*n
for i in range(1, n+1):
    if i <= k:
        A[i] = s
    else:
        if s == 10**9:
          A[i] = 1
        else:
          A[i] = 10**9
print(*A)

Submission status: Runtime Error

Solution code:
h = int(input())
w = int(input())
n = int(input())

num1 = n/h
num2 = n/w

if not num1.is_integer():
  num1 = int(num1) + 1
  
if not num2.is_integer():
  num2 = int(num2) + 1
  
return min(num1, num2)

Submission status: Runtime Error

Solution code:
import sys
import math
read = sys.stdin.buffer.read
H, W, N = map(int, read().split('\n'))
m = max(H, W)
print(math.ceil(N / m))

Submission status: Runtime Error

Solution code:
def resolve():
    import sys
    import math
    H, W, N = map(int, sys.stdin.read().split('\n'))
    m = max(H, W)
    print(math.ceil(N / m))

resolve()

Submission status: Runtime Error

Solution code:
N = int(input().strip())
grid = []
for i in range(N):
    array = list(map(int, input().strip().split()))
    grid.append(array)
list_N = list(range(1,N+1))
grid.sort()
a = 0
count = 0
for j in range(N) :
  list_a = list(range(grid[j][0]-grid[j][1]+1, grid[j][0]+grid[j][1]-1))
  list_b = list(set(list_a) - set(list_N))
  if list_b == []:
    list_N = list(set(list_N) - set(list_a))
    count += 0
  else:
    count += 1
print(N - count)

Submission status: Runtime Error

Solution code:
N = int(input().strip())
grid = []
for i in range(N):
    array = list(map(int, input().strip().split()))
    grid.append(array)
list_N = list(range(1,N+1))
grid.sort()
a = 0
count = 0
for j in range(N) :
  list_a = list(range(grid[j][0]-grid[j][1]+1, grid[j][0]+grid[j][1]-1))
  list_b = list(set(list_a) - set(list_N))
  if list_b == []:
    list_N = list(set(list_N) - set(list_a))
    count += 0
  else:
    count += 1
print(count)

Submission status: Runtime Error

Solution code:
N, K, S = map(int, input().split())
arr = [1 if S > N else S + 1] * N
for i in range(K):
    arr[i] = S
print(arr)

Submission status: Runtime Error

Solution code:
N = int(input().strip())
grid = []
for i in range(N):
    array = list(map(int, input().strip().split()))
    grid.append(array)
list_N = list(range(1,N+1))
grid.sort()
a = 0
count = 0
for i in range(N) :
  list_a = list(range(grid[i][0]-grid[i][1]+1, grid[i][0]+grid[i][1]-1))
  list_b = list(set(list_a) - set(list_N))
  if list_b == []:
    list_N = list(set(list_N) - set(list_a))
    count += 0
  else:
    count += 1
print(count)

Submission status: Runtime Error

Solution code:
n = int(input())
l = []
for _ in range(n):
  A = list(map(int, input().split()))
  l.append(A)
  
l = sorted(l)
count = 0
count1 = 0
count2 = 0
for i in range(n-2):
  j = i + 1
  a = l[j][0]-l[j][1]
  b = l[j][0]+l[j][1]
  
  if l[j-1][0]+l[j-1][1] <= a and b <= l[j+1][0]-l[j+1][1]:
    count = count + 1
  if l[j-1][0]+l[j-1][1] >= a and b >= l[j+1][0]-l[j+1][1]:
    count1 = count1 + 1
  else:
    count2 = count2 + 1 

sum = count + count2/2
print(count+count1-1)

Submission status: Runtime Error

Solution code:
n,k,s = map(int,input().split())
a=0
b=0

list=[]

for i in range(k):
    list.append(s)

if len(list) < n:
    for i in range(n-len(list)):
        list.append(s-1)

for i in list:
    print(i,end=" ")

Submission status: Runtime Error

Solution code:
n, k, s = map(int, input().split())
 
ans = []
if k % 2 == 1:
  for _ in range(k):
    ans.append(s)
  while n > len(ans):
    if s == 1000000000:
      ans.append(999999999)
    else:
      ans.append(1000000000)
elif k == 0:
  while n > len(ans):
    if s == 1000000000:
      ans.append(999999999)
    else:
      ans.append(1000000000)
else:
  if s % 2 == 0:
    count = 1
    ans.append(s/2)
    ans.append(s/2)
    while n > count:
      ans.append(s/2)
      count += 1
    while n > len(ans):
      if s == 1000000000:
        ans.append(999999999)
      else:
        ans.append(1000000000)
  else:
    count = 1
    ans.append(1)
    ans.append(s-1)
    while n > count:
      ans.append(1)
      count += 1
      if n > count:
        break
      ans.append(s-1)
      count += 1
    while n > len(ans):
      if s == 1000000000:
        ans.append(999999999)
      else:
        ans.append(1000000000)
 
print(' '.join(map(str, ans)))

Submission status: Runtime Error

Solution code:
N,K,S = map(int,input().split())

if K == 0:
    anslist = []
    for i in range(N):
        ramdam = S+1 // (10**9)
        anslist.append(str(ramdam))
    print(" ".join(anslist))


elif N == K:
    anslist = [str(S) for i in range(N)]
    ansString = " ".join(anslist)
    print(ansString)
    exit()

else:
    if S%2 == 0:
        anslist = [str(S//2) for i in range(K+1)]
        for i in range(N - len(anslist)):
            ramdam = S+1 // 10**9
            anslist.append(str(ramdam))
        print(" ".join(anslist))

    elif S == 1:
        anslist = []
        for i in range(K):
            item = [str(1)]
            anslist.extend(item)
        for i in range(N - len(anslist)):
            ramdam = S+1 // 10**9
            anslist.append(str(ramdam))
        print(" ".join(anslist))


    else:
        anslist = []
        t = 1
        for i in range(K-1):
            item = [str(t),str(S-t)]
            anslist.extend(item)
            t += 1
        anslist.append(str(S))
        for i in range(N - len(anslist)):
            ramdam = S+1 // 10**9
            anslist.append(str(ramdam))
        print(" ".join(anslist))

Submission status: Runtime Error

Solution code:
N=int(input())
robbot=[input().split() for i in range(N)]
roba=[x[0] for x in robbot]
robb=[x[1] for x in robbot]
robc=list(map(int,roba))
robd=list(map(int,robb))
tas1=[x+y for (x,y) in zip (robc,robd)]
tas2=[x-y for (x,y) in zip (robc,robd)]
del tas2[0]
del tas1[-1]
tas3=[x-y for (x,y) in zip (tas2,tas1)]
tas4=[i for i in tas3 if i>=0 or i-1>=0]
print(len(tas4))

Submission status: Runtime Error

Solution code:
n=int(input())
x,l,dcnt=[0]*n,[0]*n,[0]*n
xlr=[[0]*2 for i in range(n)]
for i in range(n):
  a,b=map(int,input().split())
  x[i],l[i]=a,b
  xlr[i]=[a-b,a+b]
xlr.sort()
for i in range(n-1):
  chk=xlr[i][1]
  cnt=0
  for j in range(i+1,n):
    if xlr[j][0]<chk:
      cnt+=1
    else:
      break
  dcnt[i]=cnt
cnt=0
for i in range(1,n+1):
  if dcnt[n-i]>0:
    dcnt[n-i]=0
    cnt+=1
    for j in range(n-i):
      if dcnt[n-i-j-1]>j:
        dcnt[n-i-j-1]-=1
print(n-cnt)

Submission status: Runtime Error

Solution code:
N=int(input())
robbot=[input().split() for i in range(N)]
roba=[x[0] for x in robbot]
robb=[x[1] for x in robbot]
robc=list(map(int,roba))
robd=list(map(int,robb))
tas1=[x+y for (x,y) in zip (robc,robd)]
tas2=[x-y for (x,y) in zip (robc,robd)]
del tas2[0]
del tas1[-1]
tas3=[x-y for (x,y) in zip (tas2,tas1)]
tas4=[i for i in tas3 if i>=0]
print(len(tas4)+1)

Submission status: Runtime Error

Solution code:
N,K,S=map(int,input().split())
a=[]
if S%2==0:
  for i in range(K+1):
    a.append(S//2)
  if N-K-1>0:
    for i in range(N-K-1):
      a.append(S+1)
else:
  for i in range(K//2):
    a.append(1)
    a.append(S-1)
  a.append(1)
  if (K//2)*2+1<N:
    for i in range(N-(K//2)*2-1):
      a.append(S+1)
  
      
      
print(' '.join(map(str, a)))

Submission status: Runtime Error

Solution code:
N,K,S = map(int,input().split())
X = [1000000000 for _ in range(N)]
ans=""
for i in range (K):
    X[i]=S

print(*X)

Submission status: Runtime Error

Solution code:
n = int(input())
data = [[]]*(n+2)
data[0] = [-10**10, -10**10]
for i in range(1, n+1):
    x, l = map(int, input().split())
    data[i] = [x-l, x+l]
data[n+1] = [10**10, 10**10]
data.sort()
ans = n
if n == 2:
  if data[1][1] > data[2][0]:
    ans -= 1
else:
  for i in range(1, n):
    if data[i][1] > data[i+1][0] and data[i-1][1] > data[i][0]:
        ans -= 1
        data[i][0] = 0
        data[i][1] = 0
    
print(ans)

Submission status: Runtime Error

Solution code:
# -*- coding: utf-8 -*-

N = int(input())
X,L = [],[]

for _ in range(N):
    x,l = input().split()
    X.append(int(x))
    L.append(int(l))

i = 0
while i < len(X):
    
    if i>0 and X[i]-L[i] <= X[i-1]-L[i-1]:
        X.pop(i-1)
        L.pop(i-1)
    elif i<len(X)-1 and X[i]+L[i] >= X[i+1]+L[i+1]:
        X.pop(i+1)
        L.pop(i+1)
    else:
        i+=1

print(len(X))

Submission status: Runtime Error

Solution code:
H = int(input())
W = int(input())
N = int(input())
ans = 0

if W < H:
  A = H
elif H < W:
  A = W
while N >= 1:
  N -= A
  ans += 1

print(ans)

Submission status: Runtime Error

Solution code:
def read():
    h, w, n = input().splitlines()
    return h, w, n


def calc(h, w, n):
    if h>w:
        return int(n / h) + 1
    else:
        return int(n / w) + 1

def main():
    print(calc(*read()))


if __name__ == "__main__":
    main()