program main implicit none integer::k,n,f,a(100),x=0 ,i read(*,*) k,n,f read(*,*) a(1:f) do i = 1,f x = x + a(i) end do x = k* n - x if(x>= 0) then write(*,*) x else if(x<0) then write(*,*) "-1" end if stop end program main