Company: InMobi Glance IITKGP
Difficulty: medium
Minimum Time to Transport All Individuals Problem Description You are given n individuals at a base camp who need to cross a river to reach a destination using a single boat. The boat can carry at most k people at a time. The trip is affected by environmental conditions that vary cyclically over m stages. Each stage j has a speed multiplier mul[j] : If mul[j] > 1 , the trip slows down. If mul[j] , the trip speeds up. Each individual i has a rowing strength represented by time[i] , the time (in minutes) it takes them to cross alone in neutral conditions. Rules: A group g departing at stage j takes time equal to the maximum time[i] among its members, multiplied by mul[j] minutes to reach the destination. After the group crosses the river in time d , the stage advances by floor(d) % m steps. If individuals are left behind, one person must return with the boat. Let r be the index of the returning person, the return takes time[r] * mul[current_stage] , defined as return_time , and the stage