        implicit real*8 (a-h,o-z)
        dimension kamo(1000),tani(1000), syuu(1000)
        read(*,*) m
        do i=1,m
        print*,'----------------------------------------------'
        read(*,*) num
        print*,'学籍番号：',num
        read(*,*) kamsuu
        print*,'履修科目数',kamsuu
        do j=1,kamsuu
        read(*,*) kamo(j),tani(j),syuu(j)
        end do
!
         call kyouyou(kamsuu,kamo,tani,syuu)
         call kiso(kamsuu,kamo,tani,syuu)
         call senmon(kamsuu,kamo,tani,syuu)
        end do
        end
!
        subroutine kyouyou(kamsuu,kamo,tani,syuu)
        implicit real*8 (a-h,o-z)
        dimension kamo(1000),tani(1000), syuu(1000)
        print*,'***教養教育科目22単位以上必要***'
            ntani=0
        do i=1,kamsuu
         if((kamo(i).ge.5000010).and.(kamo(i).le.5090314)
     &       .and.(syuu(i).eq.1)) then
            ntani=ntani+tani(i)
         end if
        end do
           if(ntani.lt.22) then
            print*,' ■未■'
           end if
            print*,' ',ntani,'単位'
         return
         end
!
!
        subroutine kiso(kamsuu,kamo,tani,syuu)
        implicit real*8 (a-h,o-z)
        dimension kamo(1000),tani(1000), syuu(1000)
        print*,'***基礎教育科目21単位以上必要***'
            ntani=0
        do i=1,kamsuu
         if((kamo(i).ge.5600015).and.(kamo(i).le.5800777)
     &       .and.(syuu(i).eq.1)) then
            ntani=ntani+tani(i)
         end if
        end do
           if(ntani.lt.21) then
            print*,' ■未■'
           end if
            print*,' ',ntani,'単位'
         return
         end
!
!
!
        subroutine senmon(kamsuu,kamo,tani,syuu)
        implicit real*8 (a-h,o-z)
        dimension kamo(1000),tani(1000), syuu(1000)
        print*,'***専門科目81単位以上必要***'
            ntani=0
        do i=1,kamsuu
         if((kamo(i).ge.8061010).and.(kamo(i).le.8066010)
     &       .and.(syuu(i).eq.1)) then
            ntani=ntani+tani(i)
         end if
        end do
           if(ntani.lt.81) then
            print*,' ■未■'
           end if
            print*,' ',ntani,'単位'
         return
         end

!
!