	program uv3

	implicit none

	parameter	maxn=10

	integer	li,lo,i,inote,nn,ncand,k,in(maxn)
	real	n(100,maxn),c(maxn),tc,tnote,note,total
	real	mir(maxn),miv(maxn),mar(maxn),mav(maxn),d(maxn)
	character*60	fi,fo
	character*24	nom(100)

	li=1
	lo=2

	fi='(1x,i2,4x,i2,4x,i2,4x,i2,4x,i2,4x,i2,4x,i2,4x,a24)'
	fo='(1x,i2,1x,a24,8f6.2,i4)'

	open(1,name='uv3.not',type='old',readonly)
	open(3,name='uv3.coe',type='old',readonly)

	tc=0
	i=0
	do while (.true.)
		i=i+1
c		write(6,'(a,i3,a)')'$2x(reel et voulu),coef,-1 ?'
		read (3,*,end=9)mir(i),miv(i),mar(i),mav(i),c(i),d(i)
		tc=tc+c(i)
	end do
9	nn=i-1

	ncand=0
	do while (.true.)
		ncand=ncand+1
		read (li,fi,end=99)(in(i),i=1,nn),nom(ncand)
		do i=1,nn
			n(ncand,i)=float(in(i))
			if (n(ncand,i).lt.0) n(ncand,i)=d(i)
			n(ncand,i)=miv(i)
	1			+(n(ncand,i)-mir(i))*(mav(i)-miv(i))
	1				/(mar(i)-mir(i))
		end do
	end do
99	continue
	ncand=ncand-1

	tnote=0
	do k=1,ncand
		total=0
		do i=1,nn
			total=total+n(k,i)*c(i)
		end do

		note=total/tc
		tnote=tnote+note

		inote=ifix(note+0.5)
		write (lo,fo)inote,nom(k),(n(k,i),i=1,nn),note,inote

	end do
	write(6,'(a,f7.2)')'moyenne generale :',tnote/ncand

	stop
	end
