Minimal change?

Write a program that reads a sequence of combinations of euro coins, and for each one determines if it the minimum or is not.

Input

Input consists of a sequence of lines. Each line starts with a natural number nn, followed by nn numbers. Each number is 1, 2, 5, 10, 20, 50, 100 or 200.

Output

For each input line, print if is the minimal change or is not, according to the instance. We say that a change is minimal if there is not any combination with less coins that adds the same.

Problem information

Author: Unknown
Translator: Carlos Molina

Generation: 2026-01-25T11:00:05.260Z

© Jutge.org, 2006–2026.
https://jutge.org