MYQ1 - The Blind Passenger
The seats of an Ultra Deluxe Semi-sleeper bus in Thuvax country are numbered according to the following rules:
- Seat number 1 is reserved for the bus conductor.
- Remaining seats are numbered as shown in the figure below.
- The seating arrangement is as shown below.
RowNo Left Right W A A M W 01 1 02 03 04 05 06 2 11 10 09 08 07 3 12 13 14 15 16 4 21 20 19 18 17 5 22 ............
A blind person enters the bus with a reservation ticket mentioning his seat number. He meets you at the start of the passage and shows you his ticket. Based on the seat number, help him find his seat by telling him the row number (1, 2 ...), seat position (window or aisle or middle), and the direction (left or right).
Input
First line contains a positive integer t (t <= 105) denoting the number of test cases.
Each of the next t lines contain a positive integer n (n <= 109) denoting the blind person's seat number.
Output
Output one line for every test case in the following format:
- If the seat number is same as the conductor's seat, print "poor conductor"
- else, print
- row_number: represents the row number from the entrance (a positive integer)
- seat_position: can be one of "W" or "A" or "M" for window, aisle and middle respectively.
- direction: can be either "L" or "R" for left or right respectively.
Example
Input: 3 1 2 3 Output: poor conductor 1 W L 1 A L
hide comments
Rajesh Pandey:
2012-07-06 10:54:01
What to give direc for middle??
|
|
Ranker:
2012-06-22 02:54:11
My code didn't get accept with int.......It got accepted with long long!!! |
|
npsabari:
2012-06-18 11:52:54
@surya : how many times u will submit the same solution ?? |
|
Darky:
2012-06-16 09:54:56
use cstdio... |
|
Mr. Rook:
2012-06-02 15:48:38
@kritika what is size of int acc to u?? |
|
Kirtika Ruchandani:
2012-05-31 15:43:27
EDIT: A!{ATO$H: Oops, my bad. Last edit: 2012-06-24 11:49:05 |
|
amit kamboj:
2012-03-30 14:33:18
seat no 5 is on l or r?????because it is in middle(m)... |
|
Prateek Mahajan:
2012-03-29 21:54:23
tle???
|
|
Zhouxing Shi:
2012-03-12 09:14:55
So easy!! |
|
RAJDEEP GUPTA:
2012-03-06 08:43:18
are seat number 4,5,6 on the right??
|
Added by: | jack(chakradarraju) |
Date: | 2012-02-14 |
Time limit: | 0.503s-1s |
Source limit: | 50000B |
Memory limit: | 1536MB |
Cluster: | Cube (Intel G860) |
Languages: | All except: ASM64 |
Resource: | Bytecode 2012 |