CodechefJun 04, 2025

Bus Seat Numbering

Hazrat Ali

Codechef

There is a bus with 30 seats. The seats are numbered from 1 to 30, and the numbering is as depicted in this image.

As can be seen in the image, the bus is divided into two decks - The Lower deck, and the Upper deck, with 15 seats each. And some of the seats come as Single and some as Double. For example, Seats 1 and 2 are Double, whereas Seat 11 is a Single.

You will be given a Seat number, and your job is to classify it as one of these 4 types:

  • Lower Single
  • Lower Double
  • Upper Single
  • Upper Double

Input Format

  • The first line of input will contain a single integer TT, denoting the number of test cases.
  • Each test case consists of a single line of input which contains a single integers NN — the seat number.

Output Format

For each test case, output on a new line, the type of seat.

Constraints

  • 1≤T≤100
  • 1≤N≤30

Sample 1:

Input
5
6
28
16
13
10
 
Output
Lower Double
Upper Single
Upper Double
Lower Single
Lower Double

Solution
seat = int(input())
for _ in range(seat):
    bus = int(input())
    if  bus<= 10:
        print("Lower Double")
    elif bus <= 15:
        print("Lower Single")
    elif bus <= 25:
        print("Upper Double")
    else:
        print("Upper Single")







 

Comments