#K36237. Minimum Operations
Minimum Operations
Minimum Operations
You are given a target number n and a set of distinct integers arr. Your task is to determine the minimum number of operations required to construct a list that contains exactly n elements, such that each element in the list is one of the integers from arr and every integer in arr appears at least once in the list.
Note that an operation consists of appending one element from arr to the list. It turns out that the minimum number of operations is always equal to n, as you can always append one element in each step regardless of the elements available.
Hint: The answer is simply \(n\).
inputFormat
The input is given via stdin and consists of three lines:
- The first line contains a single integer \(n\), the target length of the list.
- The second line contains a single integer \(m\), the number of available integers.
- The third line contains \(m\) space-separated integers representing the set arr.
outputFormat
Output a single integer to stdout -- the minimum number of operations needed, which is equal to \(n\).
## sample5
3
2 1 3
5
</p>