Which Number Kind Is It?
Time limit2sMemory limit1024 MB
Given up to 100000 integers N up to 10^6, print O if N is odd, S if N is a perfect square, OS if both, and EMPTY otherwise.
- Level
Easy2 of 10
- Topics
- Math, Implementation
- Solved
- No attempts yet
Problem
There are many number kinds out there, and you probably know some of them already. A few examples:
- Odd number (
O): - Square number (
S):
In this problem, you determine whether a given number is one of these special kinds. Print O if is odd, S if is a perfect square, and OS if is both odd and a perfect square. If is neither, print EMPTY.
Input
The first line contains an integer , the number of test cases. Each of the next lines contains a single integer .
Output
Print lines, one per test case. Each line contains O, S, OS, or EMPTY, as described above.