What Color Is This Star
Time limit1sMemory limit512 MB
Given a starlight wavelength in nm, print the star's color by checking which listed wavelength range it falls into.
- Level
Easy1 of 10
- Topics
- Implementation
- Solved
- No attempts yet
Problem
Star saw a machine with a star inside it. He could not look inside the machine, so he could not see the star directly. The machine had a dial that showed the wavelength of the starlight. Using the wavelength on the dial, Star worked out the color of the star. What color was the star?
The wavelength ranges for each color are as follows.
- Red: 620nm or more and 780nm or less
- Orange: 590nm or more and less than 620nm
- Yellow: 570nm or more and less than 590nm
- Green: 495nm or more and less than 570nm
- Blue: 450nm or more and less than 495nm
- Indigo: 425nm or more and less than 450nm
- Violet: 380nm or more and less than 425nm
Input
The wavelength of the starlight shown on the dial is given. The wavelength is always an integer, measured in .
Output
Print the color of the star. Print "Red" for red, "Orange" for orange, "Yellow" for yellow, "Green" for green, "Blue" for blue, "Indigo" for indigo, or "Violet" for violet.