#P3891. [GDOI2014] 采集资源

    ID: 2828 远端评测题 1000ms 256MiB 尝试: 0 已通过: 0 难度: 7 上传者: 标签>动态规划,dp递推2014各省省选广东背包

[GDOI2014] 采集资源

Output Format

Print a single number: the minimum time when the amount of resources reaches TT.

Note: Unlike in Warcraft III, in Warcraft IV producing workers takes no time. Also, resource collection is not continuous. That is, if a worker’s efficiency is 22, they will harvest 22 resources at time 11, and will not harvest 11 resource at time 0.50.5.

1 1 8
1 1

4
2 1 8
1 1
2 8

3

Hint

  • For 30%30\% of the testdata, N10N \le 10, M,T300M, T \le 300.
  • For 100%100\% of the testdata, N100N \le 100, M,T1000M, T \le 1000, A,B231A, B \le 2^{31}.
  • The testdata guarantees that a solution exists.

Translated by ChatGPT 5