Call for Problems, Round 2

면접 대비

시간 제한1초메모리 제한2048 MB

요약
제안된 n개 문제 중 정확히 k개를 골라 선택한 문제들의 난이도 값이 서로 다른 개수를 최대로 만들고, 그 최댓값을 출력한다.
난이도

보통10점 중 4점

유형
그리디, 정렬, 배열, 구현
정답자
아직 제출이 없습니다

문제

The Call for Problems for the ICPC North America Qualifier (NAQ) has finished, and a number of problems were proposed. The judges voted on the difficulty of each problem. The NAQ this year will feature some number of problems. The NAQ wants to feature problems with as many unique difficulties of possible. Compute the maximum number of unique difficulties attainable.

입력

The first line of input contains two integers nn and kk (1≤k≤n≤501 \le k \le n \le 50). NAQ will use exactly kk problems out of the nn proposed.

Each of the next nn lines contains a single integer dd (1≤d≤501 \le d \le 50). These are the difficulties of the nn problems proposed.

출력

Output a single integer, which is the maximum number of unique difficulties that the NAQ can feature.

예제1

  1. 예제 1

    입력
    20 19
    43
    4
    19
    27
    34
    7
    12
    34
    44
    36
    38
    38
    39
    34
    30
    35
    44
    47
    39
    5
    
    예상 출력
    15