# | User | Rating |
---|---|---|

1 | tourist | 3870 |

2 | Benq | 3618 |

3 | Miracle03 | 3453 |

4 | peehs_moorhsum | 3430 |

5 | Radewoosh | 3418 |

6 | Petr | 3408 |

7 | maroonrk | 3387 |

8 | sunset | 3338 |

9 | ko_osaga | 3334 |

9 | jiangly | 3334 |

# | User | Contrib. |
---|---|---|

1 | YouKn0wWho | 214 |

2 | 1-gon | 203 |

3 | Um_nik | 195 |

4 | Errichto | 181 |

5 | awoo | 180 |

6 | tourist | 176 |

7 | sus | 175 |

8 | antontrygubO_o | 173 |

9 | maroonrk | 170 |

10 | SecondThread | 169 |

Hey, anyone using sublime text with no issues for CP, can you please share your settings.

Go to Preferences->Settings

Please share both the files(through drive link, ide link or anyway you like). I will be so grateful to you!

I am facing an issue with spacings while writing code and I am unable to fix the issue after lot of tries.

I use windows.

A marble factory has donated a large box of marbles to a kindergarten. Each marble has one out of $$$M$$$ different colours. The governess needs to divide all the marbles between the $$$N$$$ children in her group. It is acceptable if some children don't get any marbles. However, no child wants marbles of different colours – in other words, all marbles that a child gets need to be the same colour.

The governess also knows that children will be jealous if a child gets too many marbles. As an approximation, we will define the envy level in the group as the largest number of marbles given to one child. Help the governess divide the marbles in order to minimize the envy level.

Input Format:

The first line of input contains two positive integers $$$N$$$, the number of children, and $$$M$$$, the number of different colours.

Each of the following $$$M$$$ lines contains a positive integer, $$$X$$$ denoting number of marbles with that particular colour.

Constraints:

$$$1 ≤ N ≤ 10^{9}$$$

$$$1 ≤ M ≤ 3 . 10^{5}, M ≤ N$$$

$$$1 ≤ X ≤ 10^{9}$$$

Time limit: 1 sec

Output Format: The first and only line of output should contain the minimum possible envy level.

Sample Input:

5 2

7

4

Sample Output:

3

Explanation:

Let's say box contains 4 red marbles (RRRR) and 7 blue marbles (BBBBBBB) which we have to divide between 5 children, we can achieve an envy level of 3 by dividing the marbles in the following way: RR, RR, BB, BB, BBB. This is the lowest achievable envy level.

Please help with your ideas.

Codeforces (c) Copyright 2010-2021 Mike Mirzayanov

The only programming contests Web 2.0 platform

Server time: Dec/08/2021 17:18:09 (k1).

Desktop version, switch to mobile version.

Supported by

User lists

Name |
---|