#B4142. Egg Tart Baking Batches

    ID: 11799 Type: Default 1000ms 256MiB

Egg Tart Baking Batches

Egg Tart Baking Batches

QianQ is making egg tarts at home. He uses eggs and milk to prepare the tart filling. The volume of one egg is \(V_{\text{egg}}\), and the volume of one bottle of milk is \(V_{\text{milk}}\). After mixing, the total volume of the tart filling is

[ V_{\text{total}} = e \times V_{\text{egg}} + m \times V_{\text{milk}} ]

where \(e\) is the number of eggs and \(m\) is the number of milk bottles used. Each tart shell can hold \(V_{\text{tart}}\) volume of the filling. Note that if the remaining filling is less than \(V_{\text{tart}}\), you can still bake one tart using the remaining filling.

The oven can bake at most \(t\) tarts in one batch. Determine the minimum number of batches required to bake all the tarts such that all the tart filling is used.

inputFormat

The input consists of a single line containing six space-separated integers:

  • \(V_{\text{egg}}\): the volume of one egg
  • \(V_{\text{milk}}\): the volume of one bottle of milk
  • \(e\): the number of eggs used
  • \(m\): the number of milk bottles used
  • \(V_{\text{tart}}\): the volume required for one tart
  • \(t\): the maximum number of tarts the oven can bake in one batch

outputFormat

Output a single integer, the minimum number of batches required to bake all the tarts.

sample

100 200 2 1 250 2
1