UVa 11313

From Algorithmist
Jump to navigation Jump to search

Problem Number - Problem Name[edit]

  • 11313 - Gourmet Games [1]

Summary[edit]

Total n chefs. m chefs will fight with each other and one chef will be selected in each round. Now you have to calculate how many tournament needed to select a chef for the restaurant.

Explanation[edit]

Just calculate (n-1)/(m-1). If (n-1) will not divisible by (m-1) then cannot do this

Input[edit]

8
10 4
11 4
19 2
100 10
999 32
345 234
10000 12
8 2

Output[edit]

3
cannot do this
18
11
cannot do this
cannot do this
909
7