You have a nuts and lots of boxes. The boxes have a wonderful feature: if you put x (x ≥ 0) divisors (the spacial bars that can divide a box) to it, you get a box, divided into x + 1 sections.You are minimalist. Therefore, on the one hand, you are against dividing some box into more than k sections. On the other hand, you are against putting more than v nuts into some section of the box. What is the minimum number of boxes you have to use if you want to put all the nuts in boxes, and you have b divisors?Please note that you need to minimize the number of used boxes, not sections. You do not have to minimize the number of used divisors.

The first line contains four space-separated integers k, a, b, v (2 ≤ k ≤ 1000; 1 ≤ a, b, v ≤ 1000) — the maximum number of sections in the box, the number of nuts, the number of divisors and the capacity of each section of the box.

Print a single integer — the answer to the problem.

NoteIn the first sample you can act like this:   Put two divisors to the first box. Now the first box has three sections and we can put three nuts into each section. Overall, the first box will have nine nuts.  Do not put any divisors into the second box. Thus, the second box has one section for the last nut. In the end we've put all the ten nuts into boxes.The second sample is different as we have exactly one divisor and we put it to the first box. The next two boxes will have one section each.

k, a, b, v=map(int, raw_input().split())
maxdiv=k-1
boxes=0
while b>=maxdiv and a>0:
    a-=v*k
    b-=maxdiv
    boxes+=1
if a>0:
    if b<maxdiv:
        a-=v*(b+1)
        boxes+=1
    while a>0:
        a-=v
        boxes+=1
print boxes

k, a, b, v = map(int, input().split())
val = 0
while a > 0:
    d = min(b, k - 1)
    a -= (d + 1) * v
    b -= d
    val += 1
print(val)

k, a, b, v=map(int,raw_input().split())
for r in range(a):
    if (r + min(b,(k-1)*r))*v >= a:
        print r
        exit(0)

from math import ceil

k, a, b, v = list(map(int,input().split(" ")))

p = ceil(a/v)

cajas = 0
dcaja = k-1
divs = b

for i in range(p):
  if dcaja == k-1 or divs == 0:
    cajas += 1
    dcaja = 0
  else:
    dcaja += 1
    divs -= 1

print(cajas)

def floor(x):
    if (x == int(x)):
        return int(x)
    else:
        return int(x) + 1
a = input()
a = list(a.split(' '))
a = list(map(int,a))
ts = floor(a[1] / a[3])
tb = 0
#print(ts)
tb += a[2] // (a[0] - 1)
ts -= tb * a[0]
a[2] -= tb * (a[0] - 1)
#print(ts)
if (ts <= 0):
    ts += tb * a[0]
    #print(ts)
    print(floor(a[1] / (a[0] * a[3])))
else:
    tb += 1
    ts -= a[2] + 1
    if (ts <= 0):
        print(int(tb))
    else:
        tb += ts
        print(int(tb))

from itertools import takewhile

k, a, b, v = map(int, raw_input().split())

def boxes(k, b):

    while b >= k - 1:
        yield k
        b -= k - 1

    if b:
        yield b + 1

    while True:
        yield 1

def pack(x, k, b):
    c = 0
    t = 0
    b = boxes(k, b)
    while t < x:
        t += next(b)
        c += 1
    return c

print pack((a + v - 1) // v, k, b)

k, a, b, v = list(map(int, input().split()))
x = 0
while a > 0:
    c = 1
    if b > k-1:
        c += k-1
        b -= k-1
    else:
        c += b
        b = 0
    a -= v*c
    x += 1
print(str(x))

max_section, nuts, divisor, capacity = map(int, input().split()) # max section , nuts, divisor , capacity
def lt(x):
    if x - int(x) > 0:
        return int(x) + 1
    return int(x)
max_divisor = max_section - 1
box_max_section = int(divisor/max_divisor)
extra_box_capacity = (divisor%max_divisor + 1)*capacity
if nuts > box_max_section*capacity*max_section:
    rs = box_max_section
    nuts -= box_max_section*max_section*capacity
    if nuts > extra_box_capacity:
        rs += 1 + lt((nuts-extra_box_capacity)/capacity)
    else:
        rs +=1
else:
    rs = lt(nuts/(max_section*capacity))
print(rs)

x = input()
max_sections, nuts, divisors, max_nuts = [int(i) for i in x.split()]

divisors_per = max_sections - 1
fit = max_sections * max_nuts

boxes = 1
while 1:
    if divisors_per > divisors:
        sections = divisors + 1
        nuts -= sections * max_nuts
        divisors = 0
    else:
        nuts -= fit
        divisors -= divisors_per

    if nuts <= 0: break
    else: boxes += 1

print(boxes)

#!/usr/bin/python

#input section
def takeInput():
     a = [int(x) for x in raw_input().split(' ')]
     return a

#logic section
a = takeInput()
K = a[0]
A = a[1]
B = a[2]
V = a[3]

#to monitor the answer(ans)
nutsRemaining = 0
ans = 0

while nutsRemaining < A:
    tempMin = min(K,B + 1)
    nutsRemaining += tempMin * V
    B -= tempMin - 1
    ans += 1
print ans

l=lambda:map(int,raw_input().split())
sec,n,di,v=l()
boxes=0
if di>=sec-1:
    boxes=di/(sec-1)
if n%v==0:
    needsec=n/v
else:
    needsec=n/v+1
cnt=0
i=1
while i<=boxes:
    cnt+=sec
    if cnt>=needsec:
        print i
        exit()
    i+=1
r=n
if boxes>0:
    r=n-boxes*sec*v
rdi=di%(sec-1)
if rdi==0:
    print boxes + [r/v+1,r/v][r%v==0]
else:
    if r<=(rdi+1)*v:
        print boxes+1
    else:
        r=r-(rdi+1)*v
        boxes+=1
        print boxes + [r/v+1,r/v][r%v==0]

In=lambda:map(int,raw_input().split())

max_sections, nuts, divisors, nuts_per_sections = In()

boxes = 0

while nuts > 0:
	boxes += 1
	divs = min(max_sections-1,divisors)
	divisors -= divs
	nuts -= (divs+1)*nuts_per_sections

print boxes

def main():
    k, a, b, v = map(int, input().split())
    res = (b + k - 2) // (k - 1)
    o = b + res
    if o * v < a:
        res += (a + v - 1) // v - o
    else:
        res = (a + k * v - 1) // (k * v)
    print(res)

if __name__ == '__main__':
    main()

k, a, b, v = map(int, input().split())
result = 1
x = 1
while a > 0:
  if b > 0:
    if x < k:
      b -= 1
      x += 1
      a -= v
    else:
      a -= v
      if a > 0:
        result += 1
        x = 1
  else:
    a -= v
    if a > 0:
      result += 1
print(result)

k, a, b, v = map(int, raw_input().split())

q = b / (k-1)
r = b % (k-1)

i = 0
while a > 0:
    m = min(k-1, b)
    b = max(0, b-m)
    a -= (m+1)*v
    i += 1
print i

k, a, b, v = map(int, input().split())
for i in range(1, 1010):
    if a <= v * (i + min(b, (k - 1) * i)):
        print(i)
        break

from math import *

def main():
    s = str(raw_input()).split(" ")
    k = int(s[0])
    a = int(s[1])
    b = int(s[2])
    v = int(s[3])

    x = b
    left = a

    ans = 0

    while(True):

        sections = min(k, x + 1)

        x -= sections - 1
        put = sections * v

        left = left - put
        ans += 1
        if(left > 0):
            continue
        else:
            break

    print ans

if __name__ == '__main__':
    main()

k,a,b,v=map(int,input().split());o=0
while(a>0):
 o+=1;a-=v*min(b+1,k);b-=min(b,k-1)
print(o)

k, a, b, v = map(int, input().split(' '))
c, i = 1, 1
while a - v > 0:
    a -= v
    if i < k and b > 0:
        i += 1
        b -= 1
    else:
        i = 1
        c += 1
print(c)

sections,nuts,divisors,cap = map(int,input().split())
boxes=0
while(nuts > 0):
    s = 1
    if(divisors > 0 and divisors <= sections -1):
        s = divisors + 1
        divisors = 0
    elif divisors > sections -1:
        s = sections
        divisors -= (sections -1)
    nuts -= (s*cap)
    boxes+=1
print(boxes)

#!/usr/bin/env python
# encoding: utf-8
k,a,b,v = map(int,raw_input().split())

ans = 0

while a > 0 :
    y = min(k-1,b)
    b -= y
    a -= (y+1)*v
    ans += 1

print ans

from math import ceil

k, a, b, v = list(map(int, input().split()))
Box = 0
while a:
    Section = min(b, k - 1) + 1
    b -= Section - 1
    Total = min(v, ceil((a) / Section))
    a -= min(a , Total * Section)
    Box += 1
print(Box)

k,a,b,v=map(int,input().split())
l=[]
while(b>0):
	if(b>=k):
		b1=k-1
		l.append((b1+1)*v)
		b=b-b1
	else:
		l.append((b+1)*v)
		b=0
tb=0
s=0
for i in range(len(l)):
	a=a-l[i]
	tb=tb+1
	if(a<=0):
		break
if(a>0):
	while(a>0):
		a=a-v
		tb=tb+1
print(tb)

from math import ceil

Div_,Nuts_,Sec_,Nut_Cap_ = map(int,input().split())

Boxes_ = Sec_//(Div_-1)
Remaining_ = Sec_%(Div_-1)

if Remaining_:
	Total_capcaity = Boxes_*Div_*Nut_Cap_ + (Remaining_+1)*Nut_Cap_
else:
	Total_capcaity = Boxes_*Div_*Nut_Cap_

if Nuts_ >= Total_capcaity:
	Nuts_ = Nuts_ - Total_capcaity
	if Remaining_:
		ans = Boxes_ + 1
	else:
		ans = Boxes_
	ans = ans + ceil(Nuts_/Nut_Cap_)
elif Nuts_ >  Boxes_*Div_*Nut_Cap_:
	ans = Boxes_ + 1
else:
	ans = ceil(Nuts_/(Div_*Nut_Cap_))

print(ans)

k, a, b, v = map(int, input().split())
ans = 0
while a > 0:
    ans += 1
    a -= min(k, b + 1) * v
    b -= min(k - 1, b)
print(ans)

k, a, b, v = map(int, raw_input().split())
p = 0
while a>0:
    if b>=k:
        a = a - (k*v)
        b = b - (k-1)
    elif b>0:
        a = a - (b+1)*v
        b = 0
    else:
        a = a - v
    p = p + 1
print p

k , a , b , v = map( int , input( ).split( ) )
s = 0
while  a > 0 :
    a -= min( k , b + 1 ) * v
    b -= min( k - 1 , b )
    s += 1
print( s )

k,a,b,v = [int(x) for x in raw_input().split()]
ans = 0
while a > 0:
    if b+1>=k:
        a -= k*v
        b -= k-1
        ans += 1
    elif b == 0:
        a -= v
        ans += 1
    elif b +1<k:
        a -= (b+1)*v
        b  = 0
        ans +=1
print ans

k, a, b, v = map(int, input().split())
val = 0
while a > 0:
    d = min(b, k - 1)
    a -= (d + 1) * v
    b -= d
    val += 1
print(val)

k,a,b,v=map(int,raw_input().split())
count=0
while(1):
	if(b>=k):
		b-=(k-1)
		a-=v*(k)

		if(a>0):
			count+=1
			continue
		else:
			count+=1
			break
	elif(b!=0):
		a-=v*(b+1)
		b=0
		if(a>0):
			count+=1
			continue
		else:
			count+=1
			break
	else:
		if(a>0):
			count+=1
			a-=v
		else:
			break

#count+=1
print count

#!/usr/bin/python
import re
import inspect
from sys import argv, exit
from math import ceil

def rstr():
    return input()

def rstrs(splitchar=' '):
    return [i for i in input().split(splitchar)]

def rint():
    return int(input())

def rints(splitchar=' '):
    return [int(i) for i in rstrs(splitchar)]

def varnames(obj, namespace=globals()):
    return [name for name in namespace if namespace[name] is obj]

def pvar(var, override=False):
    prnt(varnames(var), var)

def prnt(*args, override=False):
    if '-v' in argv or override:
        print(*args)

# Faster IO
pq = []
def penq(s):
    if not isinstance(s, str):
        s = str(s)
    pq.append(s)

def pdump():
    s = ('\n'.join(pq)).encode()
    os.write(1, s)

if __name__ == '__main__':
    sec_per_box, nuts, divs, cap = rints()
    prnt('secs/box:', sec_per_box, 'nuts', nuts, 'divs', divs, 'cap', cap)

    total_secs_needed = ceil(nuts / cap)
    prnt('total_secs_needed', total_secs_needed)
    if total_secs_needed < sec_per_box:
        ans = 1
        if divs < (sec_per_box - 1):
            total_secs_needed -= 1 + divs
            if total_secs_needed > 0:
                ans += total_secs_needed
        print(ans)
        exit(0)

    fdb = divs // (sec_per_box - 1)
    prnt('fdb', fdb)

    if fdb*sec_per_box > total_secs_needed:
        prnt('top')
        ans = ceil(total_secs_needed / sec_per_box)
        print(ans)
    else:
        prnt('bot')
        nuts -= fdb*sec_per_box*cap
        total_secs_needed -= fdb*sec_per_box
        divs -= fdb*(sec_per_box -1)
        ans = fdb
        if divs:
            prnt('if divs')
            ans += 1
            nuts -= (divs+1) * cap
        prnt('nuts, cap: ', nuts, cap)
        if nuts > 0:
            ans += ceil(nuts / cap)
        print(ans)

import math
k,a,b,v=map(int,input().split())
ans=0
while(a>0):
    m=min(k,b+1)
    a-=m*v
    b-=(m-1)
    ans+=1
print(ans)

def solve():
    k, a, b, v = list(map(int, raw_input().split(" ")))
    nuts, divs, r = a, b, 0
    while nuts > 0:
        ud = min(divs, k-1)
        divs -= ud
        nuts -= (ud+1)*v
        r+=1
    print r

# invoke solve
solve()

k, a, b, v = map(int, raw_input().split())

nut_piles = a / v if not a % v else a / v + 1

box_number = 1
box_sections = 1
box_filled = 0

while nut_piles:
	if box_filled < box_sections:
		box_filled += 1
	elif box_sections < k and b > 0:
		box_sections += 1
		box_filled += 1
		b -= 1
	else:
		box_number += 1
		box_sections = 1
		box_filled = 1
	nut_piles -= 1
print box_number

k,a,b,v=map(int,input().split());o=0
while(a>0):
 o+=1;a-=v*min(b+1,k);b-=min(b,k-1)
print(o)

import sys

if __name__ == "__main__":
    line = sys.stdin.readline()
    items = line.split()
    k = int(items[0])
    a = int(items[1])
    b = int(items[2])
    v = int(items[3])
    box = 0

    while b >= k-1 and a > 0:
        box += 1
        a -= k * v
        b -= k-1

    if a <= 0:
        print box
    else:
        if a % v == 0:
            sec_need = a / v
        else:
            sec_need = a / v + 1

        if sec_need > b+1:
            box += 1 + sec_need - (b+1)
        else:
            box += 1
        print box

I=lambda:map(int, raw_input().split())
k, a, b, v = I()
full, half = b / (k-1), b % (k-1)
x = full * v * k
#print full, half
if x >= a:
    print (a + v * k - 1) / (v * k)
else:
    if a - x <= (half + 1)*v:
        print full + 1
    else:
        print full + 1 + (a - x - (half + 1) * v + v - 1)/ v

k,a,b,v = map(int, input().split())
answ = 0
while a != 0 and b != 0:
    a -= min(v*min(k,b+1),a)
    b -= min(k-1,b)
    answ+=1
answ += a//v + int(a%v != 0)
print(answ)

In=lambda:map(int,raw_input().split())

max_sections, nuts, divisors, nuts_per_sections = In()

boxes = 0

while nuts > 0:
	boxes += 1
	divs = min(max_sections-1,divisors)
	divisors -= divs
	nuts -= (divs+1)*nuts_per_sections

print boxes

import sys
import math

inp = sys.stdin.readline().rstrip('\n').split(' ')
k = int(inp[0]) # sections in a box
a = int(inp[1]) # # of nuts
b = int(inp[2]) # # of divisors
v = int(inp[3]) # capacity of each section.

boxNum = 0

while (a > 0):
	boxNum += 1
	boxSection = 1
	while (boxSection < k and b > 0):
		boxSection += 1
		b -= 1
	# subtract nuts
	if (a/boxSection <= 1):
		a = 0
	else:
		a -= boxSection*v

print boxNum

k, a, b, v = [int(_) for _ in raw_input().split()]

ans = 1

while True:
    cnt = ans + (min((k-1)*ans, b))
    if cnt * v >= a:
        print ans
        break
    ans += 1

k, a, b, v = map(int, raw_input().split())

q = b / (k-1)
r = b % (k-1)

i = 0
while a > 0:
    m = min(k-1, b)
    b = max(0, b-m)
    a -= (m+1)*v
    i += 1
print i

k, a, b, v = list(map(int, input().split()))
x = 0
while a > 0:
    c = 1
    if b > k-1:
        c += k-1
        b -= k-1
    else:
        c += b
        b = 0
    a -= v*c
    x += 1
print(str(x))

#!/usr/bin/env python
# encoding: utf-8
k,a,b,v = map(int,raw_input().split())

ans = 0

while a > 0 :
    y = min(k-1,b)
    b -= y
    a -= (y+1)*v
    ans += 1

print ans

k, a, b, v = map(int, raw_input().split())
cnt = 0
while a > 0:
	section = 1
	if b >= k-1:
		section = k
		b -= (k - 1)
	else:
		section = b + 1
		b = 0
	a -= (v * section)
	cnt += 1
print cnt

k, a, b, v = map(int, raw_input().split())
dem = 0
while a>0:
    dem += 1
    if b >= k-1:
        b -= (k-1)
        d = k
    else:
        d = b+1
        b = 0
    a -= d*v
print dem

import sys
import math

line = sys.stdin.readline()
z = line.split()
k = int(z[0])
a = int(z[1])
b = int(z[2])
v = int(z[3])

numBoxes = 1
numSections = 1
a = a-v
while(a > 0):
    if(numSections == k):
        numBoxes +=1
        numSections = 1
        a = a-v
    elif b==0:
        numBoxes +=1
        numSections = 1
        a = a-v
    else:
        numSections +=1
        b -= 1
        a = a-v
print numBoxes

##if(a < v*(b+1)):
##    print int(math.ceil(float(a)/float(k*v)))
##else:
##    n = int(math.ceil(float(a)/float(k*v)))
##    n1 = int(math.ceil(float(a - v*(b+1))/float(v)))
##    print n + n1
##
##

k, a, b, v=map(int, raw_input().split())
i=1
ans=0
while ans==0:
    cnt=i+min((k-1)*i, b)
    if (cnt*v)>=a:
        ans=i
    i=i+1
print ans

k, a, b, v = map(int, input().split(' '))
c, i = 1, 1
while a - v > 0:
    a -= v
    if i < k and b > 0:
        i += 1
        b -= 1
    else:
        i = 1
        c += 1
print(c)

k, a, b, v = map(int, input().split())
x = 0

while a > 0:
    x += 1
    a -= v * min(b+1, k)
    b -= min(b, k-1)

print(x)

from math import ceil
k, a, b, v = [int(i) for i in input().split()]

print(max(ceil((a/v) - b), ceil(a/(k*v))))

def ceiling_div(x, y):
	res = x // y
	if (x % y != 0):
		res += 1
	return res

k, a, b, v = map(int, input().split())
sec = ceiling_div(a, v)
res = max(sec - b, ceiling_div(sec, k))
print(res)

k,a,b,v=map(int,input().split())
box=0
rem=a
while rem>0:
    box+=1
    comp=0
    if (b>k-1):
        comp=k
        b-=k-1
    else:
        comp=b+1
        b=0
    rem-=v*comp
print (box)

#!/usr/bin/env python3

def read_ints():
	return map(int, input().strip().split())

k, a, b, v = read_ints()

z = (a + v-1) //v

used_boxes = 0
free_div = b
last_box_sec = float('inf')

while z:
	if last_box_sec < k and free_div > 0:
		last_box_sec += 1
		free_div -= 1

	else:
		used_boxes += 1
		last_box_sec = 1

	z -= 1

print(used_boxes)

l=[int(i) for i in input().split(" ")]
k=l[0]
a=l[1]
b=l[2]
v=l[3]
box=0
divs=0
while a>0:
    box+=1
    sections=1
    a-=v
    while a>0 and sections<k and divs<b:
        divs+=1
        sections+=1
        a-=v
print(box)

k, a, b, v=map(int, raw_input().split())
maxdiv=k-1
boxes=0
while b>=maxdiv and a>0:
    a-=v*k
    b-=maxdiv
    boxes+=1
if a>0:
    if b<maxdiv:
        a-=v*(b+1)
        boxes+=1
    while a>0:
        a-=v
        boxes+=1
print boxes

k,a,b,v=map(int,raw_input().split())
from math import *
s=ceil(a*1.0/v)
ans=0

while a>0 and k<=b+1:
    a=a-(k)*v
    ans=ans+1
    b=b-(k-1)
    #print a,b,ans

if a>0 and  k>b+1:
    a=a-(b+1)*v
    ans=ans+1
#print a,ans
if a>0:
    print int(ans+ceil(a*1.0/v))
else:
    print int(ans)

k, a, b, v = [int(_) for _ in raw_input().split()]

ans = 1

while True:
    cnt = ans + (min((k-1)*ans, b))
    if cnt * v >= a:
        print ans
        break
    ans += 1

k,a,b,v=map(int,input().split())
ans=0
while a>0:
    ans+=1
    kn=min(k,b+1)
    a-=v*kn
    b=max(b-k+1,0)
print(ans)

k,a,b,v = map(int,raw_input().split())
q = b // (k-1)
r = b % (k-1)
if a <= q*k*v:
  res = a // (k*v)
  if a % (k*v) >0:
    res += 1
else:
  a -= q*k*v
  res = q
  if a <= (r + 1) * v:
    res = q+1
  else:
    a -= (r + 1) * v
    res += 1
    s = a // v
    res += s
    if a % v > 0:
      res += 1
print res

def main():
    k, a, b, v = map(int, raw_input().split())
    counter = 0
    while a > 0:
        if b > k - 1:
            a -= k * v
            b -= k - 1
        else:
            a -= (b + 1) * v
            b = 0
        counter += 1
    print counter

if __name__ == '__main__':
    main()

import math
k,a,b,v=map(int,input().split())
#3 10 3 3
if(v>a):
    print(1)
else:
    if b+1<k:
    	a=a-v*(b+1)
    	ans=math.ceil(a/v)
    	print(ans+1)
    else:

        c=1
        a=a-(v*k)#694
        b=b-k+1#4
        #print("initial a=",a,"b=",b,"k=",k)
        while(a>0 and b>0):
	        if v*(b+1)>a and b<k:
	            #print("in 1st if")
	            c+=1
	            a=0
	            break
	        else:
	            if b>k:
	                if(v>a):
	                    c+=1
	                    a=0
	                else:
	                    a=a-(v*(k))#
	                    c+=1#
	                    b=b-(k-1)#
	                    #print("in b>k a=",a,"b=",b,"c=",c)
	            if(b<=k):
	               a=a-v*(b+1)  #
	               c+=1#

	               b=0
	               #print("in b<k a=",a,"b=",b,"c=",c)
	           #if(b==k):

        if(b==0 and a>0):
            c+=math.ceil(a/v)
        print(c)

#!/usr/bin/env python
# -*- coding: utf-8 -*-
# Jonathan Prieto - d555

import sys

# sys.stdin = open("inputA.txt", "r")
# sys.stdout = open("out.txt", "w")

def solve(k,a,b,v):
    av = (a + v - 1) / v
    if b is 0 or av <= b+1:
        return (av + k - 1)/k
    if b + 1 <= k:
        a = a - (b+1)*v
        return 1 + (a + v - 1)/v

    c = b / (k-1)
    a = a - c*v*k
    b = b - c*(k-1)
    if a > 0:
        c =  c + 1
        a = a - (b+1)*v
        c =  c+ (a + v -1)/v
        return c
    return c

for i in sys.stdin:
    k,a,b,v = map(int, i.split())
    print solve(k,a,b,v)

from sys import stdin,stdout
from collections import Counter
def ai(): return list(map(int, stdin.readline().split()))
def ei(): return map(int, stdin.readline().split())
def ip(): return  int(stdin.readline().strip())
def op(ans): return stdout.write(str(ans) + '\n')

k,a,b,v = ei()
for i in range(1,2000):
	t = min(k,b+1)
	a -= t*v
	b -= t-1
	if a <=0:
		print(i)
		break
  #'''k-sec,a-nuts,b-divisor,v-capicity'''

def main():
    k,a,b,v = [int(c) for c in raw_input().split()]
    count = 1
    sections = 1
    while a>0:
        a -= v
        if a<= 0:
            break
        if sections < k and b>0:
            sections += 1
            b -= 1
        else:
            count += 1
            sections = 1
    return count

if __name__ == "__main__":
    print main()

k,a,b,v=map(int,input().split());o=0
while(a>0):
 o+=1;a-=v*min(b+1,k);b-=min(b,k-1)
print(o)

[k, a, b, v] = map(int, raw_input().split())
c = b / (k - 1)
if a <= c * k * v:
    print (a - 1) / (k * v) + 1
else:
    a = a - c * k * v
    b = b - (k - 1) * c
    if a <= (b + 1) * v:
        print c + 1
    else:
        a = a - (b + 1) * v
        print c + 2 + (a - 1) / v

k,a,b,v = map(int, raw_input().split())
box = 0
cnt = 0
while cnt < a:
    if b == 0:
        cnt = cnt + v
        box = box + 1
    else:
        if b <= k-1 :
            cnt = cnt + (b+1)* v
            b = 0
            box = box + 1
        else:
            b = b - (k-1)
            cnt = cnt + k * v
            box = box + 1
print box

k, a, b, v = map(int, raw_input().split())
cnt = 0
while a > 0:
	section = 1
	if b >= k-1:
		section = k
		b -= (k - 1)
	else:
		section = b + 1
		b = 0
	a -= (v * section)
	cnt += 1
print cnt

mxd,n,d,ns=map(int,input().split(' '))
res=0
while(n>0):
    for i in range(mxd,-1,-1):
        if(i<=d and i<mxd):
            res+=1
            n-=ns*(i+1)
            if(d>0):
                d-=i
            break
print(res)

import sys,math

maxsec,noten,planken,notsec=map(int,raw_input().split())

dozen=min(noten/(notsec*maxsec),planken/(maxsec-1))
noten-=dozen*notsec*maxsec
planken-=dozen*(maxsec-1)

sec=noten/notsec+int(noten%notsec>0)
if sec>=planken+1:
    dozen+=1
    noten-=(planken+1)*notsec
    if noten>0:
        dozen+=noten/notsec+int(noten%notsec>0)
else:
    if sec>0:
        dozen+=1

print dozen

# Made By Mostafa_Khaled
bot = True
from math import ceil

k, a, b, v = [int(i) for i in input().split()]

print(max(ceil((a/v) - b), ceil(a/(k*v))))

# Made By Mostafa_Khaled

string=str(input())+' '
word=''
wordlist=[]
boxes=0

for char in string:
    if char!=' ':
        word+=char
    else:
        wordlist.append(int(word))
        word=''

maxsections=wordlist[0]
nuts=wordlist[1]
divisors=wordlist[2]
maxnuts=wordlist[3]

while nuts>0:
    boxes+=1

    if divisors>=maxsections-1:
        divisors-=maxsections-1
        if nuts>=maxsections*maxnuts:
            nuts-=maxsections*maxnuts
        elif nuts<maxsections*maxnuts:
            nuts=0

    elif divisors<maxsections-1:
        if nuts>=(divisors+1)*maxnuts:
            nuts-=(divisors+1)*maxnuts
        elif nuts<(divisors+1)*maxnuts:
            nuts=0
        divisors=0

print(boxes)

sections,nuts,divisors,cap = map(int,input().split())
boxes=0
while(nuts > 0):
    s = 1
    if(divisors > 0 and divisors <= sections -1):
        s = divisors + 1
        divisors = 0
    elif divisors > sections -1:
        s = sections
        divisors -= (sections -1)
    nuts -= (s*cap)
    boxes+=1
print(boxes)

k,a,b,v=map(int,raw_input().split())
from math import *
s=ceil(a*1.0/v)
ans=0

while a>=0 and k<=b+1:
    a=a-(k)*v
    ans=ans+1
    b=b-(k-1)
    #print a,b,ans

if a>0 and  k>b+1:
    a=a-(b+1)*v
    ans=ans+1
#print a,ans
if a>0:
    print int(ans+ceil(a*1.0/v))
else:
    print int(ans)

k,a,b,v=map(int,raw_input().split())
from math import *
s=ceil(a*1.0/v)
ans=0

while a>=0 and k<=b+1:
    a=a-(k)*v
    ans=ans+1
    b=b-(k)
    #print a,b,ans

if k>b+1:
    a=a-(b+1)*v
    ans=ans+1
#print a,ans
if a>0:
    print int(ans+ceil(a*1.0/v))
else:
    print int(ans)

from math import ceil
k, a, b, v = map(int, input().split())
x = b // (k - 1)
ost = b % (k - 1)
n = v * k
if x * n >= a:
    print(ceil(a / (x * n)))
else:
    d = x
    a -= x * n
    if (ost + 1) * v >= a:
        print(d + 1)
    else:
        d += 1
        a -= (ost + 1) * v
        print(d + ceil(a / v))

import math

k,a,b,v = map(int,input().split())

if b >= k-1:
    #print(b,k-1)
    #print(((b//(k-1))*k)*v,(b%(k-1)+1)*v)
    total =  ((b//(k-1))*k)*v + (b%(k-1)+1)*v
else:
    total = (b+1)*v

if a >= total:
    g = math.ceil((b+1)/k) + math.ceil((a-total)/v)
else:
    re = math.ceil(a/v)
    g = math.ceil(re/k)

print(g)

import math

k,a,b,v = map(int,input().split())

total = (b+1)*v

if a >= total:

    g = math.ceil((b+1)/k) + math.ceil((a-total)/v)
else:

    re = math.ceil(a/v)

    g = math.ceil(re/k)

print(g)

def floor(x):
    if (x == int(x)):
        return x
    else:
        return int(x) + 1
a = input()
a = list(a.split(' '))
a = list(map(int,a))
ts = floor(a[1] / a[3])
tb = 0
#print(ts)
tb += a[2] // (a[0] - 1)
ts -= tb * a[0]
a[2] -= tb * (a[0] - 1)
#print(ts)
if (ts <= 0):
    ts += tb * a[0]
    #print(ts)
    print(floor(a[1] / (a[0] * a[3])))
else:
    tb += 1
    ts -= a[2] + 1
    if (ts <= 0):
        print(int(tb))
    else:
        tb += ts
        print(int(tb))

a = input()
a = list(a.split(' '))
a = list(map(int,a))
ts = a[1] / a[3]
tb = 0
if (ts != int(ts)):
    ts = int(ts) + 1
#print(ts)
tb += a[2] // (a[0] - 1)
ts -= tb * a[0]
a[2] -= tb * (a[0] - 1)
#print(ts)
if (ts <= 0):
    ts += tb * a[0]
    print(int(ts // (a[0]-1)))
else:
    tb += 1
    ts -= a[2] + 1
    if (ts <= 0):
        print(int(tb))
    else:
        tb += ts
        print(int(tb))

a = input()
a = list(a.split(' '))
a = list(map(int,a))
ts = a[1] / a[3]
tb = 0
if (ts != int(ts)):
    ts = int(ts) + 1
#print(ts)
tb += a[2] // (a[0] - 1)
ts -= tb * a[0]
a[2] -= tb * (a[0] - 1)
if (ts <= 0):
    ts += tb * a[0]
    print(int(ts // a[0]))
else:
    tb += 1
    ts -= a[2] + 1
    if (ts <= 0):
        print(int(tb))
    else:
        tb += ts
        print(int(tb))

import sys

f = sys.stdin
# f = open("input.txt", "r")

k, a, b, v = map(int, f.readline().split())

cnt = 0
boxes = 1

while cnt < a:
    if k-1 <= b:
        cnt += k*v
        b -= k
    elif b > 0:
        cnt += (b+1)*v
        b = 0
    else:
        boxes += 1
        cnt += v

print(boxes)

import math
def main():
    k,a,b,v = [int(i) for i in input().split()]
    s = math.ceil(a/v)
    total = math.ceil(min(s,b+1)/k)
    if s > b+1:
        total += s-b-1
    print(total)

if __name__ == '__main__': main()

#!/usr/bin/python
import re
import inspect
from sys import argv, exit
from math import ceil

def rstr():
    return input()

def rstrs(splitchar=' '):
    return [i for i in input().split(splitchar)]

def rint():
    return int(input())

def rints(splitchar=' '):
    return [int(i) for i in rstrs(splitchar)]

def varnames(obj, namespace=globals()):
    return [name for name in namespace if namespace[name] is obj]

def pvar(var, override=False):
    prnt(varnames(var), var)

def prnt(*args, override=False):
    if '-v' in argv or override:
        print(*args)

# Faster IO
pq = []
def penq(s):
    if not isinstance(s, str):
        s = str(s)
    pq.append(s)

def pdump():
    s = ('\n'.join(pq)).encode()
    os.write(1, s)

if __name__ == '__main__':
    sec_per_box, nuts, divs, cap = rints()

    total_secs_needed = ceil(nuts / cap)
    prnt(total_secs_needed)
    if total_secs_needed < sec_per_box:
        print(1)
        exit(0)

    fdb = divs // (sec_per_box - 1)
    prnt('fdb', fdb)

    if fdb*sec_per_box > total_secs_needed:
        prnt('top')
        ans = ceil((fdb*sec_per_box) / total_secs_needed)
        print(ans)
    else:
        prnt('bot')
        nuts -= fdb*sec_per_box*cap
        total_secs_needed -= fdb*sec_per_box
        divs -= fdb*(sec_per_box -1)
        ans = fdb
        if divs:
            prnt('if divs')
            ans += 1
            nuts -= (divs+1) * cap
        prnt('nuts, cap: ', nuts, cap)
        if nuts > 0:
            ans += ceil(nuts / cap)
        print(ans)

#!/usr/bin/python
import re
import inspect
from sys import argv, exit
from math import ceil

def rstr():
    return input()

def rstrs(splitchar=' '):
    return [i for i in input().split(splitchar)]

def rint():
    return int(input())

def rints(splitchar=' '):
    return [int(i) for i in rstrs(splitchar)]

def varnames(obj, namespace=globals()):
    return [name for name in namespace if namespace[name] is obj]

def pvar(var, override=False):
    prnt(varnames(var), var)

def prnt(*args, override=False):
    if '-v' in argv or override:
        print(*args)

# Faster IO
pq = []
def penq(s):
    if not isinstance(s, str):
        s = str(s)
    pq.append(s)

def pdump():
    s = ('\n'.join(pq)).encode()
    os.write(1, s)

if __name__ == '__main__':
    sec_per_box, nuts, divs, cap = rints()
    prnt('secs/box:', sec_per_box, 'nuts', nuts, 'divs', divs, 'cap', cap)

    total_secs_needed = ceil(nuts / cap)
    prnt('total_secs_needed', total_secs_needed)
    if total_secs_needed < sec_per_box:
        print(1)
        exit(0)

    fdb = divs // (sec_per_box - 1)
    prnt('fdb', fdb)

    if fdb*sec_per_box > total_secs_needed:
        prnt('top')
        ans = ceil(total_secs_needed / sec_per_box)
        print(ans)
    else:
        prnt('bot')
        nuts -= fdb*sec_per_box*cap
        total_secs_needed -= fdb*sec_per_box
        divs -= fdb*(sec_per_box -1)
        ans = fdb
        if divs:
            prnt('if divs')
            ans += 1
            nuts -= (divs+1) * cap
        prnt('nuts, cap: ', nuts, cap)
        if nuts > 0:
            ans += ceil(nuts / cap)
        print(ans)

k, a, b, v = map(int, input().split())
m = (a + v - 1) // v
# print("m =", m)
n = (m + k - 1) // k
# print("n =", n)
x = (b + 1) // k
# print("x =", x)
y = (b + k) // k
# print("y =", y)
if n <= x:
  print(n)
elif m <= b + 1:
  print(y)
else:
  print(y + m - b - 1)

k, a, b, v = map(int, input().split())
for i in range(1, 1001):
    if (k - 1) * i < b:
        t = (k - 1) * i
    else:
        t = b
    if a < v * (i + t):
        print(i)
        break

k,a,b,v=map(int,input().split())
ans=0
while a>0:
    if b>=k-1:
        ans+=b//(k-1)
        a-=k*v*(b//(k-1))
        b=b%(k-1)
    elif b!=0:
        ans+=1
        a-=(b+1)*v
        b=0
    else:
        ans+=a//v +(1 if a%v else 0)
        a=0
print(ans)

k,a,b,v=map(int,input().split())
o=a//v+(1 if a%v else 0)
ans=0
while o>0:
    if b>=k-1:
        ans+=b//(k-1)
        o-=k*(b//(k-1))
        b=b%(k-1)
    elif b!=0:
        ans+=1
        o-=b+1
        b=0
    else:
        ans+=o
        o=0
print(ans)

from math import ceil

k,nuts,b,v = map(int,input().split())

cap_ = (b+1)*v
sections_ = ceil(cap_/v)
r = cap_%v
boxes = ceil(sections_/k)
ans = boxes
if nuts > (b+1)*v:
	if r != 0:
		nuts = nuts-(v-r)-(b+1)*v
	else:
		nuts = nuts-(b+1)*v
	ans = ans + ceil(nuts/v)
else:
	sections_ = ceil(nuts/v)
	ans = ceil(sections_/k)
print(ans)

from math import ceil

sec_,nuts,div_,cap_ = map(int,input().split())
b_ = ceil((div_+1)/sec_)

t1 = (div_+1)*cap_
if t1 >= nuts:
	d = ceil(nuts/cap_)
	ans = ceil(d/sec_)
elif t1 < nuts:
	nuts = nuts - t1
	ans = b_
	ans = ans + ceil(nuts/cap_)
print(ans)

from math import ceil

Div_,Nuts_,Sec_,Nut_Cap_ = map(int,input().split())

Boxes_ = Sec_//(Div_-1)
Remaining_ = Sec_%(Div_-1)
if Remaining_:
	Total_capcaity = Boxes_*Div_*Nut_Cap_ + (Remaining_+1)*Nut_Cap_
else:
	Total_capcaity = Boxes_*Div_*Nut_Cap_

if Nuts_ > Total_capcaity:
	Nuts_ = Nuts_ - Total_capcaity
	ans = Boxes_ + 1
	ans = ans + ceil(Nuts_/Nut_Cap_)
elif Nuts_ >=  Boxes_*Div_*Nut_Cap_:
	ans = Boxes_ + 1
else:
	ans = ceil(Nuts_/(Div_*Sec_))
print(ans)

from math import ceil

k,nuts,b,v = map(int,input().split())

cap_ = (b+1)*v
sections_ = ceil((cap_)/v)
t = ceil((sections_)/k)
if cap_ <= nuts:
	nuts = nuts - cap_
	t = t + ceil(nuts/(v))
	print(t)
else:
	ans = nuts//(k*v)
	if nuts%(k*v) != 0:
		ans = ans + 1
	print(ans)

from math import ceil

Div_,Nuts_,Sec_,Nut_Cap_ = map(int,input().split())

Boxes_ = Sec_//(Div_-1)
Remaining_ = Sec_%(Div_-1)

if Remaining_:
	Total_capcaity = Boxes_*Div_*Nut_Cap_ + (Remaining_+1)*Nut_Cap_
	Boxes_ = Boxes_ + 1
else:
	Total_capcaity = Boxes_*Div_*Nut_Cap_

if Nuts_ > Total_capcaity:
	Nuts_ = Nuts_ - Total_capcaity
	ans = Boxes_
	ans = ans + ceil(Nuts_/Nut_Cap_)
elif Nuts_ >  Boxes_*Div_*Nut_Cap_:
	ans = Boxes_ + 1
else:
	ans = ceil(Nuts_/(Div_*Sec_))
print(ans)

from math import ceil

k,nuts,b,v = map(int,input().split())

t1 = (b)//(k-1)
t2 = (b+1)%(k-1)
capacity = t1*v*k+t2*v
# print(capacity)
ans = t1+t2
if capacity < nuts:
	nuts = nuts - capacity
	ans = ans + ceil(nuts/v)
	print(ans)
else:
	print(ceil(nuts/k))

k, a, b, v = map(int, input().split())

c = b // (k - 1)
d = b % (k - 1) + 1
s = a // v + 1
result = 0
while (a > 0 and c > 0):
    a -= k * v
    c -= 1
    result += 1

if a > 0:
    a -= d * v
    result += 1

if a > 0:
    result += a // v + 1

print(result)

import math
k,a,b,v=map(int,input().split())
#3 10 3 3
if(v>a):
    print(1)
else:
    if b+1<k:
    	a=a-v*(b+1)
    	ans=math.ceil(a/v)
    	print(ans+1)
    else:
        c=1
        a=a-(v*k)
        b=b-k+1
        #print("initial a=",a,"b=",b,"k=",k)
        while(a>0):
	        if v>a:
	            c+=1
	            a=0
	            break
	        else:
	            if b>0:
	                a=a-(v*(b+1))
	                c+=1
	            else:
	                a=a-v
	                c+=1
        print(c)

# your code goes here

import math
k,a,b,v=map(int,input().split())
#3 10 3 3
if(v>a):
    print(1)
else:
    if b+1<k:
    	a=a-v*(b+1)
    	ans=math.ceil(a/v)
    	print(ans+1)
    else:
        c=1
        a=a-(v*k)
        b=b-k+1
        print("initial a=",a,"b=",b,"k=",k)
        while(a>0):
	        if v>a:
	            c+=1
	            a=0
	            break
	        else:
	            if b>0:
	                a=a-(v*(b+1))
	                c+=1
	            else:
	                a=a-v
	                c+=1
        print(c)

# your code goes here

import math
k,a,b,v=map(int,input().split())
#3 10 3 3
if(v>a):
    print(1)
else:
    if b+1<k:
    	a=a-v*(b+1)
    	ans=math.ceil(a/v)
    	print(ans+1)
    else:

        c=1
        a=a-(v*k)
        b=b-k+1#
        #print("initial a=",a,"b=",b,"k=",k)
        while(a>0 and b>0):
	        if v*(b+1)>a:
	            c+=1
	            a=0
	            break
	        else:
	            if b>k:
	                a=a-(v*(k))#
	                c+=1#
	                b=b-(k-1)#
	            if(b<k):
	               a=a-v*(b+1)  #
	               c+=1#
	               b=0

        if(b==0 and a>0):
            c+=math.ceil(a/v)
        print(c)

import math
boxes = 0
k, a,b, v = map(int, input().split())
#b += 1
if k > (b+1):
  k = b + 1
numfb = b // (k - 1)
extrak = b % (k - 1)
a -= (numfb * k * v)
boxes += numfb
if extrak > 0 and a > 0:
  boxes += 1
  a -= (extrak + 1) * v
while a > 0:
  boxes += 1
  a -= v

print(boxes)

import math
boxes = 0
k, a,b, v = map(int, input().split())
k = max(b, k)
numfb = b // k
extrak = b % k
a -= (numfb * k * v)
boxes += numfb
if extrak > 0 and a > 0:
  boxes += 1
  a -= (extrak + 1) * v
while a > 0:
  boxes += 1
  a -= v

print(boxes)

import math
boxes = 0
k, a,b, v = map(int, input().split())
#b += 1
if k > (b+1):
  k = b + 1
numfb = b // (k - 1)
extrak = b % (k - 1)
while a > 0:
  boxes += 1
  a -= k * v
if extrak > 0 and a > 0:
  boxes += 1
  a -= (extrak + 1) * v
while a > 0:
  boxes += 1
  a -= v

print(boxes)

import math

def main():
    n = input().split()
    k = int(n[0])
    a = int(n[1])
    b = int(n[2])
    v = int(n[3])
    if k > b + 1 :
        print(1+max(math.ceil((a-(b+1)*v)/v ),0))
        return 0

    maxboxes = math.floor(b/(k-1))
    if maxboxes * k * v > a:
        print(math.ceil(a / ((k+1) * v)))
        return 0
    a = a - maxboxes * k * v  #remaining nuts after we pack max boxes
    print(maxboxes + math.ceil(a/v))
    return 0

if __name__ == "__main__": main()

import math

def main():
    n = input().split()
    k = int(n[0])
    a = int(n[1])
    b = int(n[2])
    v = int(n[3])
    if k > b + 1 :
        print(1+max(math.ceil((a-(b+1)*v)/v ),0))
        return 0

    maxboxes = math.floor(b/(k-1))
    if maxboxes * k * v > a:
        print(math.ceil(a / (k * v)))
        return 0
    a = a - maxboxes * k * v  #remaining nuts after we pack max boxes
    print(maxboxes + math.ceil(a/v))
    return 0

if __name__ == "__main__": main()

from math import ceil
k, a, b, v = [int(i) for i in input().split()]

print(max(ceil((a - b*v)/v), ceil(b/(k - 1))))

k, a, b, v = [int(x) for x in input().split()]
ans = 0
while a > 0:
	l = min(k - 1, b)
	b -= l
	a -= (l + 1) * k
	ans += 1
print(ans)

max_parts, n, divisors, k = map(int, input().split())
min_boxes = (divisors + max_parts - 2) // (max_parts - 1)
if (min_boxes + divisors) * k >= n:
    print(min_boxes)
else:
    left = n - (min_boxes + divisors) * k
    print(((left + k - 1) // k + min_boxes))

max_parts, n, divisors, nuts_in_part = map(int, input().split())
parts = (n + nuts_in_part - 1) // (nuts_in_part)
ans = parts - divisors
while ans * (max_parts - 1) < divisors:
    ans += 1
print(ans)

max_parts, n, divisors, k = map(int, input().split())
min_boxes = (divisors + max_parts - 2) // (max_parts - 1)
if (min_boxes + divisors) * k >= n:
    print(min_boxes)
else:
    print((n + k - 1) // k - divisors)

#k, a, b, v = map(int, input().split())

k, a, b, v = 3, 10, 1, 3
rezult = 0

box = {
    'sep': 0,
    'place': 0,
    'nuts': 0
}

while a > 0:
    if b >= 0:
        if b < k:
            box['sep'] = b
            box['place'] = b+1
            b = 0
        elif b == 0:
            box['sep'] = 0
            box['place'] = 1
        else:
            box['sep'] = k - 1
            box['place'] = k
            b -= box['sep']
    if a < v * box['place']:
        box['nuts'] = a
        a = 0
    else:
        a -= (v * box['place'])
    rezult += 1

print(rezult)

k, a, b, v = map(int, input().split())
cnt = 1
while True:
    if b + 1 - k < 0:
        use_b = b + 1
    else:
        use_b = k

    if use_b != 0:
        max_or = use_b * v
    else:
        max_or = v
    if a - max_or > 0:
        cnt += 1
        b = b - use_b
        a -= max_or
    else:
        print(cnt)
        break

k, a, b, v = map(int, input().split())
cnt = 1
while True:
    if b + 1 - k < 0:
        use_b = b + 1
    else:
        use_b = k

    if use_b != 0:
        max_or = use_b * v
    else:
        max_or = v
    if a - max_or >= 0:
        cnt += 1
        b = b - use_b
        a -= max_or
    else:
        print(cnt)
        break

max_section, nuts, divisor, capacity = map(int, input().split()) # max section , nuts, divisor , capacity
def lt(x):
    if x - int(x) > 0:
        return int(x) + 1
    return int(x)
max_divisor = max_section - 1
box_max_section = int(divisor/max_divisor)
extra_box_capacity = (divisor%max_divisor + 1)*capacity
if nuts > box_max_section*capacity:
    rs = box_max_section
    nuts -= box_max_section*max_section*capacity
    if nuts > extra_box_capacity:
        rs += 1 + lt((nuts-extra_box_capacity)/capacity)
    else:
        rs +=1
else:
    rs = lt(nuts/(box_max_section*(max_section+1)*capacity))
print(rs)

max_section, nuts, divisor, capacity = map(int, input().split()) # max section , nuts, divisor , capacity
def lt(x):
    if x - int(x) > 0:
        return int(x) + 1
    return int(x)
box_max_section = int(divisor/(max_section-1))
extra_box_capacity = (divisor%(max_section-1) + 1)*capacity
if nuts > box_max_section*capacity:
    rs = box_max_section
    nuts -= box_max_section*(max_section + 1)*capacity
    if nuts > extra_box_capacity:
        rs += 1 + lt((nuts-extra_box_capacity)/capacity)
    else:
        rs +=1
else:
    rs = lt(nuts/(box_max_section*(max_section+1)*capacity))
print(rs)

from math import ceil

k, a, b, v = list(map(int, input().split()))
Box = 0
while a:
    Section = min(b, k - 1) + 1
    b -= Section - 1
    Total = min(v, ceil((a - b) / Section))
    a -= min(a , Total * Section)
    Box += 1
print(Box)

# Let's see who is the best !!!
# ravenS_The_Best

l=[int(i) for i in input().split(" ")]
k=l[0]
a=l[1]
b=l[2]
v=l[3]
box=0
divs=0
while a>0:
    box+=1
    sections=1
    while a>0 and sections<=k and divs<=b:
        a-=v
        sections+=1
        divs+=1
    if(divs>b):
        while a>0:
            a-=v
            box+=1
print(box)

import sys

if __name__ == "__main__":
    line = sys.stdin.readline()
    items = line.split()
    k = int(items[0])
    a = int(items[1])
    b = int(items[2])
    v = int(items[3])
    box = 0

    while b >= v-1 and a > 0:
        box += 1
        a -= k * v
        b -= v-1

    if a <= 0:
        print box
    else:
        if a % v == 0:
            sec_need = a / v
        else:
            sec_need = a / v + 1

        if sec_need > b+1:
            box += 1 + sec_need - (b+1)
        else:
            box += 1
        print box

# -*- coding: utf-8 -*-
k, a, b, v = map(int, raw_input().split())

# k — максимальное количество отсеков в коробке,
# a - количество орехов,
# b - количество разделителей
# v - вместительность каждого отсека коробки.
n = 0
b_boxes_num, b_left = (b / (k - 1), b % (k - 1)) if k > 1 else (0, 0)
extra_box_volume = (b_left + 1) * v

if a <= b_boxes_num * k * v:
    n = a / (k * v)
else:
    a -= b_boxes_num * k * v
    n += b_boxes_num

    a -= extra_box_volume
    n += 1

    if a > 0:
        n += a / v
        n += 1 if a % v > 0 else 0

print n

import sys
import math

inp = sys.stdin.readline().rstrip('\n').split(' ')
k = int(inp[0]) # sections in a box
a = int(inp[1]) # # of nuts
b = int(inp[2]) # # of divisors
v = int(inp[3]) # capacity of each section.

boxNum = 0

while (a >= 1):
	boxNum += 1
	boxSection = k
	while (b > k and b > 0):
		boxSection += 1
		b -= 1
	# subtract nuts
	if (math.floor(a/boxSection) < 1):
		a = 0
	else:
		a -= math.floor(a/boxSection)*v

print boxNum

#v1
k,a,b,v=map(int,raw_input().split())
n=(a+v-1)/v
d=b/(k-1)*k
if d<n:
  n-=d
  x=b/(k-1)
  b%=k-1
  if b+1<n:
    n-=b+1
    x+=1
  print x+n
else:
  print (n+k-1)/k

import sys
import math

line = sys.stdin.readline()
z = line.split()
k = int(z[0])
a = int(z[1])
b = int(z[2])
v = int(z[3])

numBoxes = 1
numSections = 1
a = a-v
while(a >= 0):
    if(numSections == k):
        numBoxes +=1
        numSections = 1
        a = a-v
    elif b==0:
        numBoxes +=1
        numSections = 1
        a = a-v
    else:
        numSections +=1
        b -= 1
        a = a-v
print numBoxes

##if(a < v*(b+1)):
##    print int(math.ceil(float(a)/float(k*v)))
##else:
##    n = int(math.ceil(float(a)/float(k*v)))
##    n1 = int(math.ceil(float(a - v*(b+1))/float(v)))
##    print n + n1
##
##

ri = lambda: raw_input().strip()

# n = int(ri())
# #n, m = map(int, ri().split())

k, a, b, v = map(int, ri().split())

count = 0
while (b >= k-1) and (a >= k*v):
    b -= k-1
    a -= k*v
    count += 1

while (b > 0) and (a > 0):
    a -= (b+1) * v
    count += 1

while a > 0:
    a -= v
    count += 1

print count

import math

def ceil(x, y):
    return int(math.ceil(float(x)/y))

def nuts(a, k, v, b):
    n = ceil(a, v)
    m = ceil(b, k-1)
    if n >= b + m:
        p = n - b
    else:
        p = ceil(n, k)
    return p

k, a, b, v = map(int, raw_input("k, a, b, v = ").split())
print nuts(a, k, v, b)

import sys,math

k,a,b,v=map(int,raw_input().split())
dozen=0
if k>b:
    maxdoos=(b+1)*v
    dozen=1
    rest=a-maxdoos
    if rest>0:
        dozen+=rest/v
        if rest%v>0:
            dozen+=1

else:
    maxdoos=k*v
    while b-k+1>=0:
        dozen+=1
        rest=a-maxdoos
        b-=k-1
        if rest>0:
            dozen+=rest/v
            if rest%v>0:
                dozen+=1

print dozen

import sys,math

maxsec,noten,planken,notsec=map(int,raw_input().split())

dozen=min(noten/(notsec*maxsec),planken/(maxsec-1))
noten-=dozen*notsec*maxsec
planken-=dozen*(maxsec-1)

sec=noten/notsec+int(noten%notsec>0)
if sec>=maxsec:
    dozen+=1
    noten-=(planken+1)*notsec

if noten>0:
    dozen+=noten/notsec+int(noten%notsec>0)

print dozen

import sys,math

maxsec,noten,planken,notsec=map(int,raw_input().split())

dozen=min(noten/(notsec*maxsec),planken/(maxsec-1))
noten-=dozen*notsec*maxsec
planken-=dozen*(maxsec-1)

sec=noten/notsec+int(noten%notsec>0)
if sec>=planken+1:
    dozen+=1
    noten-=(planken+1)*notsec
    if noten>0:
        dozen+=noten/notsec+int(noten%notsec>0)
else:
    dozen+=1

print dozen

import sys

k, a, b, v = map(int, raw_input().split())
ans = 0
k -= 1
while True:

    ans += 1
    x, y = divmod(b, k)
    have = ans
    ican = min(x, have) * (k + 1) * v
    have -= min(x, have)
    if have > 0:
        have -= 1
        ican += (y + 1) * v
    ican += have
    if ican >= a:
        break

print ans

import sys

inp = sys.stdin.readlines()
ctr = 0

x = inp[ctr].split()
k = int(x[0])
a = int(x[1])
b = int(x[2])
v = int(x[3])
ctr+=1
ans = 0
while True:
   if b >= k-1:
      b -= k-1
      a -= k*v
      ans += 1
      if a < 0:
         break
   elif b > 0:
        a -= (b+1)*v
        b = 0
        ans += 1
        if a < 0:
          break
   else:
        ans += a/v
        if a%v!=0:
           ans +=1
        break
print ans

k,a,b,v=map(int,raw_input().split())

res = 0
aa = a

while a>0:
    vv = max(v,b)
    b -= vv
    a -= vv + 1
    res+=1

print res

k,a,b,v = map(int,raw_input().split())
boxes = 0
while a>=0:
    if b>=k:
        a = a-k*v
        b = b-k+1
        boxes += 1
    elif b>0:
        a = a-(b+1)*v
        b = 0
        boxes += 1
    else:
        a = a-v
        boxes += 1
print boxes

(k, a, b, v), c = map(int, raw_input().split()), 0
while a > 0 and b > 0:
	a -= v * min(b + 1, k)
	b -= min(b, k - 1)
	c += 1
print c + max((a + k - 1) / k, 0)

first = map(int,raw_input().split())

#max num of sections
k = first[0]
#num of nuts
a = first[1]
#num of divisors
b = first[2]
#capacity of each section
v = first[3]

boxes = 0

while a > 0:

    if b+1 > k:

        b = b - (k-1)
        a = a - (v*k)
        boxes += 1

    #elif b+1 < k:
    else:
        a = a - (b+1)*k
        b = b - b
        boxes += 1

print boxes

l=lambda:map(int,raw_input().split())
sec,n,di,v=l()
boxes=di/(sec-1)
if n%v==0:
    needsec=n/v
else:
    needsec=n/v+1
cnt=0
i=1
while i<=boxes:
    cnt+=sec
    if cnt>=needsec:
        print i
        exit()
    i+=1
r=n-sec*v
rdi=di%(sec-1)
if rdi==0:
    print boxes + [r/v+1,r/v][r%v==0]
else:
    if r<=(rdi+1)*v:
        print boxes+1
    else:
        r=r-(rdi+1)*v
        boxes+=1
        print boxes + [r/v+1,r/v][r%v==0]

I=lambda:map(int, raw_input().split())
k, a, b, v = I()
full, half = b / (k-1), b % (k-1)
x = full * v * k
#print full, half
if x >= a:
    print full
else:
    if a - x <= (half + 1)*v:
        print full + 1
    else:
        print full + 1 + (a - x - (half + 1) * v + v - 1)/ v

#!/usr/bin/env python
# -*- coding: utf-8 -*-
# Jonathan Prieto - d555

import sys
# sys.stdin = open("inputA.txt", "r")

def solve():
    k,a,b,v = map(int, raw_input().split())
    cajas = 0
    while a > v:
        cajas = cajas + 1
        secusadas = 1
        a = a - v
        while secusadas <= k and a >= v and b > 0:
            a = a - v
            b = b - 1
            secusadas += 1

    if a != 0:
        cajas = cajas + 1
    print cajas

solve()

#!/usr/bin/env python
# -*- coding: utf-8 -*-
# Jonathan Prieto - d555

import sys
# sys.stdin = open("inputA.txt", "r")

def solve():
    k,a,b,v = map(int, raw_input().split())
    cajas = 0
    while a >= v:
        cajas = cajas + 1
        secusadas = 1
        a = a - v
        while secusadas < k and a >= v and b > 0:
            a = a - v
            b = b - 1
            secusadas += 1

    if a != 0:
        cajas = cajas + 1
    print cajas

solve()

#!/usr/bin/env python
# -*- coding: utf-8 -*-
# Jonathan Prieto - d555

import sys
# sys.stdin = open("inputA.txt", "r")

def solve():
    k,a,b,v = map(int, raw_input().split())
    cajas = 0
    while a >= v:
        cajas = cajas + 1
        secusadas = 1
        a = a - v
        while secusadas <= k and a >= v and b > 0:
            a = a - v
            b = b - 1
            secusadas += 1

    if a != 0:
        cajas = cajas + 1
    print cajas

solve()

k,a,b,v = map(int,raw_input().split())
count = 0
while a > 0 or b > 0 :
    if b >= k-1:
        a = a - v*k
        b = b - (k-1)
    else:
        a = a - v*(b+1)
        b = 0
    count += 1
if a > 0:
    count += int(math.ceil(a/v))
print count

def main():
    k_sec,nut,b_div,v_max=map(int,raw_input().split())
    if nut<=v_max:
        print 1
        return
    #nut>v_max
    rest= nut%v_max
    max_sec=nut/v_max
    if rest!=0:
        max_sec+=1
    #need max_sec
    num_box=max_sec
    cur_box_sec=1
    #print max_sec
    while b_div>=0 and num_box>=1:
        if cur_box_sec>(k_sec-1):
            cur_box_sec=1

        else:
            cur_box_sec+=1
            b_div-=1
            num_box-=1
    print num_box+1

main()

def main():
    k_sec,nut,b_div,v_max=map(int,raw_input().split())
    if nut<=v_max:
        print 1
        return
    #nut>v_max
    rest= nut%v_max
    max_sec=nut/v_max
    if rest!=0:
        max_sec+=1
    #need max_sec
    #num_box=max_sec
    num_box=0
    cur_box_sec=1
    while max_sec:
        if b_div:
            if cur_box_sec>=k_sec:
                num_box+=1
                cur_box_sec=1
            else:
                cur_box_sec+=1
                max_sec-=1
                b_div-=1
        else:
            num_box+=1
            max_sec-=1
    print num_box

main()

def main():
    k_sec,nut,b_div,v_max=map(int,raw_input().split())
    if nut<=v_max:
        print 1
        return
    #nut>v_max
    rest= nut%v_max
    max_sec=nut/v_max
    if rest!=0:
        max_sec+=1
    #need max_sec
    num_box=max_sec
    cur_box_sec=1
    #print max_sec
    while b_div>=0 and num_box>1:
        if cur_box_sec>(k_sec-1):
            cur_box_sec=1

        else:
            cur_box_sec+=1
            b_div-=1
            num_box-=1
    print num_box+1

main()


Amr doesn't like Maths as he finds it really boring, so he usually sleeps in Maths lectures. But one day the teacher suspected that Amr is sleeping and asked him a question to make sure he wasn't.First he gave Amr two positive integers n and k. Then he asked Amr, how many integer numbers x > 0 exist such that:  Decimal representation of x (without leading zeroes) consists of exactly n digits;  There exists some integer y > 0 such that:   ;  decimal representation of y is a suffix of decimal representation of x.  As the answer to this question may be pretty huge the teacher asked Amr to output only its remainder modulo a number m.Can you help Amr escape this embarrassing situation?

Input consists of three integers n, k, m (1 ≤ n ≤ 1000, 1 ≤ k ≤ 100, 1 ≤ m ≤ 109).

NoteA suffix of a string S is a non-empty string that can be obtained by removing some number (possibly, zero) of first characters from S.

def get_input():
    hahaha=input()
    (n,k,m)=hahaha.split(sep=None, maxsplit=1000)
    return (int(n),int(k),int(m))
(n,k,m)=get_input()
f=[0 for i in range(k)]
s=0
for v in range(n):
    tens = 10**v%k
    f=[  (sum(   [f[(j+k-(x+1)*tens)%k] for x in range(9)] )+f[j])%m       for j in range(k)]
    for x in range(9):
        f[(x+1)*tens%k]+=1
    if n-v-1==0:
        s+=(f[0]%m)
    else:
        s+=f[0]*((10**(n-v-2)*9))%m
    f[0]=0
print(s%m)

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

import sys
import math
import random
import operator
from fractions import Fraction, gcd
from decimal import Decimal, getcontext
from itertools import product, permutations, combinations
getcontext().prec = 100

MOD = 10**9 + 7
INF = float("+inf")

n, k, m = map(int, raw_input().split())

if k == 1:
    print (pow(10, n, m) - pow(10, n - 1, m)) % m
    quit()

pow9_10 = []
p = 1
for i in range(n):
    pow9_10.append(p)
    if i == 0:
        p = (p * 9) % m
    else:
        p = (p * 10) % m

res = 0
counts = [0] * k
counts[0] = 1

p10i = 1
for i in xrange(n):
    counts2 = [0] * k
    for r in xrange(k):
        mind = 1 if i == n else 0
        for d in xrange(mind, 10):
            r2 = (d * p10i + r) % k
            counts2[r2] += counts[r]
            counts2[r2] %= m

    add = (counts2[0] - 1) * pow9_10[n - i - 1]
    res += add
    res %= m
    # print i, res
    counts2[0] = 1
    counts = counts2

    p10i = (p10i * 10) % k
print res % m

def main():
    n, k, m = map(int, raw_input().split())
    if k == 1:
        print 9 * pow(10, n - 1, m) % m
        return
    if n == 1:
        print len([i for i in xrange(1, 10) if i % k == 0]) % m
        return
    dp = [0] * k
    for i in xrange(10):
        if i % k:
            dp[i%k] += 1
    t = 10 % k
    kk = [[i * j % k for j in xrange(11)] for i in xrange(k)]
    for i in xrange(n - 1):
        ndp = [0] * k
        for j in xrange(1, k):
            for l in xrange(i == n - 2, 10):
                x = j + kk[t][l]
                if x >= k:
                    x -= k
                if x:
                    ndp[x] += dp[j]
                    if ndp[x] >= m:
                        ndp[x] -= m
        for l in xrange(i == n - 2, 10):
            if kk[t][l]:
                ndp[kk[t][l]] += 1
        dp = ndp[:]
        t = kk[t][10]
    print (9 * pow(10, n - 1, m) - sum(dp) % m + m) % m
main()

line = map(int, raw_input().split())
n = line[0]
k = line[1]
m = line[2]

t = [[0 for _ in xrange(k)] for _ in xrange(n)]

#base = 1
#for i in xrange(n):
#    base *= 10
#    top = base - 1
#    r[i] = (int(top / k) + 1) % m
    #r[0][i % k] += 1

#base = 1
#for i in xrange(1, n):
    #base *= 10
    #if (i == n - 1): start = 1
    #else: start = 0
    #for c in xrange(start, 10):
        #offset = (c * base) % k
        #for j in xrange(k):
            ##for pre in xrange(i):
            #r[i][j] += r[i - 1][(j - offset) % k]
            #r[i][j] %= m

t[0][0] = 9 // k
base = 1
for i in xrange(1, n):
    base *= 10
    if (i == n - 1):
        t[i][0] = ((10 * base - 1) // k - (base - 1) // k) % m
        start = 1
    else:
        t[i][0] = ((10 * base - 1) // k) % m
        start = 0
    baser = base % k
    offset = ((start - 1) * base) % k
    for c in xrange(start, 10):
        offset += base
        offset %= k
        for j in xrange(k):
            idx = (offset + j) % k
            if (idx != 0):
                t[i][idx] += t[i - 1][j]
                t[i][idx] %= m
print sum(t[n - 1]) % m

from bisect import bisect_left as bl
from bisect import bisect_right as br
import heapq
import math
from collections import *
from functools import reduce,cmp_to_key
import sys
input = sys.stdin.readline

# M = mod = 998244353
def factors(n):return sorted(list(set(reduce(list.__add__,([i, n//i] for i in range(1, int(n**0.5) + 1) if n % i == 0)))))
# def inv_mod(n):return pow(n, mod - 2, mod)

def li():return [int(i) for i in input().rstrip('\n').split(' ')]
def st():return input().rstrip('\n')
def val():return int(input().rstrip('\n'))
def li2():return [i for i in input().rstrip('\n').split(' ')]
def li3():return [int(i) for i in input().rstrip('\n')]

def find(a,mod,n):
    rem = n - len(bin(a)[2:])
    ans = 0
    while rem:
        temp = min(rem,50)
        ans = (ans + 2**temp)%mod
        rem -= temp
    return ans

n, k, m = li()
f=[0 for i in range(k)]
s=0
for v in range(n):
    tens = 10**v%k
    f=[  (sum(   [f[(j+k-(x+1)*tens)%k] for x in range(9)] )+f[j])%m       for j in range(k)]
    for x in range(9):
        f[(x+1)*tens%k]+=1
    if n-v-1==0:
        s+=(f[0]%m)
    else:
        s+=f[0]*((10**(n-v-2)*9))%m
    f[0]=0
print(s%m)

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

import sys
import math
import random
import operator
from fractions import Fraction, gcd
from decimal import Decimal, getcontext
from itertools import product, permutations, combinations
getcontext().prec = 100

MOD = 10**9 + 7
INF = float("+inf")

n, k, m = map(int, raw_input().split())

if k == 1:
    print (pow(10, n, m) - 1) % m
    quit()

def pow9_10(x):
    res = 1
    if x > 0:
        res *= 9
    if x > 1:
        res *= pow(10, x - 1, m)
    return res % m

def count_div_upto_pow10(e, kk):
    q, r = divmod(pow(10, e), kk)
    if r == 0:
        q -= 1
    return q

def count_div_interval(e1, e2, kk):
    return count_div_upto_pow10(e2, kk) - count_div_upto_pow10(e1, kk)

def cut_pow10(e):
    return pow(10, e) if e > 0 else 1

res = 0
counts = {r: 0 for r in xrange(k)}
counts[0] = 1

for i in xrange(n):
    print i, ":",
    p10 = pow(10, i)

    counts2 = {r: 0 for r in xrange(k)}
    for r in xrange(k):
        mind = 1 if i == n else 0
        for d in xrange(mind, 10):
            r2 = (d * pow(10, i, k) + r) % k
            counts2[r2] += counts[r]
    print counts2
    add = (counts2[0] - 1) * pow9_10(n - i - 1)
    res += add
    print "ADD", counts2[0], "*", pow9_10(n - i - 1), "=", add
    counts2[0] = 1
    counts = counts2
print res % m

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

import sys
import math
import random
import operator
from fractions import Fraction, gcd
from decimal import Decimal, getcontext
from itertools import product, permutations, combinations
getcontext().prec = 100

MOD = 10**9 + 7
INF = float("+inf")

n, k, m = map(int, raw_input().split())

if k == 1:
    print (pow(10, n, m) - 1) % m
    quit()

def pow9_10(x):
    res = 1
    if x > 0:
        res *= 9
    if x > 1:
        res *= pow(10, x - 1, m)
    return res % m

res = 0
counts = [0] * k
counts[0] = 1

p10i = 1
for i in xrange(n):
    counts2 = [0] * k
    for r in xrange(k):
        mind = 1 if i == n else 0
        for d in xrange(mind, 10):
            r2 = (d * p10i + r) % k
            counts2[r2] += counts[r]

    add = (counts2[0] - 1) * pow9_10(n - i - 1)
    res += add

    counts2[0] = 1
    counts = counts2

    p10i = (p10i * 10) % k
print res % m

def main():
    n, k, m = map(int, raw_input().split())
    if k == 1:
        print 0
        return
    if n == 1:
        print len([i for i in xrange(1, 10) if i % k]) % m
        return
    dp = [0] * k
    for i in xrange(10):
        if i % k:
            dp[i%k] += 1
    t = 10 % k
    kk = [[i * j % k for j in xrange(11)] for i in xrange(k)]
    for i in xrange(n - 1):
        ndp = [0] * k
        for j in xrange(1, k):
            for l in xrange(i == n - 2, 10):
                x = j + kk[t][l]
                if x >= k:
                    x -= k
                if x:
                    ndp[x] += dp[j]
                    if ndp[x] >= m:
                        ndp[x] -= m
        for l in xrange(i == n - 2, 10):
            if kk[t][l]:
                ndp[kk[t][l]] += 1
        dp = ndp[:]
        t = kk[t][10]
    print (9 * pow(10, n - 1, m) - sum(dp) % m + m) % m
main()

global debug
debug = 0

line = map(int, raw_input().split())
n = line[0]
k = line[1]
m = line[2]

#r = [[0 for _ in xrange(k)] for _ in xrange(n)]
#r = [0 for _ in xrange(n)]
t = [[0 for _ in xrange(k)] for _ in xrange(n)]

#base = 1
#for i in xrange(n):
#    base *= 10
#    top = base - 1
#    r[i] = (int(top / k) + 1) % m
    #r[0][i % k] += 1

#base = 1
#for i in xrange(1, n):
    #base *= 10
    #if (i == n - 1): start = 1
    #else: start = 0
    #for c in xrange(start, 10):
        #offset = (c * base) % k
        #for j in xrange(k):
            ##for pre in xrange(i):
            #r[i][j] += r[i - 1][(j - offset) % k]
            #r[i][j] %= m
#if (debug >= 2): print r

t[0][0] = 9 // k
base = 1
for i in xrange(1, n):
    base *= 10
    if (i == n - 1):
        t[i][0] = (9 * base // k) % m
        start = 1
    else:
        t[i][0] = ((10 * base - 1) // k) % m
        start = 0
    baser = base % k
    offset = ((start - 1) * baser) % k
    for c in xrange(start, 10):
        offset += baser
        offset %= k
        for j in xrange(k):
            idx = (offset + j) % k
            if (idx != 0):
                t[i][idx] += t[i - 1][j]
                t[i][idx] %= m
if (debug >= 2): print t
print sum(t[n - 1]) % m


Do you remember a kind cartoon "Beauty and the Beast"? No, no, there was no firing from machine guns or radiation mutants time-travels!There was a beauty named Belle. Once she had violated the Beast's order and visited the West Wing. After that she was banished from the castle... Everybody was upset. The beautiful Belle was upset, so was the Beast, so was Lumiere the candlestick. But the worst thing was that Cogsworth was upset. Cogsworth is not a human, but is the mantel clock, which was often used as an alarm clock.Due to Cogsworth's frustration all the inhabitants of the castle were in trouble: now they could not determine when it was time to drink morning tea, and when it was time for an evening stroll. Fortunately, deep in the basement are lying digital clock showing the time in the format HH:MM. Now the residents of the castle face a difficult task. They should turn Cogsworth's hour and minute mustache hands in such a way, that Cogsworth began to show the correct time. Moreover they need to find turn angles in degrees for each mustache hands. The initial time showed by Cogsworth is 12:00.You can only rotate the hands forward, that is, as is shown in the picture:   As since there are many ways too select such angles because of full rotations, choose the smallest angles in the right (non-negative) direction.Note that Cogsworth's hour and minute mustache hands move evenly and continuously. Hands are moving independently, so when turning one hand the other hand remains standing still.

The only line of input contains current time according to the digital clock, formatted as HH:MM (00 ≤ HH ≤ 23, 00 ≤ MM ≤ 59). The mantel clock initially shows 12:00. Pretests contain times of the beginning of some morning TV programs of the Channel One Russia.

Print two numbers x and y — the angles of turning the hour and minute hands, respectively (0 ≤ x, y < 360). The absolute or relative error in the answer should not exceed 10 - 9.

NoteA note to the second example: the hour hand will be positioned exactly in the middle, between 4 and 5.

h, m = (int(i) for i in input().split(":"))

nh = h*30 + (30*m)/60
nm = 6*m

print(nh%360, nm)

#Problem 80B

def input():
	st = raw_input().split(":")
	if(st[0][0] == "0"): st[0] = st[0][1:]
	if(st[1][0] == "0"): st[1] = st[1][1:]
	return (eval(st[0]), eval(st[1]))

def solve():
	h, m = input()
	h %= 12
	h += float(m) / 60
	return (h * 30, m * 6)

res = solve()
if(res[0] - int(res[0]) > 0): print '%0.1f %i' % res
else: print '%0.0f %i' % res

from sys import stdin

(hh, mm) = [int(x) for x in stdin.readline().strip().split(':')]

hh %= 12

print(str((hh*60.0+mm)*360/(60*12))+' '+str(mm*6))

import fileinput

line = fileinput.input()
v = line[0].split(':')
hh = float(v[0])
nn = float(v[1])
y = 6 * nn
x = (30 * hh + 1.0 / 12.0 * y) % 360
print (str(x) + ' ' + str(y))

s = raw_input()
h, m = [int(i) for i in s.split(':')]
M = m*6
H = 30*(h % 12) + m*.5
print H,M

time = input()

hh = int(time[:2])
mm = int(time[3:])

if hh >= 12:
	r = int(hh)-12
else:
	r = int(hh)

print(r*30+int(mm)/2,mm*6)

import sys
import math
import bisect

def solve(s):
    h = int(s[0:2])
    h %= 12
    m = int(s[3:])
    h = (h * 60 + m) * (360) / (60 * 12)
    m = m * 360 / 60
    return (h, m)

def main():
    ans = solve(input())
    print('%.10f %.10f' % (ans[0], ans[1]))

if __name__ == "__main__":
    main()

import sys

h, m = map(int, sys.stdin.readline().strip().split(':'))

h %= 12
print ' '.join(map(str, [(h + m / 60.0) * 30, m * 6]))

s=input()

h=int(s[:2])

m=int(s[3:])

print(h%12*30+m/2,m*6)

# Made By Mostafa_Khaled

inp = input().split(':')
hh = int(inp[0])
mm = int(inp[1])

if hh>=12:
    hh=hh-12

degreesHH = hh*30+mm*0.5
if(degreesHH%1==0):
    degreesHH = int(degreesHH)
degreesHH = str(degreesHH)
degreesMM = str(mm*6)
print(degreesHH+" "+degreesMM)

def main():
	h, m = map(int, raw_input().split(":"))
	x = h % 12 * 30 + m / 2.0
	y = m * 6
	print x, y

if __name__ == "__main__": main()

import sys
import math

lines = [i.rstrip() for i in sys.stdin.readlines()]
s = lines[0].split(":")
h = float(s[0]) % 12.0
m = float(s[1])

print "%g %g" % ((h + m / 60) / 12.0 * 360.0, m / 60.0 * 360.0)

h, m = map(int, raw_input().split(":"))
h = h % 12
print h * 30 + m / 2.0, m * 6

import sys

def ans(x):
    minutes = (x[1])*6.0
    hours = (x[0]%12)*30
    extra = ((x[1])*(0.5))
    hours+=extra

    check1 = check(hours)
    check2 = check(minutes)
    if check1:
        hours = int(hours)

    if check2:
        minutes = int(minutes)

    return [hours, minutes]

def check(x):
    out = str(x)
    k = out.strip().split('.')
    k = k[1]
    for i in range(len(k)):
        if k[i] is not '0':
            return False

    return True

x = list(map(int, input().strip().split(':')))

out = ans(x)
print(out[0], end  = ' ')
print(out[1])

def main():
	x,y = map(int, raw_input().split(':'))
	print (x%12)*30 + y*0.5, y*6

main()

h, m = map(int, raw_input().split(':'))
if h >= 12: h -= 12

x = 30*h + 30*(float(m)/60)
if not x - int(x):
    x = int(x)

print x, (360/60)*m

h,m = map(int, input().split(':'))
if h >=12:
    h-=12
print(float(30*h+m/2), m*6)

s=raw_input().split(':')
h=int(s[0])%12
m=int(s[1])

if(m%2):
	print h*30+m/2.0,
else:
	print h*30+m/2,
print m*6

x=input()
min=int(x[3:])
hour=int(x[:2])
if hour>=12:
	hour-=12

m=min/2
k=int(min/2)
if(m==k):
	hour=hour*30+k
else:
	hour=hour*30+m
print(hour," ",min*6)

t = raw_input()
t = t.strip().split(":")
hh = float(t[0])
mm = float(t[1])

hh_mm = mm/60.0

hh = hh+hh_mm

hh_angle = (hh/12)*360

mm_angle = (mm/60)*360

hh_angle = hh_angle%360
mm_angle = mm_angle%360

print hh_angle, mm_angle

# To change this template, choose Tools | Templates
# and open the template in the editor.
__author__="yaroslav"
__date__ ="$02.08.2011 18:00:13$"

if __name__ == "__main__":
    params = raw_input().rsplit(':')
    hour = float(params[0])
    min = float(params[1])

    hour = ((hour-12)/12+min/(60*12))*360
    if hour<0:
        hour = 360 + hour
    min = min*6
    print str(hour)+" "+str(min)

from math import pi

h, m = raw_input().split(':')

h = float(h) % 12
m = float(m)

an_m = m / 60 * 360
an_h = h / 12 * 360 + an_m / 12

print an_h,  an_m

import sys
#sys.stdin = open ('input.txt')
#sys.stdout = open ('output.txt', 'w')

h, m = map (float, raw_input ().split (':'))
h += m / 60.
x = 30. * (h % 12)
y = 6. * m
print x, y

time = input()

hh = int(time[:2])
mm = int(time[3:])

if hh >= 12:
	r = int(hh)-12
else:
	r = int(hh)

print(r*30+int(mm)/2,mm*6)

i = input()
sarr = i.split(":")
t = int(sarr[0])
l = int(sarr[1])
if t >= 12:
    t -= 12
ang2 = 6*l
tempAng = 30*(l/60)
ang1 = (30*t) + tempAng
if ang1==int(ang1):
  ang1=int(ang1)
print(str(ang1)+" "+str(int(ang2)))

input_string = str(input())
time_list = input_string.split(':')
hour = int(time_list[0])%12
minutes = int(time_list[1])%60
hour_degree = (30*hour) + (minutes/2)
minute_degree = minutes*6
print(str('{0:g}'.format(hour_degree)) + ' ' + str(minute_degree))

import sys

h, m = map(int, sys.stdin.readline().strip().split(':'))

h %= 12
print ' '.join(map(str, [(h + m / 60.0) * 30, m * 6]))

import sys
from array import array  # noqa: F401

def input():
    return sys.stdin.buffer.readline().decode('utf-8')

h, m = map(int, input().split(':'))
h %= 12
print((h * 60 + m) / 2, m * 6)

hours, mins = input().split(':')

hours = int(hours)
mins = int(mins)

if hours >= 12:
    hours -= 12

hour_rotation = hours / 12 * 360 + (mins / 60 * 360/12)
min_rotation = mins / 60 * 360

print(hour_rotation)
print(min_rotation)

s = input().strip()
hour, minute = map(int, s.split(':'))
if hour > 12:
	hour -= 12
hAngle = 0.5*(hour*60 + minute)
mAngle = 6*minute

if hAngle >= 360:
	hAngle = hAngle-360

if mAngle >= 360:
	mAngle = mAngle-360

print(hAngle, mAngle)

HH, MM = map(int, input().split(':'))

print(30*(HH%12)+MM/2, 6*MM)

time = map(int, str(raw_input()).split(':'))
time[0] %= 12
ha = 30*time[0] + time[1]/2.0
#if(ha%int(ha) == 0):
#    print int(ha), time[1]*6
#else:
print round(ha,1), time[1]*6

def readln(): return tuple(map(int, input().split()))

hh, mm = tuple(map(int, input().split(':')))
print(30 * (hh % 12) + 0.5 * mm, 6 * mm)

h, m = map(int, raw_input().split(":"))
h = h % 12
print h * 30 + m / 2.0, m * 6

hh,mm=map(int,raw_input().split(':'))
hh%=12
hd=hh*30+mm*.5
md=mm*6
print hd,md

import sys
import string

readLineInt = lambda: map( int, raw_input().split())
readLineStr = lambda: raw_input.split()
readTextInt = lambda: map( int, sys.stdin.read().split())
readTextStr = lambda: sys.stdin.read().split()

def main():
   h, m = map( float, raw_input().split(':'))
   if h >= 12:
      h -= 12
   print h * 30 + m / 2, m * 6

if __name__ == '__main__':
   main()

'''
Created on 2011-4-19

@author: Administrator
'''
str = raw_input()
len = len(str)

s1 = str[0:2]
s2 = str[3:5]
num1 = int(s1)
num2 = int(s2)

def count_x(hous,min):
    hous = hous % 12
    return hous * 30 + min / 2.0

def count_y(hous,min):
    return min * 6

print count_x(num1,num2),count_y(num1,num2)

hh, mm = map(int, input().split(":"))

print((hh%12)*30 + mm/2, mm*6)

time = input()
hours = int(time[0]) * 10 + int(time[1])
minutes = int(time[3]) * 10 + int(time[4])
hours = hours % 12
angle1 = hours * 30 + minutes // 2
if minutes % 2 == 1:
    angle1 += 0.5
angle2 = minutes * 6
print(angle1, angle2)

line = raw_input().split(':')

h = int(line[0])
m = int(line[1])

if h >= 12:
    h -= 12

mans = 6 * m
hans = 30 * h + m / 2.0
if hans == int(hans):
    hans = int(hans)

print str(hans) + " " + str(mans)

if __name__ == '__main__':
    ti = input()
    ti = ti.split(':')
    hr = int(ti[0])
    mi = int(ti[1])
    turn_hour = 0
    turn_min = mi * 6
    turn_hour = (hr%12)*30 + mi*0.5

    print(turn_hour, turn_min)

h, m = map(int, raw_input().split(":"))
print h % 12 * 30 + m / 2., m * 6

h,m = (int(x) for x in raw_input().split(':'))
h %= 12
rm = m*6
rh = h*30

if m%2==1: rh += m/2.0
else: rh += m/2

print rh,rm

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

h, m = (int(i) for i in raw_input().split(':'))

if h >= 12:
    h -= 12

print(str(30 * h + m * 0.5) + ' ' + str(6 * m))

from sys import stdin

(hh, mm) = [int(x) for x in stdin.readline().strip().split(':')]

hh %= 12

print(str((hh*60.0+mm)*360/(60*12))+' '+str(mm*6))

import  sys

h, m = sys.stdin.readline().strip().split(":")

h = int(h)
m = int(m)

if (h>=12):
    h = h - 12
ah = (h*60 + m)*0.5
am = m*6

print ah, " ", am

takes = str(input())
clocks = takes.split(':')
h = int(clocks[0])
if h>12:
    h = h-12
m = int(clocks[1])
temp = 30*h
if h == 12 :
    temp = 0
hans = temp + 0.5*m
mans = 6*m
print(hans, mans)

line_parts = raw_input().split(':')
hour = float(line_parts[0])
mins = float(line_parts[1])

min_rotation = (360.0/ 60.0) * mins
hour_rotation = ((360.0 / 12.0) * hour) + ((30.0/60.0)*mins)

print hour_rotation % 360.0, min_rotation % 360.0

def readln(): return tuple(map(int, input().split()))

hh, mm = tuple(map(int, input().split(':')))
print(30 * (hh % 12) + 0.5 * mm, 6 * mm)

h, m = (int(i) for i in input().split(":"))

nh = h*30 + (30*m)/60
nm = 6*m

if nh == 360:
    nh = 0
print(nh, nm)

takes = str(input())
clocks = takes.split(':')
h = int(clocks[0])
m = int(clocks[1])
temp = 30*h
if h == 12 :
    temp = 0
if m != 0:
    hans = temp + 30/(60/m)
    mans = 360/(60/m)
    print(hans, mans)
else:
    print(temp,m)

takes = str(input())
clocks = takes.split(':')
h = int(clocks[0])
m = int(clocks[1])
if m != 0:
    temp = 30*h
    hans = temp + 30/(60/m)
    mans = 360/(60/m)
    print(hans, mans)
else:
    if(h*30)!=360:
        print(h*30,m)
    else:
        print(0,m)

clock = input()
hours, minutes = clock.split(':')
hours = int(hours)
minutes = int(minutes)

if hours == 12:
    hours_angle = 0
else:
    hours_angle = (hours * 30) + ((minutes / 60) * 30)

if minutes == 0:
    minutes_angle = 0
else:
    minutes_angle = (minutes / 60) * 360

print(hours_angle, " ", minutes_angle)

clock = input()
hours, minutes = clock.split(':')
hours = int(hours)
minutes = int(minutes)

if hours == 0:
    hours_angle = 0
else:
    hours_angle = (hours * 30) + ((minutes / 60) * 30)

if minutes == 0:
    minutes_angle = 0
else:
    minutes_angle = (minutes / 60) * 360

print(hours_angle, " ", minutes_angle)

clock = input()
hours, minutes = clock.split(':')
hours = int(hours)
minutes = int(minutes)

if hours == 12:
    hours_angle = ((minutes / 60) * 30)
else:
    hours_angle = (hours * 30) + ((minutes / 60) * 30)

if minutes == 0:
    minutes_angle = 0
else:
    minutes_angle = (minutes / 60) * 360

print(hours_angle, " ", minutes_angle)

time = input()

hh = int(time[:2])
mm = int(time[3:])

if hh > 12:
	r = int(hh)-12
else:
	r = int(hh)

print(r*30+int(mm)/2,mm*6)

l=[int(x) for x in input().split(':')]
a=l[0]
b=l[1]
p=[]
if a==12:
    p.append((b/60)*30)
else:
    p.append((a*30)+(b/60)*30)
if b==0:
    p.append(0)
else:
    p.append(b*6)
for h in p:
	print(h,end=' ')

l=[int(x) for x in input().split(':')]
a=l[0]
b=l[1]
p=[]
if a==12:
    p.append(0)
else:
    p.append((a*30)+(b/60)*30)
if b==0:
    p.append(0)
else:
    p.append(b*6)
for h in p:
	print(h,end=' ')

l=[int(x) for x in input().split(':')]
a=l[0]
b=l[1]
p=[]
p.append((a*30)+(b/60)*30)
p.append(b*6)
for h in p:
	print(h,end=' ')

s=input()
if s[0]=='0':
    h=int(s[1])
else:
    h=int(s[0:2])
if s[3]=='0':
    m=int(s[4])
else:
    m=int(s[3:5])
if h==12:
    h=0
hangle=(h+m/60)*30
mangle=m*6
print(hangle,mangle)

x=input()
min=int(x[3:])
hour=int(x[:2])

if(hour!=12):
	m=min/2
	k=int(min/2)
	if(m==k):
		hour=hour*30+k
	else:
		hour=hour*30+m
	print(hour," ",min*6)
else:
	m=min/2
	k=int(min/2)
	hour=m
	if(m==k):
		hour=k
	print(hour," ",min*6)

hour, minute = map(int, input().split(":"))
if hour != 12:
	hourDegree = (hour / 12)*360
else:
	hourDegree = 0
if minute != 0:
	minuteDegree = (minute/60)*360
else:
	minuteDegree = 0

interval = minute/60 * 30
hourDegree += interval
if int(hourDegree) == hourDegree:
	hourDegree = int(hourDegree)
if int(minuteDegree) == minuteDegree:
	minuteDegree = int(minuteDegree)
print(hourDegree, minuteDegree)

time = input()
h = int(time[0])*10 + int(time[1])
m = int(time[3])*10 + int(time[4])
h = h % 12
angle1 = h*30 + m//2
if m%2 == 1:
    angle1 += 0.5
angle2 = min(360 - m*6, m*6)
print(angle1, angle2)

if __name__ == '__main__':
    ti = input()
    ti = ti.split(':')
    hr = int(ti[0])
    mi = int(ti[1])
    turn_min = 0
    turn_hour = 0
    try:
        turn_min = 360/(60/(mi%60))
    except Exception:
        turn_min = 0

    try:
        turn_hour = (360/(12/(hr%12))) + mi * 0.5
    except Exception:
        turn_hour = 0

    print(turn_hour, turn_min)

if __name__ == '__main__':
    ti = input()
    ti = ti.split(':')
    hr = int(ti[0])
    mi = int(ti[1])
    turn_min = 0
    turn_hour = 0
    if mi % 60 != 0:
        turn_min = 360/(60/(mi%60))
    if hr % 12 != 0:
        turn_hour = (360/(12/(hr%12))) + mi * 0.5

    print(turn_hour, turn_min)

h,minutes=[int(element) for element in input().split(':')]

answer_minutes=minutes/60*360
answer_hours=h/12*360+360/12*minutes/60

print(answer_hours,answer_minutes)

#!/usr/bin/env python2
# -*- coding: utf-8 -*-
import sys
input = sys.stdin
output = sys.stdout

def solve(H,M):
    vh = 360.0 / (12*60)
    vm = 360.0 / (60)
    ah = vh * (H*60+M)
    am = vm * M
    if ah > 360.0 - 0.000000001:
        ah = 0.0
    if am > 360.0 - 0.000000001:
        am = 0.0
    return (ah,am)

T = [int(s) for s in input.readline().strip().split(':')]
H = T[0]
M = T[1]
assert 0<=H and H<=23
assert 0<=M and M<=59

x,y = solve(H,M)
output.write('%.9f\n' % x)
output.write('%.9f\n' % y)

from math import pi

h, m = raw_input().split(':')

h = float(h) % 12
m = float(m)

an_m = m / 60 * 360
an_h = h / 12 * 360 + an_m / 12

print an_h, an_m
print h, m

import sys

def readInt(delimiter) :
    return map(int, raw_input().split(delimiter))

hour, minute = readInt(':')

angle_m = 6 * minute
angle_h = 30.0 * hour + (minute/60.0 * 30.0)

print angle_h, angle_m

#!/usr/bin/python
s = raw_input().split(":")
h,m = int(s[0]),int(s[1])

if h == 12 and m == 0:
    print "0 0"
elif h > 12:
    h = h%12
    print h*30+m*0.5,m*6

import sys
#sys.stdin = open ('input.txt')
#sys.stdout = open ('output.txt', 'w')

h, m = map (float, raw_input ().split (':'))
h += m / 60.
if h not in [12, 0]:
	x = 30. * h
else:
	x = 0
if m not in [12, 0]:
	y = 6. * m
else:
	y = 0

print x, y

import sys
#sys.stdin = open ('input.txt')
#sys.stdout = open ('output.txt', 'w')

h, m = map (float, raw_input ().split (':'))
h += m / 60.
if h not in [24, 0]:
	x = 30. * h
else:
	x = 0
if m not in [60, 0]:
	y = 6. * m
else:
	y = 0

print x, y

import sys
#sys.stdin = open ('input.txt')
#sys.stdout = open ('output.txt', 'w')

h, m = map (float, raw_input ().split (':'))
h += m / 60.
if h not in [12, 24, 0]:
	x = 30. * h
else:
	x = 0
if m not in [60, 0]:
	y = 6. * m
else:
	y = 0

print x, y

import fileinput

line = fileinput.input()
v = line[0].split(':')
hh = float(v[0])
nn = float(v[1])
y = 6 * nn
x = 30 * hh + 1.0 / 12.0 * y
print (str(x) + ' ' + str(y))

import string
import math

n = raw_input()
x = n.split(':')
a = int(x[0])
b = int(x[1])
if(a == 12):
	a = 0
if(b == 60):
	b = 0

if(math.floor(float(a*60+b)/2) == math.ceil(float(a*60+b)/2)):
	a1 = (a*60+b)/2
	a2 = b*6
	print(str(a1)+" "+str(a2))
else:
	a1 = ((a*60+b)/2.0)
	a2 = b*6
	print(str(a1)+" "+str(a2))

import string
import math

n = raw_input()
x = n.split(':')
a = int(x[0])
b = int(x[1])
if(a == 12):
	a = 0
if(b == 60):
	b = 0

if(math.floor(float(a*60+b)/2) == math.ceil(float(a*60+b)/2)):
	a1 = (a*60+b)/2
	a2 = b*6
	print(a1,a2)
else:
	a1 = float(a*60+b)/2
	a2 = b*6
	print(a1[0],a2[0])

s = input().strip()
hour, minute = map(int, s.split(':'))
if hour > 12:
	hour -= 12
hAngle = hour*30 + minute/2
mAngle = 6*minute

if hAngle == 360:
	hAngle = 0

if mAngle > 360:
	mAngle = 0

print(hAngle, mAngle)

import sys
import os
from io import IOBase, BytesIO
# import heapq
import math
# import collections
# import itertools
# import bisect
mod = 10 ** 9 + 7
pie = 3.1415926536
# import resource
# resource.setrlimit(resource.RLIMIT_STACK, [0x100000000, resource.RLIM_INFINITY])
# import threading
# threading.stack_size(2**27)
# import sys
# sys.setrecursionlimit(10**6)
# fact=[1]
# for i in range(1,1000001):
#    fact.append((fact[-1]*i)%mod)
# ifact=[0]*1000001
# ifact[1000000]=pow(fact[1000000],mod-2,mod)
# for i in range(1000000,0,-1):
#    ifact[i-1]=(i*ifact[i])%mod
# from random import randint as rn
# from Queue import Queue as Q

def modinv(n, p):
    return pow(n, p-2, p)

def ncr(n, r, p):  # for using this uncomment the lines calculating fact and ifact
    t = ((fact[n])*((ifact[r]*ifact[n-r]) % p)) % p
    return t

def ain():  # takes array as input
    return list(map(int, sin().split()))

def sin():
    return input().strip()

def GCD(x, y):
    while(y):
        x, y = y, x % y
    return x

def read2DIntArray(row, col):
    arr = []
    for i in range(0, row):
        temp = list(map(int, sin().split()))
        arr.append(temp)

    return arr

def read2DCharArray(row, col):
    arr = []
    for i in range(0, row):
        temp = str(sin())
        arr.append(temp)

    return arr

# Smallest number by rearranging digits of a given number (without trailing zeros):-

def smallestNumber(n):
    lst = list(str(n))
    lst.sort()

    tmp = ""
    for i, n in enumerate(lst):
        if (n != '0'):
            tmp = lst.pop(i)
            break

    return str(tmp) + ''.join(lst)

"""***************************************************************************************"""

def main():
    s = sin()
    hh, mm = map(int, s.split(":"))
    if hh > 12:
        hh = hh - 12
    m = mm * 6
    h = (hh * 30) + ((mm / 60) * 30)

    if hh == 12:
        h = 360 - h

    print(str(h) + " " + str(m))

"""***************************************************************************************"""

# Python 2 and 3 footer by Pajenegod and c1729
py2 = round(0.5)
if py2:
    from future_builtins import ascii, filter, hex, map, oct, zip
    range = xrange

BUFSIZE = 8192

class FastIO(BytesIO):
    newlines = 0

    def __init__(self, file):
        self._file = file
        self._fd = file.fileno()
        self.writable = "x" in file.mode or "w" in file.mode
        self.write = super(FastIO, self).write if self.writable else None

    def _fill(self):
        s = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
        self.seek((self.tell(), self.seek(0, 2),
                   super(FastIO, self).write(s))[0])
        return s

    def read(self):
        while self._fill():
            pass
        return super(FastIO, self).read()

    def readline(self):
        while self.newlines == 0:
            s = self._fill()
            self.newlines = s.count(b"\n") + (not s)
        self.newlines -= 1
        return super(FastIO, self).readline()

    def flush(self):
        if self.writable:
            os.write(self._fd, self.getvalue())
            self.truncate(0), self.seek(0)

class IOWrapper(IOBase):
    def __init__(self, file):
        self.buffer = FastIO(file)
        self.flush = self.buffer.flush
        self.writable = self.buffer.writable
        if py2:
            self.write = self.buffer.write
            self.read = self.buffer.read
            self.readline = self.buffer.readline
        else:
            self.write = lambda s: self.buffer.write(s.encode('ascii'))
            self.read = lambda: self.buffer.read().decode('ascii')
            self.readline = lambda: self.buffer.readline().decode('ascii')

sys.stdin, sys.stdout = IOWrapper(sys.stdin), IOWrapper(sys.stdout)

def input(): return sys.stdin.readline().rstrip('\r\n')

if __name__ == '__main__':
    main()
# threading.Thread(target=main).start()

import sys
import os
from io import IOBase, BytesIO
# import heapq
import math
# import collections
# import itertools
# import bisect
mod = 10 ** 9 + 7
pie = 3.1415926536
# import resource
# resource.setrlimit(resource.RLIMIT_STACK, [0x100000000, resource.RLIM_INFINITY])
# import threading
# threading.stack_size(2**27)
# import sys
# sys.setrecursionlimit(10**6)
# fact=[1]
# for i in range(1,1000001):
#    fact.append((fact[-1]*i)%mod)
# ifact=[0]*1000001
# ifact[1000000]=pow(fact[1000000],mod-2,mod)
# for i in range(1000000,0,-1):
#    ifact[i-1]=(i*ifact[i])%mod
# from random import randint as rn
# from Queue import Queue as Q

def modinv(n, p):
    return pow(n, p-2, p)

def ncr(n, r, p):  # for using this uncomment the lines calculating fact and ifact
    t = ((fact[n])*((ifact[r]*ifact[n-r]) % p)) % p
    return t

def ain():  # takes array as input
    return list(map(int, sin().split()))

def sin():
    return input().strip()

def GCD(x, y):
    while(y):
        x, y = y, x % y
    return x

def read2DIntArray(row, col):
    arr = []
    for i in range(0, row):
        temp = list(map(int, sin().split()))
        arr.append(temp)

    return arr

def read2DCharArray(row, col):
    arr = []
    for i in range(0, row):
        temp = str(sin())
        arr.append(temp)

    return arr

# Smallest number by rearranging digits of a given number (without trailing zeros):-

def smallestNumber(n):
    lst = list(str(n))
    lst.sort()

    tmp = ""
    for i, n in enumerate(lst):
        if (n != '0'):
            tmp = lst.pop(i)
            break

    return str(tmp) + ''.join(lst)

"""***************************************************************************************"""

def main():
    s = sin()
    hh, mm = map(int, s.split(":"))
    m = mm * 6
    h = (hh * 30) + ((mm / 60) * 30)

    if h == 360:
        h = 0.0

    l, r = map(int, str(h).split("."))
    if r == 0:
        h = l

    print(str(h) + " " + str(m))

"""***************************************************************************************"""

# Python 2 and 3 footer by Pajenegod and c1729
py2 = round(0.5)
if py2:
    from future_builtins import ascii, filter, hex, map, oct, zip
    range = xrange

BUFSIZE = 8192

class FastIO(BytesIO):
    newlines = 0

    def __init__(self, file):
        self._file = file
        self._fd = file.fileno()
        self.writable = "x" in file.mode or "w" in file.mode
        self.write = super(FastIO, self).write if self.writable else None

    def _fill(self):
        s = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
        self.seek((self.tell(), self.seek(0, 2),
                   super(FastIO, self).write(s))[0])
        return s

    def read(self):
        while self._fill():
            pass
        return super(FastIO, self).read()

    def readline(self):
        while self.newlines == 0:
            s = self._fill()
            self.newlines = s.count(b"\n") + (not s)
        self.newlines -= 1
        return super(FastIO, self).readline()

    def flush(self):
        if self.writable:
            os.write(self._fd, self.getvalue())
            self.truncate(0), self.seek(0)

class IOWrapper(IOBase):
    def __init__(self, file):
        self.buffer = FastIO(file)
        self.flush = self.buffer.flush
        self.writable = self.buffer.writable
        if py2:
            self.write = self.buffer.write
            self.read = self.buffer.read
            self.readline = self.buffer.readline
        else:
            self.write = lambda s: self.buffer.write(s.encode('ascii'))
            self.read = lambda: self.buffer.read().decode('ascii')
            self.readline = lambda: self.buffer.readline().decode('ascii')

sys.stdin, sys.stdout = IOWrapper(sys.stdin), IOWrapper(sys.stdout)

def input(): return sys.stdin.readline().rstrip('\r\n')

if __name__ == '__main__':
    main()
# threading.Thread(target=main).start()

import sys
import os
from io import IOBase, BytesIO
# import heapq
import math
# import collections
# import itertools
# import bisect
mod = 10 ** 9 + 7
pie = 3.1415926536
# import resource
# resource.setrlimit(resource.RLIMIT_STACK, [0x100000000, resource.RLIM_INFINITY])
# import threading
# threading.stack_size(2**27)
# import sys
# sys.setrecursionlimit(10**6)
# fact=[1]
# for i in range(1,1000001):
#    fact.append((fact[-1]*i)%mod)
# ifact=[0]*1000001
# ifact[1000000]=pow(fact[1000000],mod-2,mod)
# for i in range(1000000,0,-1):
#    ifact[i-1]=(i*ifact[i])%mod
# from random import randint as rn
# from Queue import Queue as Q

def modinv(n, p):
    return pow(n, p-2, p)

def ncr(n, r, p):  # for using this uncomment the lines calculating fact and ifact
    t = ((fact[n])*((ifact[r]*ifact[n-r]) % p)) % p
    return t

def ain():  # takes array as input
    return list(map(int, sin().split()))

def sin():
    return input().strip()

def GCD(x, y):
    while(y):
        x, y = y, x % y
    return x

def read2DIntArray(row, col):
    arr = []
    for i in range(0, row):
        temp = list(map(int, sin().split()))
        arr.append(temp)

    return arr

def read2DCharArray(row, col):
    arr = []
    for i in range(0, row):
        temp = str(sin())
        arr.append(temp)

    return arr

# Smallest number by rearranging digits of a given number (without trailing zeros):-

def smallestNumber(n):
    lst = list(str(n))
    lst.sort()

    tmp = ""
    for i, n in enumerate(lst):
        if (n != '0'):
            tmp = lst.pop(i)
            break

    return str(tmp) + ''.join(lst)

"""***************************************************************************************"""

def main():
    s = sin()
    hh, mm = map(int, s.split(":"))
    hh = hh - 12
    m = mm * 6
    h = (hh * 30) + ((mm / 60) * 30)

    if hh == 12:
        h = 360 - h

    print(str(h) + " " + str(m))

"""***************************************************************************************"""

# Python 2 and 3 footer by Pajenegod and c1729
py2 = round(0.5)
if py2:
    from future_builtins import ascii, filter, hex, map, oct, zip
    range = xrange

BUFSIZE = 8192

class FastIO(BytesIO):
    newlines = 0

    def __init__(self, file):
        self._file = file
        self._fd = file.fileno()
        self.writable = "x" in file.mode or "w" in file.mode
        self.write = super(FastIO, self).write if self.writable else None

    def _fill(self):
        s = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
        self.seek((self.tell(), self.seek(0, 2),
                   super(FastIO, self).write(s))[0])
        return s

    def read(self):
        while self._fill():
            pass
        return super(FastIO, self).read()

    def readline(self):
        while self.newlines == 0:
            s = self._fill()
            self.newlines = s.count(b"\n") + (not s)
        self.newlines -= 1
        return super(FastIO, self).readline()

    def flush(self):
        if self.writable:
            os.write(self._fd, self.getvalue())
            self.truncate(0), self.seek(0)

class IOWrapper(IOBase):
    def __init__(self, file):
        self.buffer = FastIO(file)
        self.flush = self.buffer.flush
        self.writable = self.buffer.writable
        if py2:
            self.write = self.buffer.write
            self.read = self.buffer.read
            self.readline = self.buffer.readline
        else:
            self.write = lambda s: self.buffer.write(s.encode('ascii'))
            self.read = lambda: self.buffer.read().decode('ascii')
            self.readline = lambda: self.buffer.readline().decode('ascii')

sys.stdin, sys.stdout = IOWrapper(sys.stdin), IOWrapper(sys.stdout)

def input(): return sys.stdin.readline().rstrip('\r\n')

if __name__ == '__main__':
    main()
# threading.Thread(target=main).start()

h,m = list(map(int,input().split(':')))
print(h*30+m/2,m*6)

s = raw_input()
h, m = [int(i) for i in s.split(':')]
M = m*6
H = 30*(h % 12) + m*.5
if H:
    print str(H).rstrip('.0'),M
else:
    print '0',M

import math

h,m = map(int,raw_input().replace(':',' ').split())
if h>=12: h=h-12
print int(round(math.degrees(math.pi*h/6+math.pi*m/360))),int(round(math.degrees(math.pi*m/30)))

import math

h,m = map(int,raw_input().replace(':',' ').split())
if h>=12: h=h-12
print int(math.degrees(math.pi*h/6+math.pi*m/360)),int(math.degrees(math.pi*m/30))

#!/usr/bin/python

import sys, os
sys.setrecursionlimit(10000)

def readline():
	return sys.stdin.readline().strip()
def readrow():
	return readline().split(' ')

(h, m) = map(int, readline().split(':'))
h %= 12
print('%.1f %.0f' % (h*30+m/2, m*6))

#!/usr/bin/python

import sys, os
sys.setrecursionlimit(10000)

def readline():
	return sys.stdin.readline().strip()
def readrow():
	return readline().split(' ')

(h, m) = map(int, readline().split(':'))
h %= 12
print(h*360/12+m*360/12/60, m*360/60)

#!/usr/bin/python

import sys, os
sys.setrecursionlimit(10000)

def readline():
	return sys.stdin.readline().strip()
def readrow():
	return readline().split(' ')

(h, m) = map(int, readline().split(':'))
h %= 12
if (m & 1) == 0:
				print(h*30+m//2, m*6)
else:
				print(h*30+m/2, m*6)

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

h, m = (int(i) for i in raw_input().split(':'))

print(str(30 * h + m * 0.5) + ' ' + str(6 * m))

a=raw_input()
v,m=a.split(':')
v=int(v)%12
m=int(m)
print v,m

valpasukt=(((m/60.0) +v)/12)*360
minpasukt =(m/60.0)*360
print valpasukt,minpasukt

'''
Created on 6 Apr 2011

@author: salama
#'''
#in the name of allah
h,m = map(int,raw_input().split(':'))
n = 30
if h == 12:
    angleh = ((m*30)/60.0)
    anglem = m/5.0 * 30.0
    print angleh,anglem
else:
    anglem = m/5.0 * 30.0 if h != 12 else 0
    angleh = (h*30)+((m*30)/60.0)
    print angleh,anglem

'''
Created on 6 Apr 2011

@author: salama
#'''
#in the name of allah
h,m = map(int,raw_input().split(':'))
n = 30
if h == 12:
    angleh = m*30/60.0
    anglem = m/5.0 * 30.0
    print angleh,anglem
else:
    anglem = m/5.0 * 30.0
    angleh = (h*30)+((m*30)/60.0)
    print angleh,anglem

'''
Created on 6 Apr 2011

@author: salama
#'''
#in the name of allah
h,m = map(int,raw_input().split(':'))
n = 30
if h == 12:
    angleh = m*30/60.0
    anglem = m/5.0 * 30.0
    print angleh,anglem
else:
    anglem = m/5.0 * 30.0 if h != 12 else 0
    angleh = (h*30)+((m*30)/60.0)
    print angleh,anglem

'''
Created on 6 Apr 2011

@author: salama
#'''
#in the name of allah
h,m = map(int,raw_input().split(':'))
n = 30
if h == 12:
    anglem = m/5.0 * 30.0
    print 0,anglem
else:
    anglem = m/5.0 * 30.0 if h != 12 else 0
    angleh = (h*30)+((m*30)/60.0)
    print angleh,anglem

#Problem 80B

def input():
	st = raw_input().split(":")
	if(st[0][0] == "0"): st[0] = st[0][1:]
	return (eval(st[0]), eval(st[1]))

def solve():
	h = 0.0
	h, m = input()
	h += float(m) / 60
	return (h * 30, m * 6)

res = solve()
if(res[0] - int(res[0]) > 0): print '%0.1f %i' % res
else: print '%0.0f %i' % res

import sys
text = sys.stdin.readline().strip("\n").split(":")
h = int(text[0]) % 12
m = int(text[1])
print 360 / 12 * h, " ", 360 / 60 * m

time = raw_input()
h = float(time[:time.index(':')])
m = float(time[time.index(':')+1:])
if h == 12:
    x = 0
    y = 0
else:
    x = h*5*6+m/60*30
    y = 360*m/60
    if int(str(x)[str(x).index('.')+1]) == 0:
       x = int(str(x)[:str(x).index('.')])
    if int(str(y)[str(y).index('.')+1]) == 0:
       y = int(str(y)[:str(y).index('.')])
print x,y

time = raw_input()
h = float(time[:time.index(':')])
if h>12:
    h=h-12
m = float(time[time.index(':')+1:])
if h == 12:
    x = 0
    y = 0
else:
    x = h*5*6+m/60*30
    y = 360*m/60
    if int(str(x)[str(x).index('.')+1]) == 0:
       x = int(str(x)[:str(x).index('.')])
    if int(str(y)[str(y).index('.')+1]) == 0:
       y = int(str(y)[:str(y).index('.')])
print x,y