The world’s Largest Sharp Brain Virtual Experts Marketplace Just a click Away
Levels Tought:
Elementary,Middle School,High School,College,University,PHD
| Teaching Since: | May 2017 |
| Last Sign in: | 398 Weeks Ago, 2 Days Ago |
| Questions Answered: | 66690 |
| Tutorials Posted: | 66688 |
MCS,PHD
Argosy University/ Phoniex University/
Nov-2005 - Oct-2011
Professor
Phoniex University
Oct-2001 - Nov-2016
Â
Swapanti was born on the 9th of October, '95. Coincidentally, her best friend was also born on the same day. As a result, she has started liking 9's and 5's a lot. She tries to include it in everything she does. Her email-id has those 2 numbers. Even all the digits of her mobile number are either 9 of 5. She gets her roll number changed if the digits are anything other than 9 and 5. Clearly, she is obsessed with 9's and 5's. Given any number N, she wants to find her next smallest favourite number M greater than N. She is also a bit lazy. Help her in finding M.
Â
Â
First line of the input will consist of T, the number of test cases. Each of the next T lines contains a single number N.
Â
Â
For each test case print Swapanti's next favourite number M, in a new line.
Â
Â
Â
Input: 4 8 58 240 69 Output: 9 59 555 95
Hel-----------lo -----------Sir-----------/Ma-----------dam-----------Tha-----------nk -----------You----------- fo-----------r u-----------sin-----------g o-----------ur -----------web-----------sit-----------e a-----------nd -----------and----------- ac-----------qui-----------sit-----------ion----------- of----------- my----------- po-----------ste-----------d s-----------olu-----------tio-----------n.P-----------lea-----------se -----------pin-----------g m-----------e o-----------n c-----------hat----------- I -----------am -----------onl-----------ine----------- or----------- in-----------box----------- me----------- a -----------mes-----------sag-----------e I----------- wi-----------ll