The king's birthday dinner was attended by k guests. The dinner was quite a success: every person has eaten several dishes (though the number of dishes was the same for every person) and every dish was served alongside with a new set of kitchen utensils.
All types of utensils in the kingdom are numbered from 1 to 100. It is known that every set of utensils is the same and consist of different types of utensils, although every particular type may appear in the set at most once. For example, a valid set of utensils can be composed of one fork, one spoon and one knife.
After the dinner was over and the guests were dismissed, the king wondered what minimum possible number of utensils could be stolen. Unfortunately, the king has forgotten how many dishes have been served for every guest but he knows the list of all the utensils left after the dinner. Your task is to find the minimum possible number of stolen utensils.
Input
The first line contains two integer numbers n and k (1 ≤ n ≤ 100, 1 ≤ k ≤ 100) — the number of kitchen utensils remaining after the dinner and the number of guests correspondingly.
The next line contains n integers a_1, a_2, …, a_n (1 ≤ a_i ≤ 100) — the types of the utensils remaining. Equal values stand for identical utensils while different values stand for different utensils.
Output
Output a single value — the minimum number of utensils that could be stolen by the guests.
Examples
Input
5 2
1 2 2 1 3
Output
1
Input
10 3
1 3 3 1 3 5 5 5 5 100
Output
14
Note
In the first example it is clear that at least one utensil of type 3 has been stolen, since there are two guests and only one such utensil. But it is also possible that every person received only one dish and there were only six utensils in total, when every person got a set (1, 2, 3) of utensils. Therefore, the answer is 1.
One can show that in the second example at least 2 dishes should have been served for every guest, so the number of utensils should be at least 24: every set contains 4 utensils and every one of the 3 guests gets two such sets. Therefore, at least 14 objects have been stolen. Please note that utensils of some types (for example, of types 2 and 4 in this example) may be not present in the set served for dishes.
Assistant
Other models, same or similar prompt
Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.
We need to understand the problem. There is a dinner with k guests. Every person ate several dishes (same number of dishes for every person). For each dish, a new set of kitchen utensils was served. So each dish corresponds to a set of utensils. All sets are identical: the same composition of utensil types (a set is composed of some types, each type appears at most once in a set). The set consists of different types of utensils (so no duplicate types within a set). For each dish, a new set is used, meaning utensils for each dish are distinct physical items? Actually "served alongside with a new set of kitchen utensils" suggests that for each dish, a fresh set of utensils is provided to the guests. So the total number of utensils used during the dinner equals (number of dishes per person * k) * (size of each set). But careful: Since each dish gets its own set, the total number of utensil objects used is: number_of_dishes_served_per_person * k * S, where S is the size of the set (i.e., number of utensils in a set). However, note that each set is identical in composition (same multiset of types, actually same set of types because each type appears at most once). So overall, for each type t, the total number of utensils of that type used equals (number of sets) * (1 if t is in the set, else 0). Because each set contains at most one of each type. So total utensils of type t used = N_sets * I(t ∈ set).
After dinner, some utensils are left (maybe some were stolen). We are given the list of n utensils that remain, with types. We need to find the minimum possible number of stolen utensils consistent with the scenario. That is, we need to consider possibilities: unknown number of dishes d (positive integer? could be zero? but "every person has eaten several dishes" suggests at least one dish. Several could be one or more. So d >= 1 integer). Unknown set composition: a subset T of {1..100} (since types from 1 to 100). The set must consist of different types (so T is a set). The set is the same for all dishes. Unknown total number of utensils originally present: total_used = d * k * |T|. After dinner, some utensils are left. The rest are stolen. We observe the remaining utensils: a multiset of n utensils with types. The stolen ones are total_used - n (since we assume all original utensils are either left or stolen; none lost otherwise). But we need the minimum possible stolen number consistent with the constraints, meaning we can choose d and T (subject to constraints) to minimize total_used - n, but also the observed remaining utensils must be consistent with some possible original distribution.
Constraints: The original number of utensils of each type t must be at least the number of that type that remained (since only some might have been stolen). And the original number for type t must be exactly dk * (1 if t in T else 0). Because each set has either 0 or 1 of type t; and there are dk sets total (each guest gets d dishes, each dish gets a set). So for each type t, let r_t = count of remaining utensils of type t. Then we need: there exists integer d >= 1 and set T ⊆ [100] such that:
For each t:
if t ∈ T then dk >= r_t (since original number = dk, but careful: if t in T then original count = dk * 1 = dk; if not in T then original count = 0). So if t not in T, then r_t must be 0. If t in T, then r_t ≤ dk (and also original count is exactly dk; but stolen count for type t = dk - r_t). So r_t can be less than dk, some stolen.
But is there any possibility that some utensils of types not in the set could have been present originally? No, because all utensils used are exactly those that come in the sets. The sets consist of certain types. So any utensil of a type not in T cannot have been originally used, so cannot be present among remaining (unless stolen? but stolen means removed; remaining are the ones not stolen, so they must be originally present). Therefore, if we see any remaining utensil of type t, then t must be in T, and original count of that type is dk. So r_t > 0 implies t ∈ T and r_t ≤ dk.
Also, the set T must be the same for all dishes, but it can be any subset (non-empty? The problem doesn't require non-empty; but a set of utensils could be empty? Probably not, but they said "set of utensils is the same and consist of different types of utensils, although every particular type may appear in the set at most once." Usually a set could be empty, but it's strange for a dish to have no utensils. However, "every person has eaten several dishes (though the number of dishes was the same for every person) and every dish was served alongside with a new set of kitchen utensils." That suggests each dish has a set of utensils. It could be that the set is empty? That would mean no utensils for dish, which is odd. But I think we can assume the set is non-empty? Not necessarily needed, but it might affect min stolen. But we can consider |T| >= 1, because otherwise total used = 0, then no utensils could remain; if n>0 impossible. So we need |T| ≥ 1 likely. Also d >=1.
Now we want to minimize total stolen = total_used - n = dk|T| - n, subject to existence of d and T satisfying the constraints above, given the observed counts.
n and k up to 100, types up to 100.
We need to choose d (positive integer) and T (subset of types present? Actually T must include all types for which r_t > 0, because if r_t>0 then t must be in T. Also T can include additional types with r_t = 0. For those types, original count = dk, but none remain (all stolen). That's allowed. So T can be a superset of the set of observed types (call O = {t | r_t > 0}). But T can also be exactly O. However, note that if T contains a type t with r_t = 0, that adds dk utensils to total used, all of which are stolen (since none remain). That would increase total stolen. So to minimize stolen, we would like T to be as small as possible, i.e., exactly O (the set of types observed), because adding extra types only adds more stolen utensils (since all of them would be stolen because none remain). But there might be a twist: d must satisfy that for each t in O, r_t ≤ dk. So d must be at least ceil(r_t / k) for each observed type t. So d_min = max_{t in O} ceil(r_t / k). Also d must be at least 1. So the minimal d we can pick is that value. But also T = O might be the optimal for minimal stolen, because then total_used = d * k * |O|, and stolen = dk*|O| - n. However, maybe choosing a larger d could reduce stolen? Let's examine: stolen = dk|T| - n. If we increase d, total_used increases, so stolen increases. But maybe if we add extra types to T, then we might be forced to increase d? Actually adding extra types does not force larger d (since r_t = 0 for those types, condition is r_t ≤ d*k automatically holds). So we could keep d same. Adding extra types would increase total_used, thus increase stolen. So not beneficial.
But wait: Could we choose T smaller than O? No, because for any observed type t, r_t>0, t must be in T. So T must contain O. So T = O is minimal possible set. So the minimal total_used for a given d is dk|O|, but we also need to satisfy d ≥ ceil(r_t/k) for all t in O. So the minimal total_used overall is achieved by taking d = d_min = max_{t∈O} ceil(r_t/k) and T = O. Then stolen_min = d_min * k * |O| - n.
But is that always valid? Need to check if there is any other constraint: The number of dishes per person is the same and is "several dishes" could be any positive integer. So d ≥ 1 integer. Also, the set of utensils (the composition) is the same for every dish. That's satisfied by our T.
But is there any hidden requirement about the number of utensils per dish? Possibly the set must be non-empty. If O is empty (n=0) then T could be empty? But then no dishes? However d must be at least 1, but if T empty, total_used = 0, which is consistent with no utensils used, but then all guests ate several dishes with no utensils? That seems unrealistic. However n=0 is possible? The problem says n ≥ 1? Input constraints: 1 ≤ n ≤ 100, so n≥1, so O non-empty. So we don't need to worry.
Thus answer seems straightforward: compute counts per type among 1..100, let O be the number of distinct types present? Actually need |O| = number of distinct types among the remaining utensils. Because the set T must include all these types. Then for each type, compute ceil(count[t] / k). Let d_needed = max over types of that value. Then total_original = d_needed * k * (number of distinct types). Then answer = total_original - n.
Example 2: n=10, k=3, list = 1,3,3,1,3,5,5,5,5,100. Counts: type1:2, type3:3, type5:4, type100:1. Distinct types = 4. d_needed: ceil(2/3)=1? Actually 2/3 ceil = 1 (since 1 dish provides up to 3 of each type? Let's compute: If d=1, then each type original count = 1k = 3. For type1 count=2 <=3 ok; type3 count=3 <=3 ok; type5 count=4 >3, so fails; type100 count=1 <=3 ok. So d must be at least ceil(4/3)=2 (since 4/3=1.333 ceil=2). Also type5 count=4, with d=2 gives 23=6 >=4 ok. type3 count=3 <=6 ok. So d_needed = max(ceil(2/3)=1, ceil(3/3)=1, ceil(4/3)=2, ceil(1/3)=1) = 2. total_original = 234=24. stolen = 24-10=14. matches.
Thus the solution seems to be that simple.
But wait, is there any nuance about "every person has eaten several dishes (though the number of dishes was the same for every person)"? That means each guest ate exactly d dishes, where d is same for all guests. But we are free to choose d. The stolen number we compute is the minimum possible. Could there be a scenario where choosing a larger d than necessary and/or adding extra types leads to a lower stolen count? Let's test: stolen = dk|T| - n. If we increase d, stolen increases (since |T| fixed and n fixed). If we add extra types, |T| increases, so stolen increases if d remains same. If we increase d and also reduce |T|? But |T| cannot be less than O. So minimal stolen is with minimal d and minimal |T|, i.e., d = d_min, T = O. So that's minimal.
But wait: Could there be a situation where d_min is not integer? d_min is integer as ceil. So fine.
Is there any scenario where we must consider that the set of utensils must be the same for all dishes, but we don't know the composition. However, what if some type appears with count > d*k for the minimal d? That's not allowed, so we increase d. So that's captured.
But is there any other hidden constraint? Perhaps the number of dishes per person d must be the same for all guests, but we don't know. However, could there be a case where the observed counts are such that for each type t, r_t is a multiple of something? Not necessary. Because we can have stolen utensils, so the original count is exactly dk, and we have r_t ≤ dk. The remaining count can be any number between 0 and d*k inclusive. No further constraints.
Thus answer seems to be computed as described.
Double-check: Could there be a situation where we need to consider that the total number of utensils used must be at least something due to the number of guests? Already covered.
Edge cases: n=1, k=1. Suppose list: [5]. Count: type5:1, distinct=1, d_needed = ceil(1/1)=1, total=111=1, stolen=0. That makes sense: one guest, one dish, set contains type5, all utensils remain, none stolen.
If n=1, k=2, list: [5]. Then distinct=1, d_needed = ceil(1/2)=1 (since 1/2 ceil=1), total=121=2, stolen=2-1=1. That means at least 1 stolen utensil (another type5 missing). Could also have d=1, set {5}, each of 2 guests gets one dish, total 2 type5 utensils, one remains, so one stolen. That's minimal.
If n=2, k=2, list: [5,5] (two type5). Then distinct=1, d_needed = ceil(2/2)=1, total=121=2, stolen=0. That fits.
If n=2, k=2, list: [5,6] distinct=2, counts: both 1. d_needed = max(ceil(1/2)=1, ceil(1/2)=1) =1, total=122=4, stolen=2. Could we do better? Maybe if set includes both 5 and 6, d=1, each guest gets one dish, total 4 utensils, two remain so two stolen. Could we choose d=2? Then total=222=8, more stolen. So 2 is minimal.
If there is a type with count > k, d_min = ceil(count/k). That's okay.
But wait: Could there be a scenario where using a set T that is a superset of O but allows a smaller d? For example, maybe if we include extra types, we might be forced to have larger d? Not forced; but could we reduce d? d is determined by the maximum ceil(r_t/k) over t in T? Actually condition applies only to types in T: we need dk >= r_t for t in T. For t not in T, r_t must be 0 (and they are). So if we add extra types that have r_t=0, there is no lower bound on d from those (since r_t=0 <= dk always). So d remains determined by O. So adding extra types does not reduce d. Therefore minimal stolen uses minimal T.
What about the possibility that the set of utensils (T) must be the same for all dishes, but we might also consider that the number of dishes d could be zero? No, because "every person has eaten several dishes" implies at least one dish.
Thus the answer formula stands.
But wait: The problem statement: "The king's birthday dinner was attended by k guests. The dinner was quite a success: every person has eaten several dishes (though the number of dishes was the same for every person) and every dish was served alongside with a new set of kitchen utensils." It says "several dishes" which could be interpreted as at least one, but could it be zero? Usually several means more than one? In some contexts "several" means more than one. But it's ambiguous. However, they used "several dishes" and then parenthetically "though the number of dishes was the same for every person". The note: "In the first example it is clear that at least one utensil of type 3 has been stolen, since there are two guests and only one such utensil. But it is also possible that every person received only one dish and there were only six utensils in total, when every person got a set (1, 2, 3) of utensils. Therefore, the answer is 1." In that example, they considered d=1 as a possibility. So "several" includes one. So d >=1.
Thus the solution is simple.
But the problem may be more subtle: perhaps the set of utensils could be composed of multiple items of the same type? No, it says "every set of utensils is the same and consist of different types of utensils, although every particular type may appear in the set at most once." So each type appears at most once per set. So the composition is a set of distinct types.
Thus we've solved.
But wait: Could there be an alternative interpretation: That each dish is served with a new set, but each set might be used for multiple guests? No, "every dish was served alongside with a new set of kitchen utensils." Means for each dish served to a guest, a new set is given to that guest? Actually it's ambiguous: If there are multiple guests, each dish (course) might be served to all guests simultaneously, and each guest gets their own set? Typically, each guest gets their own utensils. So likely each guest gets a set per dish. So number of sets = k * d.
Thus answer formula is correct.
Now implement: read n, k; read list of n integers; compute count array size 101 (since types 1..100). Count each occurrence. Compute distinct = number of types with count>0. Compute max_ceil = 0; For each type t from 1 to 100: if count[t] > 0: compute ceil(count[t] / k) = (count[t] + k - 1) // k. Take max. Then total_original = max_ceil * k * distinct. Then answer = total_original - n.
Edge Cases: n up to 100, k up to 100, counts small. Works.
But wait, is there any scenario where we need to consider that the set must consist of different types, but also the number of utensils of each type originally is d*k. But the stolen count could be negative? No, total_original must be at least n. So stolen >=0.
Check with random tests: If all counts are <= k, d_min =1, distinct = m, total = km, stolen = km - n. Could be zero if n = km. That is possible if each type appears exactly k times. But could it be that n < km? That would imply some missing utensils. That's plausible.
But is there any scenario where we might need to choose a larger d to make the stolen count smaller? Suppose we have a type with count > k, so d_min >=2. Could there be a situation where by adding extra types (increasing |T|), we could use a smaller d? For example, maybe we could reinterpret the set to include more types so that the original count for each type is dk, but if we add types, we could maybe shift counts? Actually no, because the observed counts are fixed. The constraint for type t in T is r_t ≤ dk. If we add a type that currently has r_t=0, it doesn't impose any lower bound, so d can stay same. But if we add a type that currently has r_t > 0 (which is already in O) we can't avoid that. So adding types never helps to reduce d. But what if we choose T to be a superset, and then we could have d smaller because the condition for some observed type might be relaxed? No, condition for observed type remains r_t ≤ d*k. That would require d at least ceil(r_t/k). So that remains the same. So d_min is determined solely by O.
But could we choose T as a superset and reduce the product dk|T| - n? For fixed d, |T| larger increases product, so stolen larger. For variable d, maybe if we increase |T| we could decrease d? For example, suppose O = {a,b} with counts: a: 5, b: 1; k=2. d_min = ceil(5/2)=3 (since 5/2=2.5 ceil=3). Then total = 322=12, n=6, stolen=6. What if we add a third type c to T? Then |T|=3, but d could perhaps be smaller? Let's check constraints: For a: 5 ≤ d2 => d>=3; for b: 1 ≤ d2 => d>=1. So d must be at least 3. So d still 3. Then total = 323=18, stolen=12. Worse.
What if we choose T to be only {a}? But then b observed can't be explained because b has count 1>0, so T must include b. So T must include O. So indeed minimal stolen is with T=O and d=d_min.
Thus solution stands.
But let's think about any hidden twist: Could there be an issue with the interpretation of "the list of all the utensils left after the dinner"? That list includes n utensils. It may include multiple identical types. The problem says "Equal values stand for identical utensils while different values stand for different utensils." So each item is a physical utensil with a type. So count is as we used.
Now, let's consider the possibility that the number of dishes per person d might be greater than 0, but not necessarily integer? No, dishes count is integer.
Thus answer is straightforward.
But wait: The problem may be from a contest (like Codeforces) and sometimes such problems have a twist like the set composition might be unknown but we also need to consider that the total number of utensils used must be at least something because of the number of dishes. But we already considered.
Double-check with some edge cases:
Case: n=1, k=100, type=1. Then distinct=1, d_needed=ceil(1/100)=1, total=11001=100, stolen=99. That seems plausible: 100 guests each had at least one dish, each set includes type1, so there were 100 type1 utensils originally, only one remains, so 99 stolen. Could there be a scenario with d=1, T={1}, that works. Could we have d=2? total=200, stolen=199, worse. So minimal stolen=99.
Case: n=100, k=1, all utensils distinct types? Actually list could be 100 different types. Then distinct=100, d_needed = max ceil(count/1)=1 because each count is 1, so total=11100=100, stolen=0. That fits: one guest, one dish, set includes all 100 types, none stolen.
Case: n=100, k=2, all types distinct, each count 1. Then distinct=100, d_needed = max ceil(1/2)=1, total=12100=200, stolen=100. Could there be a better configuration? What if we set d=2? total=22100=400, stolen=300, worse. So minimal stolen=100. But is it possible to have only 100 stolen? With d=1, each guest gets one dish, each dish set includes all 100 types, so total 200 utensils. After dinner, only 100 remain (one of each type). That means 100 are missing. That's plausible. Could we have a scenario where the set includes fewer than 100 types? But then some observed types would not be in T, impossible. So indeed must include all 100.
Now, what about a scenario where there are multiple copies of a type, but the maximum ceil is 1, but number of distinct types is large; total_original = k * distinct. Could it be that the total_original computed is not integer? It is integer.
Thus solution appears correct.
But wait: There is a nuance: The problem says "every set of utensils is the same and consist of different types of utensils, although every particular type may appear in the set at most once." It does not say that the set must contain at least one utensil. But it's fine.
One more thought: Could the sets used for different dishes be identical but maybe not all dishes had the same set? The phrase "every set of utensils is the same" likely means that the composition of the set (which types) is the same for all dishes. Yes.
Thus answer is simple.
But why would the problem be given with constraints up to 100? It is indeed straightforward.
Let's double-check the note in the second example: "One can show that in the second example at least 2 dishes should have been served for every guest, so the number of utensils should be at least 24: every set contains 4 utensils and every one of the 3 guests gets two such sets. Therefore, at least 14 objects have been stolen." That matches our reasoning: distinct types = 4, d = 2, k = 3, total = 234=24, n=10, stolen=14.
Thus solution is correct.
Implementation: read input, compute frequency array of size 101, compute distinct_count and max_ceil. Then answer = max_ceil * k * distinct_count - n. Use integer arithmetic.
Potential pitfalls: Input reading: first line contains n and k. Next line contains n integers. Possibly there may be extra spaces or newlines, but standard reading is fine.
Edge: n=0? Not allowed.
One more nuance: Could the number of dishes per person be 0? If no dishes, then no utensils used, so all remaining utensils must be from something else? But it says every person has eaten several dishes. So d>=1.
Thus final answer.
Let's produce final solution.
But wait, I recall a problem "King's Dinner" maybe from Codeforces? Actually I've seen a problem "The King's Dinner" or something similar. It might have a twist: The set of utensils might be not necessarily all the types that appear, but maybe there could be multiple sets per dish? No.
Let's search memory: There is a Codeforces problem "King's Feast" or "The King's Dinner" from some contest? Possibly 2020? I'm not sure. However, the solution is as described.
But I've seen some people discuss that the answer is max_{t} ( ceil(cnt[t]/k) ) * k * (number of distinct types) - n. That matches.
Thus answer.
Now, I'll write the final answer with explanation.
But before finalizing, I want to test some more cases.
Case: n=4, k=3, utensils: [1,1,1,2] So counts: type1:3, type2:1. Distinct=2. d_needed: ceil(3/3)=1, ceil(1/3)=1 => d=1. total = 132=6, stolen=6-4=2. Could there be d=1, T={1,2}? Yes. Each of 3 guests gets one dish, each set includes 1 and 2. So total utensils: type1:3, type2:3. We have 3 type1 remain, 1 type2 remain, so 2 type2 stolen. That's minimal.
What if we try T={1} only? Not allowed because type2 appears.
So fine.
Now consider scenario where counts for some type exceed k but not by much. Example: k=2, types: [1,1,1] => count1=3. distinct=1. d_needed=ceil(3/2)=2. total=221=4, stolen=1. Could we instead choose d=1 but T includes type1? No, because d=1 gives only 2 type1 utensils originally, but we have 3 remaining, impossible. So d must be at least 2. That's fine.
Now consider scenario with multiple types: k=2, counts: type1=3, type2=1. distinct=2. d_needed: ceil(3/2)=2, ceil(1/2)=1 => d=2. total=222=8, stolen=8-4=4. Could there be a better scenario? Suppose we try to include another type? That would increase total. Suppose we try to set d=2 but T={1,2}? That is same. Could we set d=3? total=12, stolen=8, worse. So 4 is minimal.
But is there any possibility that we could set T={1} only and explain type2? No, because type2 remains. So must include both.
Thus fine.
Now think about possibility of d being zero: Not allowed.
Now think about the phrase "the number of dishes was the same for every person" but we considered d dishes per person. But what if there is also a possibility that the number of dishes per person could be different? The problem states it's the same. So d is common.
Thus solution final.
So answer.
Now provide solution in Python or other language.
I'll write the solution explanation.
But wait, the problem might be from some contest and the intended solution is exactly that. So I'll produce final answer.
But before concluding, let's verify with a corner case where there is a type with zero count but we might need to consider it because it might be part of the set? That would increase stolen, so not minimal.
Thus final answer.
Now output a single integer.
Implementation:
def solve():
import sys
data = sys.stdin.read().split()
if not data: return
it = iter(data)
n = int(next(it))
k = int(next(it))
counts = [0]*101
for _ in range(n):
t = int(next(it))
counts[t] += 1
distinct = 0
max_ceil = 0
for cnt in counts:
if cnt > 0:
distinct += 1
needed = (cnt + k - 1) // k
if needed > max_ceil:
max_ceil = needed
total_original = max_ceil * k * distinct
stolen = total_original - n
print(stolen)
Edge: If n=0? Not needed.
Complexities: O(n+100).
Double-check: Suppose k=100, n=100, all types distinct, each count=1. distinct=100, max_ceil=1, total=1100100=10000, stolen=9900. That seems huge but within constraints? n=100, but total_original could be up to? d up to? ceil(1/100)=1, but distinct=100, so total=10000. That's okay.
Now check if any overflow: Python fine.
Thus final.
But I'll also consider if there is any scenario where the minimal stolen might be negative? No, because total_original >= n is enforced by d selection: For each type, cnt <= dk, so sum(cnt) <= dk * distinct. But sum(cnt) = n. So total_original = dkdistinct >= n. So stolen >=0.
Thus answer is non-negative.
Now I'll produce final solution. ```python
import sys
def solve() -> None:
data = sys.stdin.read().split()
if not data:
return
it = iter(data)
n = int(next(it))
k = int(next(it))
# count occurrences of each type (types are 1..100)
cnt = [0] * 101
for _ in range(n):
t = int(next(it))
cnt[t] += 1
code
distinct = 0 # number of different types that appear
max_ceil = 0 # max over types of ceil(cnt[t] / k)
for c in cnt:
if c > 0:
distinct += 1
needed = (c + k - 1) // k # ceil(c / k)
if needed > max_ceil:
max_ceil = needed
total_original = max_ceil * k * distinct
stolen = total_original - n
print(stolen)