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, 1 Day Ago |
| Questions Answered: | 66690 |
| Tutorials Posted: | 66688 |
MCS,PHD
Argosy University/ Phoniex University/
Nov-2005 - Oct-2011
Professor
Phoniex University
Oct-2001 - Nov-2016
STATEMENT
You are sitting in your class getting bored and wondering how long will it be before you can get back to your room and contine solving the
current long challenge @ codechef. You look at the clock and it shows the time as HH:MM (24-hour format). Just to pass the time you
consider the problem of what maximal time the clock could display S seconds from now.
INPUT
The first line will contain an integer T, denoting the number of test cases.
Each test case contains two lines.
The first line of each test case will contain a string of length four, depicting the current time on the clock, HHMM.
The second line contains an integer S.
1
00
00
00
OUTPUT
For each test case, print one line depicting the maximal time on the clock after S seconds.
EXAMPLE
3
1234
123
1234
120
0000
0
1237
1236
0000
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