you operator Centennial Wheel gondolas gondola room people you ability rotate gondolas counterclockwise cost runningcost dollarsyou give array customer length n customersi number new customer arrive ith rotation 0indexed this mean rotate wheel time customersi customer arrive you customer wait room gondola each customer pay boardingcost dollars board gondola close ground exit gondola reach ground againYou stop wheel time include serve customer if decide stop serve customer subsequent rotation free order customer safely note currently customer wait wheel board gondola rest wait rotationreturn minimum number rotation need perform maximize profit if scenario profit positive return 1 example 1input customer 83 boardingcost 5 runningcost 6output 3explanation the number write gondolas number people currently there1 8 customer arrive 4 board 4 wait gondola wheel rotate current profit 4 5 1 6 142 3 customer arrive 4 wait board wheel 3 wait wheel rotate current profit 8 5 2 6 283 the final 3 customer board gondola wheel rotate current profit 11 5 3 6 37the high profit 37 rotate wheel 3 timesexample 2input customer 1096 boardingcost 6 runningcost 4output 7explanation1 10 customer arrive 4 board 6 wait gondola wheel rotate current profit 4 6 1 4 202 9 customer arrive 4 board 11 wait 2 originally wait 9 newly wait wheel rotate current profit 8 6 2 4 403 the final 6 customer arrive 4 board 13 wait wheel rotate current profit 12 6 3 4 604 4 board 9 wait wheel rotate current profit 16 6 4 4 805 4 board 5 wait wheel rotate current profit 20 6 5 4 1006 4 board 1 wait wheel rotate current profit 24 6 6 4 1207 1 board wheel rotate current profit 25 6 7 4 122the high profit 122 rotate wheel 7 timesexample 3input customer 34051 boardingcost 1 runningcost 92output 1explanation1 3 customer arrive 3 board 0 wait wheel rotate current profit 3 1 1 92 892 4 customer arrive 4 board 0 wait wheel rotate current profit 7 1 2 92 1773 0 customer arrive 0 board 0 wait wheel rotate current profit 7 1 3 92 2694 5 customer arrive 4 board 1 wait wheel rotate current profit 11 1 4 92 3575 1 customer arrive 2 board 0 wait wheel rotate current profit 13 1 5 92 447the profit positive return 1 Constraintsn customerslength1 n 1050 customersi 501 boardingcost runningcost 100