On the Subject of Waste Management

Fun fact — The amount of food wasted in Singapore is equivalent to every household throwing two bowls of rice away every day, per annum.

This module features eight buttons, four of which are Roman numerals labeled “I", "V", "X", and "L” which have the values of one, five, ten, and fifty respectively, two with the letters “W (waste) and R (recycle)”, and the last two colored red and green respectively. The red button resets the current stage, and the green button submits the answer. Lastly, there is a display which shows, in the order of submission: Paper, Plastic and Metal. Note: Since the module registers single presses, the correct value for 4 would be IIII and not IV. Similarly, IX would be VIIII. Etc.

To solve the module, the defuser needs to waste and recycle the correct amount of paper, plastic, and metal.

Starting from zero for all values, use the following tables to determine the amount of paper, plastic, and metal present. Follow all rules until the end of each table, performing an operation for each material type where necessary.

Paper
Condition Operation Unless:
Is there an IND indicator? Add 19. There are at least five batteries.
Is there an SND indicator? Add 15.
Is there a parallel port? Subtract 44.
Is there a Morse Code related module on the bomb?* Subtract 26. Half of the bomb time has not passed.***
Are there zero batteries on the bomb? Add 154. There are at least three indicators on the bomb.
Does the serial number contain any letters from "SAVE MY WORLD"? Add 200. There are more than two consonants in the serial number.
Plastic
Condition Operation Unless:
Is there a TRN indicator? Add 91. Exactly one strike has already been issued.***
Is there an FRK indicator? Add 69. Exactly two strikes have already been issued.***
Is there an empty port plate? Subtract 17. There are an odd number of modules on the bomb. (including needy modules)
Is there an FRQ indicator? Add 153. There are more D batteries than AA batteries.

Metal
Condition Operation Unless:
Is there a BOB indicator? Add 199.
Is there an MSA indicator? Add 92.
Is there a CAR indicator? Subtract 200. There is an RJ-45 port.
Are there any duplicate ports? Add 153. There is a DVI-D port present.
Is there a SIG indicator? Add 99. The bomb is in the last fifth of time left on the bomb.***
Is there a Forget Me Not module on the bomb? Subtract 84. There is also a lit BOB indicator and at least 6 ports — add 99 instead.

Final Instructions:

At any time the bar on the right becomes empty after completing a stage, IMMEDIATELY press the green button again. Otherwise, a strike will be issued and the module will reset. This cannot occur during stage 4. From all the calculated values, if any of them are negative, make them positive and follow all of the rules below:

  1. If the total sum of paper, plastic, and metal present is higher than 695, recycle everything. Do not progress on to any other stages.
  2. Otherwise, if the amount of metal exceeds 200, recycle three-quarters of the metal and then waste the rest of the metal. Go to rule 4.
  3. Otherwise, if the amount of metal is lower than the amount of paper present, recycle all of the paper, allocate all the plastic to leftovers, waste one quarter of the metal, and recycle half of the leftovers. The other half of the leftovers are not used.
  4. If the amount of plastic is less than 300 and greater than 100, recycle half of the plastic. Go to rule 6.
  5. If the amount of plastic is less than 100 and greater than 10, waste all of the plastic.
  6. If the amount of paper is less than 65, waste one third of the paper, unless instruction 4 was also true — recycle all of the paper instead.
  7. If the amount of leftovers** are less than 300 and greater than 100, recycle them. Otherwise, waste them.

If any value ends up with a decimal, round it to the nearest integer. Subtract your answer for that stage from the amount remaining to calculate the leftovers.

Further notes: Upon submitting an incorrect amount of recycled and/or wasted material, a strike is issued and the module resets. To submit an answer, the defuser must input the amount of recycled or wasted paper and then press the R button to designate it as recycling, or press the W button to designate it as waste. The defuser must then press the green button to confirm their inputted amount of wasted and recycled material. A total of three green button presses are expected. A fourth green button press is expected when there are leftovers.

Upon pressing the red button to reset, the defuser’s input of the material type for that stage will be reset. There will not be a display to show the amount the defuser has entered, so he or she must be wary.

*Morse code modules refer to any module that contain “Morse” in their names and Simon Sends.

**Any materials left after being modified by a rule become leftovers unless another rule refers to them again.

***The bomb time and strikes are taken from the time of the first press of the submit button and is recalculated with every strike on the module.