program main implicit none integer::N,total,kame,turu integer,allocatable::a(:) read *, N allocate(a(N)) read *, a total = SUM(a)/(N-1) kame = (total-N*2)/2 turu = (total-kame*4)/2 print '(i0," ",i0)', turu, kame end program