Chopsticks
Time limit1sMemory limit512 MB
Given N kinds of chopsticks in unlimited supply, find how many must be drawn to guarantee R pairs in the worst case.
- Level
Easy3 of 10
- Topics
- Math, Combinatorics, Greedy, Implementation
- Solved
- No attempts yet
Problem
A chopstick holder contains kinds of chopsticks, with plenty of each kind. You draw chopsticks at random from this holder and must form pairs. In the worst case, how many chopsticks must you draw?
Input
Two integers are given.
Output
Print the number of chopsticks that must be drawn in the worst case.