"""
i ->GroupIndex[0 1 2 3]
t = total trip length for group , measured in nights where 6 ≤ 𝑡 ≤ 18
Y = number of campsites on the river
g = location of group i current campsite(in number form)
l = distance of group i from the source
a = average distance that group should move each day to be on schedule (𝑎 ! = 225 𝑡 ! )
m = maximum distance that group could move
c = comp site position that is grouped with a length same to Y
"""

groups = [0, 1, 2, 3]  # combined with their index

t = [6, 18, 12, 12]  # measured in day
m = [72, 36, 72, 36]
g = [0, 0, 0, 0]
getL = lambda i: g[i] * riverLength / Y

riverLength = 255
Y = 50
n = 0  # day
c = [(n*riverLength)/Y for n in range(1, Y + 1)]  # with a length 25

# calculating the furthest open comp site groups could reach
def getFuthest():
    distence = []
    for i in groups:
        distence.append(m[i] + getL[i])
    maxDistence = max(distence)
    position = 0;
    for j in c:
        if distence > j:
            return j
        else:
            position += 1

# calculating related priority
def getP(i):
    P = (n / t[i]) / (getL[i] / 255)
    return P
def genPlist():
    pList=[0,0,0,0]
    for i in groups:
        pList[i]=getL[i]


while groups!=[]:
