The digit 0 will represent the end of the data. Using this data, you need to calculate the cheapest cost of the entire route. During an earthquake, one of the warehouses that stores resistors was damaged. Boxes and boxes of resistors fell off their shelves and were mixed together. Acme Electric needs a program to determine the rating of the resistors so they can sort them back into the appropriate boxes.
Resistors are electrical components, which reduce the amount of voltage flowing through a circuit.
In this case, the actual resistance may be anywhere from 45,000,000 to 55,000,000 Ohms. Using the chart below, write a program to calculate the resistance rating and tolerance of a resistor. The input file will contain a number, which represents the total number of bands for each resistor, followed by one band per line. The digit 0 will represent the end of the data.