Day 1 - West Yellowstone Entrance

Due to overcrowding, the National Park Service runs a lottery of sorts to enter the park. The lottery is based on several conditions:

On the day that you enter the park, the cars are allowed in in the following order during the first hour:

  1. All cars from Utah.
  2. All cars with an annual pass.
  3. License plates that start with ā€œYā€.
  4. Move the first 47 cars to the end of the line.
  5. Every tenth car. Number the cars starting at 1. Let in cars number 10, 20, 30, etc.
  6. License plates that start with ā€œPā€.

There are 200 cars in the test input file. The numbers of cars left in line after each step are 179, 86, 83, 83, 75, and 70.

At the end of the hour, how many cars are still in line?

Input

Test input

Hints

Copyright 2022 Robin A. Reynolds-Haertle