Virtual Verification Technology
InterviewTime limit1sMemory limit1024 MB
Two researchers split simulations for models A and B, and only the senior can run B, so find the minimum time to finish all of them.
- Level
Easy3 of 10
- Topics
- Brute force, Math
- Solved
- No attempts yet
Problem

Hyundai AutoEver's virtual verification technology virtualizes vehicles, systems, and controllers, and provides a virtual driving environment and verification tools. It lets engineers run function-level verification, cross-function verification, and system-level verification without hardware. Virtual verification secures quality through early verification and simulates adverse conditions that cannot be tested in the real world. As the computing complexity of vehicles grows in the SDV era, virtual verification is an effective way to secure vehicle safety and performance against software quality risks of a different kind.
Dohun, a senior researcher, and Sanghyuk, a new researcher, are in charge of virtual verification for vehicle models and . One virtual verification simulation for model takes time, and one for model takes time. Model needs verification items tested, and model needs items tested. Each simulation tests exactly one verification item.
Dohun is a senior researcher who can run virtual verification for both models and . Sanghyuk is a new researcher who can run verification only for model . Dohun and Sanghyuk each run one simulation at a time, and they cannot simulate the same verification item. They assume no time is needed to prepare the next simulation after finishing one. A simulation cannot be stopped once it starts.
The work is complete when all simulations for both models are finished. Find the minimum time Dohun and Sanghyuk need to complete the virtual verification work.
Input
The first line contains the number of test cases .
From the second line onward, each test case is given on one line as , , , and , separated by spaces. Here and are the time for one simulation of models and , and and are the numbers of verification items for models and .
Output
For each test case, print on its own line the minimum time needed to complete the work.