300565: CF108A. Palindromic Times

Memory Limit:256 MB Time Limit:2 S
Judge Style:Text Compare Creator:
Submit:0 Solved:0

Description

Palindromic Times

题意翻译

给出一个时间(hh:mm,24小时制),求出下一个回文时间

题目描述

Tattah is asleep if and only if Tattah is attending a lecture. This is a well-known formula among Tattah's colleagues. On a Wednesday afternoon, Tattah was attending Professor HH's lecture. At 12:21, right before falling asleep, he was staring at the digital watch around Saher's wrist. He noticed that the digits on the clock were the same when read from both directions i.e. a palindrome. In his sleep, he started dreaming about such rare moments of the day when the time displayed on a digital clock is a palindrome. As soon as he woke up, he felt destined to write a program that finds the next such moment. However, he still hasn't mastered the skill of programming while sleeping, so your task is to help him.

输入输出格式

输入格式


The first and only line of the input starts with a string with the format "HH:MM" where "HH" is from "00" to "23" and "MM" is from "00" to "59". Both "HH" and "MM" have exactly two digits.

输出格式


Print the palindromic time of day that comes soonest after the time given in the input. If the input time is palindromic, output the soonest palindromic time after the input time.

输入输出样例

输入样例 #1

12:21

输出样例 #1

13:31

输入样例 #2

23:59

输出样例 #2

00:00

Input

题意翻译

给出一个时间(hh:mm,24小时制),求出下一个回文时间

加入题单

上一题 下一题 算法标签: