#C13066. Vending Machine Simulator

    ID: 42563 Type: Default 1000ms 256MiB

Vending Machine Simulator

Vending Machine Simulator

You are given an amount of money and a vending machine that sells three types of snacks:

  • Soda for \( $5 \)
  • Candy for \( $3 \)
  • Chips for \( $2 \)

Your task is to simulate the vending machine such that the machine always prioritizes purchasing the most expensive snack first. That is, it should try to buy as many sodas as possible, then use the remaining money to buy candy, and finally chips. The machine should output the number of each snack purchased as well as the remaining balance.

For example, if the input is 11, the machine will buy \( \lfloor 11/5 \rfloor = 2 \) sodas, leaving a remainder of \( 11 - 2\times5 = 1 \), and therefore not be able to buy a candy or chips. Hence, the output is:

{"soda": 2, "candy": 0, "chips": 0, "balance": 1}

inputFormat

The input consists of a single line containing an integer \( n \) (\( n \geq 0 \)), which represents the amount of money available.

This input is provided via stdin.

outputFormat

The output should be a JSON object with four keys: soda, candy, chips, and balance. The values corresponding to these keys represent the number of sodas, candies, chips purchased, and the remaining balance, respectively.

This output must be printed to stdout.

## sample
11
{"soda": 2, "candy": 0, "chips": 0, "balance": 1}