program main implicit none integer n,m integer,allocatable,dimension(:)::a read(*,*)n allocate(a(n)) read(*,*)a if(minval(a)==maxval(a).and.a(2)==2*(n-1))then write(*,*)n,0 else m=maxval(a)+2 write(*,*)2*n-m/2,m/2-n endif end program main