implicit none
real :: l,dl,z
integer :: n,j,x,i,o,b
print *,"横の長さを入力してください"
read *, l
print *,"縦の長さを入力してください"
read *, b
print *,"分割数を入力してください"
read *, n
dl=l/(2*n)    
o=0
do i=1,2*n+1
z=dl*(i-1)
print *,i,",",o,",",o,",",dl*(i-1)
end do
do i=2*n+2,3*n+2
z=2*dl*(i-(2*n+2))
print *,i,",",b/2,",",o,",",2*dl*(i-(2*n+2))
end do
do i=3*n+3,5*n+3
z=dl*(i-(3*n+3))
print *,i,",",b,",",o,",",dl*(i-(3*n+3))
end do
do j=1,n
x=3*n+2*j+1
x=3*n+2*j+3
x=2*j+1
x=2*j-1
x=3*n+2*j+2
x=2*n+j+2
x=2*j
x=2*n+j+1
print *,j,",",3*n+2*j+1,",",3*n+2*j+3,",",2*j+1,",",2*j-1,",",3*n+2*j+2,",",2*n+j+2,",",2*j,",",2*n+j+1,","
end do
end
