M=int(input())
X=int(input())
Y=int(input())
W=int(input())
H=int(input())
answer=0
sideX=0
sideY=0
if ((W+X)//M)==0:
sideX=(W+X)//M
else:
sideX=((W+X)//M)+1
if M>X:
sideX=sideX
else:
if(2*M)>X:
sideX=sideX-1
else:
sideX=sideX-(X//M)
if ((H+Y)//M)==0:
sideY=(H+Y)//M
else:
sideY=((H+Y)//M)+1
if M>Y:
sideY=sideY
else:
if (2*M)>Y:
sideY=sideY-1
else:
sideY=sideY-(Y//M)
answer=sideY*sideX
print(answer)
print(sideX)
print(sideY)