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: Runtime Error

Solution code:
n=int(input())
l=[list(map(int,input().split())) for _ in range(n)]
l.sort()
t=0
for i in range(0,n-1):
    if l[i+1][0]-l[i][0]<l[i+1][1]+l[i][1]:
        del l[i+1]
        l=[[0,0]]+l
        t+=1
print(max(t,n-t))

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 > 0:
  N -= A
  ans += 1
  if N <= 0:
    break

print(ans)

Submission status: Runtime Error

Solution code:
H, W, N = map(int, open(0).read().split())
ans = 0

if H < W:
  A = W
elif W < H:
  A = H

while N >= 0:
    N -= A
    ans += 1
print(N, ans)

Submission status: Runtime Error

Solution code:
H, W, N = map(int, open(0).read().split())
ans = 0

if H < W:
  A = W
elif W < H:
  A = H

while N > 0:
    N -= A
    ans += 1
print(ans)

Submission status: Runtime Error

Solution code:
import sys

def main():
    n, k, s = [int(i) for i in raw_input().strip().split()]
    if s > (n - k):
        foo = [1] * (n - k) + [s - (n - k)] + [s] * (k - 1)
    elif n != s:
        foo = [s] * k + [n] * (n - k)
    else:
        foo = [s + 1] * n
    foo = [str(i) for i in foo]
    sys.stdout.write('%s\n' % ' '.join(foo))

if __name__ == '__main__':
    main()

Submission status: Runtime Error

Solution code:
H, W, N = map(int, open(0).read().split())
ans = 0

if H < W:
  A = W
elif W < H:
  A = H

while N >= 0:
    N -= A
    ans += 1
    if N <= 0:
      break
print(ans)

Submission status: Runtime Error

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

if S == 10**9:
    ans = [S]*K+[1]*(N-K)
else:
    ans = [S]*K+[S+1]*(N-K)
print(*ans)

Submission status: Runtime Error

Solution code:
N=int(input())
X=[[0 for j in range(2)] for i in range(N)]


for i in range(N):
  X[i]=list(map(int,input().split()))


X.sort()
n=1
i=0
k=0
flag=0
while(1):
  if X[i][0]+X[i][1]>X[n][0]-X[n][1]:
    n+=1
    flag=0
  else:
    i+=1
    if flag==0:
      k+=1
      flag=1
  if i>=N-1 or n>=N:
    break
    
print(k+1)

Submission status: Runtime Error

Solution code:
H, W, N = map(int, open(0).read().split())
ans = 0

if H < W:
  A = W
elif W < H:
  A = H

if N%A > 0:
  ans += N//A + 1
elif N%A <= 0:
  ans += N//A
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))

remove=0
i=1
while (i < len(X)-1):
    if X[i+1]-X[i-1] <= L[i+1]+L[i-1]:
        X.pop(i)
        L.pop(i)
        remove+=1
    else:
        i+=1
print(N-remove)

Submission status: Runtime Error

Solution code:
import math
import sys

m=10**9 + 7 
H = int(input())
W = int(input())
N = int(input())
s = max(H,W)
print((N-1) // s + 1 )[myoden@ubuntu002 A]$ cat testA.py ; echo ;echo 
import math
import sys

m=10**9 + 7 
H = int(input())
W = int(input())
N = int(input())
s = max(H,W)
print((N-1) // s + 1 )

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)

x0,l0 = l[0][0],l[0][1]
y = x0 + l0
count = 1
for i in range(n-1):
  x,d = l[i+1][0],l[i+1][1]
  z = x - d
  
  if z > y:
    y = x + d
    count = count + 1
  else:
    continue
print(count)

Submission status: Runtime Error

Solution code:
s = [int(input()) for i in range(3)]
target = s[2]
if s[0] >= s[1]:
  long = s[0]
  short = s[1]
else:
  long = s[1]
  short = s[0]

for i in range(short):
  if long * i >= target:
    print(str(i+1))
    return

Submission status: Runtime Error

Solution code:
H=int(input())
W=int(input())
N=int(input())
 
if W>H :
    if N%W==0:
        k=N/W
    else:
        k=math.ceil(N/W)
if H>=W:
    if N%H==0:
        k=N/H
    else:
        k=math.ceil(N/H)
 
 
print(int(k))

Submission status: Runtime Error

Solution code:
import math
a=input()
b=input()
c=input()
if a>b:
 print(math.ceil(int(c)/int(a)))
elif a<b:
 print(math.ceil(int(c)/int(b)))
print(int(c)/int())

Submission status: Runtime Error

Solution code:
H, W, N = map(int, open(0).read().split())
ans = 0

if H < W:
  A = W
elif W < H:
  A = H

while N >= 0:
  N -= A
  ans += 1
print(ans)

Submission status: Runtime Error

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

if W>H :
    k=int(N/W)+1
else
    k=int(H/W)+1


print(k)

Submission status: Runtime Error

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

i = 0
j = 1

elif H > W:
    while i < N:
        i = (H * j) + i
        j = j + 1
elif H < W:
    while i < N:
        i = (W * j) + i
        j = j + 1
else:
    while i < N:
        i = (H * j) + i
        j = j + 1
print(j-1)

Submission status: Runtime Error

Solution code:
print("please input W")
w=int(input())

print("please input N")
n=int(input())

i=0
j=0

if(h>=w):
  s=h
else:
  s=w

while j<n:
  i+=1
  j=j+s

print(i)

Submission status: Runtime Error

Solution code:
h,w,n=[input() for i in range(3)]
n = int(n)
w = int(w)
h = int(h)
if(h >= w):
  temp = h
elif(w > h):
  temp = w
temp = (n // temp)
if(n % temp != 0):
    temp = temp + 1
print(temp)

Submission status: Runtime Error

Solution code:
import math
H, W, M = map(int, input().split())

if H <= W:
    for i in range(1, H + 1):
        if W * i >= M:
            print(i)

elif:
    for k in range(1, W + 1):
        if H * k >= M:
            print(k)

Submission status: Runtime Error

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


sum = 0
if h > w:
    for i in range(h):
        sum = sum + h
        if n <= sum:
            print(int(sum/h))
            break
else
    for i in range(w):
        sum = sum + w
        if n <= sum:
            print(int(sum/w))
            break

Submission status: Runtime Error

Solution code:
h,w,n=[input() for i in range(3)]
n = int(n)
w = int(w)
h = int(h)
if(h >= w):
  temp = h
else:
  temp = w
temp = (n // temp)
if(n % temp != 0):
	temp = temp + 1
print(temp)

Submission status: Runtime Error

Solution code:
import math
H, W, M = map(int, input().split())

if H <= W:
    for i in range(1, H + 1):
    if W * i => M:
        print(i)

elif:
    for k in range(1, W + 1):
    if H * k => M:
        print(k)

Submission status: Runtime Error

Solution code:
import math

H=input()
W=input()
N=input()

k=W-3*H-math.sqrt((w-3h)**2-(w-h)**2+4N)
k=int(k)+1

print(k)

Submission status: Runtime Error

Solution code:
import math
H, W, M = map(int, input().split())

if H <= W:
    for i in range(1, H + 1):
        if W * i => M:
            print(i)

elif:
    for k in range(1, W + 1):
        if H * k => M:
            print(k)

Submission status: Runtime Error

Solution code:
h = int(input())
w = int(input())
n = int(input())
count = 0
if(h >= w):
    while(n > h):
    n -= h
    count += 1
print(count)
else:
    while(n > w):
    n -= w
    count += 1
print(count)

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:
import math as m
h,w,k = map(int,input().split())

large=max(h,w)
print(m.ceil(k/large))

Submission status: Runtime Error

Solution code:
from sys import stdin


def fetch_one_line():
    return stdin.readline().rstrip()


def fetch_int_input():
    return [int(s) for s in fetch_one_line().split()]


def fetch_inputs(times):
    return [fetch_one_line() for _ in range(times)]


def fetch_int_inputs(times):
    return [[int(s) for s in fetch_one_line()] for _ in range(times)]


def fetch_ints_inputs(times):
    return [fetch_int_input() for _ in range(times)]

N = int(fetch_one_line())
s_t = fetch_inputs(N)
X = fetch_one_line()

flag = False
sum_time = 0
for tmp in s_t:
    s, t = tmp.split(" ")
    if not flag and s == X:
        flag = True
        continue

    t = int(t)
    if flag:
        sum_time += t

print(sum_time)

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:
H = int(input())
W = int(input())
N = int(input())

if H <= W:
    if N % W == 0:
        print(N/W)
    else:
        print((N//W) + 1)
else:
    if N % H == 0:
        print(int(N/H)
    else:
        print(int((N//H) + 1))

Submission status: Runtime Error

Solution code:
s = input()
k = input()
l = input()
d = l/k
j = l % k
if s > k :  
  if j !=:
    d += 1
    print(d)
else:
  print(d)

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
a = list(map(int, input().split()))
if a[0] >= a[1]:
    b = a[0]
    c = a[1]
else:
    b = a[1]
    c = a[0]

if a[2]%b == 0:
    s = int(a[2]/b)
else:
    s = int(a[2]/b)+1

print(s)

Submission status: Runtime Error

Solution code:
h, w, n = [list(map(int, s.split()))[0] for s in open(0)]
print min(int((n-1)//h+1), int((n-1)//w+1))

Submission status: Runtime Error

Solution code:
a = list(map(int, input().split()))
if a[0] >= a[1]:
    b = a[0]
    c = a[1]
else:
    b = a[1]
    c = a[0]

s = int(a[2]/b)+1

print(s)

Submission status: Runtime Error

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

if h < w:
    a =w
else:
    a=h

ans=n/a
if n%a > 0:
    ans+=1

print(ans)

Submission status: Runtime Error

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

if h < w:
    a =w
else:
    a=h

ans=n/a
if n%a > 0:
    ans+=1

print(ans)

Submission status: Runtime Error

Solution code:
import math

def main():
  h = int(inout())
  w = int(input())
  n = int(input())
  print(math.ceil(n/(max(h,w))))
  
  
main()

Submission status: Runtime Error

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

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

Submission status: Runtime Error

Solution code:

ii = lambda : int(input())
mi = lambda : map(int,input().split())
li = lambda : list(map(int,input().split()))

def main():
    h = ii()
    w = ii()
    n = ii()
    print(ceil(n/max(h,w)))




main()

Submission status: Runtime Error

Solution code:
h = int(input())
w = int(input())
n = int(input())
ans(-(-n//max(h,w)))

Submission status: Runtime Error

Solution code:
H = input()
W = input()
N = input()
A = max(H,W)
print((N-1)%A+1)