BUYING FEED 时间限制: 3000 ms | 内存限制: 65535 KB 难度:4 描述 Farmer John needs to travel to town to pick up K (1 <= K <= 100)pounds of feed. Driving D miles with K pounds of feed in his truck costs D
Buying Torches 思路 初始你有一个木棍,造出 k k k 把火炬需要 k k k 个木棍和 k k k 个煤块,而一个煤块需要 y y y 个木棍,所以需要木棍 k + y ∗ k − 1 k+y∗k−1 k+y∗k−1个,而每次操作你可以获得 x − 1 x−1 x−1 个木棍,所以为了获得木根,需要操作 ⌈ k + y ∗ k − 1 x − 1 ⌉ ⌈\frac