WOSS Dual Olympiad 2021 J1: Water Classification

View as PDF

Submit solution

Points: 3
Time limit: 2.0s
Memory limit: 256M

Problem type

Water is a substance we interact with daily. It is the only naturally occurring gas that can exist in all three states of matter (ice, water, water vapour) at normal atmospheric conditions. If the water's temperature is below or equal to 0°C, it is in solid form. If it is between 0°C and 100°C, it is in liquid form. Finally, if it is greater than or equal to 100°C, it is in its gaseous state.

Your science teacher has given you the following task: given the temperature of a sample of water, predict its state of matter. You have decided to code a program to do your homework for you.

Input Specification

The input consists of a single line containing a single integer T (-200 \le T \le 200), where T is the temperature of the water sample.

Output Specification

Output a single character indicating the state of the water. Use S to indicate solid, L to indicate liquid, and G to indicate gas.

Sample Input


Sample Output



Water is in liquid form when T is between 0°C and 100°C. 69°C is between 0°C and 100°C, so at T = 69, the water is in liquid form. L is thus the output.


There are no comments at the moment.