Metro roams in a city of 20 stations, Starting from Station number 0 to last station 19. It Stops at each station for 1 sec (neglect the time of station switching). A Guy daily waits at station number 11 for the train, your task is to calculate time he has to wait to catch up the train.
First line contains t, test cases.
Each test case consists of an integer (X) and a character (C). X denotes the current position of the metro while C denotes its direction(U for up and D for down) as visible to that Guy.
Note: Where UP denotes that train is going towards last Station and Down denotes the vice versa.
For each test case print the minimum time (in seconds) after which he will be able to catch the metro in a new line.
If you have purchased any course from GeeksforGeeks then please ask your doubt on course discussion forum. You will get quick replies from GFG Moderators there.