program main implicit none integer*8::DA integer*8,allocatable::a(:) integer*8::b0,b1,b2 integer::i read *,DA allocate(a(0:DA)) read *,a(0:DA) b2 = SUM(a(2:DA:2)) b1 = SUM(a(1:DA:2)) b0 = a(0) if(b2.ne.0) then print '(i0)', 2 print '(i0,1x,i0,1x,i0)', b0,b1,b2 else if(b1.ne.0) then print '(i0)', 1 print '(i0,1x,i0)', b0,b1 else print '(i0)', 0 print '(i0)', b0 end if end program main