Logo
(追記) (追記ここまで)

30213번 - April Fools 서브태스크다국어

시간 제한메모리 제한제출정답맞힌 사람정답 비율
1 초 1024 MB497763.636%

문제

On April Fools Day newspapers like to fool their readers by publishing false and usually absurd facts. For example, a fact stating that today Vilnius television tower was brought down by wind.

You are given a range of facts which were published by each of the N different newspapers. These facts are denoted by natural numbers from 1 to F. For example:

  • Newspaper 1: 1, 2, 5
  • Newspaper 2: 2, 3, 4
  • Newspaper 3: 1, 6

You also know that this April Fools Day each of the newspapers published exactly one false fact.

Find the smallest and the biggest number of false facts that could have been published today.

입력

The first line of the input contains two integer numbers separated by a space: the number of newspapers N and the number of facts F.

Facts published by each of the newspapers are described on the remaining 2N lines.

On the 2ith line there is given the number ki – it is the number of facts published by the ith newspaper (1 ≤ ki ≤ F).

On the (2i+ 1)th line there are given ki integer numbers fij separated by spaces, 1 ≤ fij ≤ F, fij < fi(j+1). All of the facts from 1 to F are published at least once by at least one of the newspapers.

출력

On the first and only line, output two numbers separated by space: the smallest and the biggest number of false facts that could have been published that day.

제한

  • 1 ≤ N ≤ 200
  • 1 ≤ F ≤ 20

서브태스크

번호배점제한
120

F ≤ 3

220

N ≤ 3

360

No additional constraints

예제 입력 1

3 6
3
1 2 5
3
2 3 4
2
1 6

예제 출력 1

2 3

There could not have been only one false fact published since there is no single fact that was published by all of the three newspapers.

Therefore, at least two false facts could have been published: 1 and 3, or 2 and 6. At most, there could have been three false facts published. For example: 4, 5 and 6.

힌트

출처

Olympiad > Lithuanian Olympiad in Informatics > Lithuanian Olympiad in Informatics 2016/2017 > National Round (2) > 7-9 Classes ?번

Olympiad > Lithuanian Olympiad in Informatics > Lithuanian Olympiad in Informatics 2016/2017 > National Round (2) > 10-12 Classes ?번

채점 및 기타 정보

  • 예제는 채점하지 않는다.
(追記) (追記ここまで)

출처

대학교 대회

  • 사업자 등록 번호: 541-88-00682
  • 대표자명: 최백준
  • 주소: 서울시 서초구 서초대로74길 29 서초파라곤 412호
  • 전화번호: 02-521-0487 (이메일로 연락 주세요)
  • 이메일: contacts@startlink.io
  • 통신판매신고번호: 제 2017-서울서초-2193 호

AltStyle によって変換されたページ (->オリジナル) /