Micro and his Son
Practice
4.5 (2 votes)
Ad Hoc
Data structures
Ready
Approved
Hiring
Easy
Problem
26% Success 3662 Attempts 20 Points 1s Time Limit 256MB Memory 1024 KB Max Code

Our programmer friend Micro just taught his son, Micro Junior, how to read a clock. Few days back he also taught him about palindromes. Now as we know that Micro Junior looks for opportunities to trouble his father, so he started asking him questions. He asked him T questions. In each he gave his father a starting time and an ending time and asked the number of times in between which are palindromes (see sample explanation for more clarity) . Now Micro asked for your help to solve this problem.

Input:
The first line consists of T, the number of questions.
Next T lines consist of a starting time S and an ending time E separated by a space. Time is given in 24-hour format without any colons. (See sample input)

Output:
Print the answer for each question in a new line.

Constraints:
1 ≤ T ≤ 1000
It is assured that every time given is valid. Time starts from 0000 to 2359
SE

Please login to use the editor

You need to be logged in to access the code editor

Loading...

Please wait while we load the editor

Loading...
Results
Custom Input
Run your code to see the output
Submissions
Please login to view your submissions
Similar Problems
Points:20
393 votes
Tags:
Ad-HocApprovedEasyOpenSorting
Points:30
5 votes
Tags:
AlgorithmsApprovedBinary SearchMediumOpenSorting
Points:30
Tags:
OpenOpenOpenImplementationBasic ProgrammingAd-HocEasyapprovedBasics of Implementation