During the indicated time block of 6 PM-4 AM, the movies should go as follows:
Since the G rating movies needs to be shown during the first time block, it would be first at 6 pm until around 8 pm. The NC-17 movie would also need to be LAST and from 2 am to 4 am. That leaves 3 movies left to be shown from around 8 pm to 2 Am, which could be shown in 6 different ways. If we assigned EACH movie a title of A, B or C, you get these different showing possibilities- ABC, ACB, BAC, BCA, CAB, and CBA. Since the first and last movies never change, they would default to the first and last positions while the rest is filled in.