VAR A,B,C:ARRAY[1..100]OF INTEGER;
    N,I,J,K,L,D:INTEGER;
BEGIN
     WRITE('NHAP N= ');READLN(N);WRITELN;
     WRITE('NHAP GIA TRI DAY A: '); WRITELN;
     FOR I:=1 TO N DO
     BEGIN
          WRITE('A[',I,']= ');
          READLN(A[I]);
     END; WRITELN;
     WRITE('DAY VUA NHAP: ');
     FOR I:=1 TO N DO WRITE(A[I]:4); WRITELN;
     WRITE('NHAP K= ');READLN(K); WRITELN;
     J:=1;L:=1;D:=0;
     FOR I:=1 TO N DO
     IF A[I] MOD K = 0 THEN
     BEGIN
          D:=D+1;
          B[J]:=I;
          C[L]:=A[I];
          J:=J+1;
          L:=L+1;
     END;
     IF D<>0 THEN
     BEGIN
          WRITE('SO LUONG PHAN TU CHIA HET: ',D:2);
          WRITELN;
          WRITE('VI TRI CAC PHAN TU: ');
          FOR I:=1 TO D DO WRITE(B[I]:3);WRITELN;
          WRITE('GIA TRI CAC PHAN TU: ');
          FOR I:=1 TO D DO WRITE(C[I]:3);WRITELN;
     END
     ELSE WRITE('KHONG CO PHAN TU NAO CHIA HET CHO ',K);
READLN
END.