# https://onlinegdb.com/rk1YAx2JN
# input values:
ar = [ 5, 9, 1, 7, 3]
bu = [10, 13, 9, 10, 6]
tg = sorted( list( zip(ar, bu) ))
print("Process arrival Time, burst Time")
print("{}\n{}\n{}\n".format(ar, bu, tg) )
print("Gantt Chart")
for i in range(len(ar)):
p = tg[i]
s = " "* (p[0]-1) # ar[i], spaces before
s += str( p[0] ) # ar[i], numeric value 1
s += "-"* (p[1]-p[0]-1) # bu[i], graphic line
s += str( p[1] ) # bu[i], numeric value 2
print(s)
'''
Process arrival Time, burst Time
[5, 9, 1, 7, 3]
[10, 13, 9, 10, 6]
[(1, 9), (3, 6), (5, 10), (7, 10), (9, 13)]
Gantt Chart
1-------9
3--6
5----10
7--10
9---13
'''