Company: AT&T
Difficulty: medium
Given two servers and the time taken to upgrade each server in seconds, denoted by t1 and t2 respectively, in one second, one server undergoes the upgrade process. The servers receive requests at certain time intervals and pause upgrades during those seconds. The servers receive requests at multiples of req1 and req2 respectively. Determine the minimum total time (in seconds) required to upgrade both servers. Notes: Only one server undergoes the upgrade process at any given second. There may be seconds during which no server is undergoing an upgrade. Example req1 = 2 t1 = 3 req2 = 3 t2 = 1 The 1 st server takes 3 seconds to upgrade, and it receives requests on seconds that are multiples of 2. Similarly, the 2 nd server upgrades in 1 second and receives requests on seconds that are multiples of 3. The 1 st server upgrades in the 1 st , 3 rd , and 5 th seconds, while the 2 nd server upgrades in the 2 nd second. Note that none of the numbers from [1, 3, 5] is divisible by req1 = 2. Simila