Availability

All submissions for this problem are available.
You are scheduling a phone call with a friend who lives in another timezone. You are located in timezone $0$, and your friend is located in timezone $T$ $(0 \leq T < 24)$. Your friend gives you a list of timespecifications, representing the times they are available in their timezone for each day every week. You would like to translate the times to your timezone, while maintaining the same format. In particular, you must output new timespecifications after subtracting $T$ hours from each timespecification and formatting appropriately. ###INPUT: The first line of input contains a single integer $T$ $(0 \leq T < 24)$, the timezone of your friend. Exactly $7$ blocks of lines follow (one for each day of the week, in order, starting with Sundays). Each block starts with a line containing a single integer $k_i$, the number of timespecifications for the $i^{th}$ day ($0 \leq k_i \leq 720$). Then $k_i$ lines follow, each containing the starttime and endtime of a timespecification for that day, separated by a space. All times are of the form `hh:mm` (00 <= `hh` <= 23, 00 <= `mm` <= 59). *Notes:*  The starttime for each timespecification is inclusive, whereas the endtime is _exclusive_. For example, a timespecification `09:15 09:16` starts exactly at 9:15am and is 1 minute long (ending just as 9:16am starts).  All timespecifications for a given day are disjoint, and sorted by starttime.  If two adjacent timespecification meet at a time, they are merged together i.e. if end time of first interval is equal to start time of second interval (on the same day), they will be merged together.  All timespecifications have strictly positive length (they contain at least one minute in them).  When `00:00` is used as a starttime, it corresponds to midnight at the beginning of the day, whereas when `00:00` is used as an endtime, it corresponds to just before midnight at the end of the day. In particular, a timespecification such as `00:00 00:00` starts at midnight at the beginning of the day, and is 24 hours long. (See the sample inputs for clarifications.) ###OUTPUT: Display the timespecifications after subtracting $T$ hours from all timespecifications. You must display exactly 7 blocks of lines (one for each day of the week, in order, starting with Sundays), using the same format as the input. ###Sample Input 1 ``` 12 3 00:00 07:30 08:30 15:30 16:30 00:00 0 0 0 0 0 0 ``` ###Sample Output 1 ``` 2 00:00 03:30 04:30 12:00 0 0 0 0 0 2 12:00 19:30 20:30 00:00 ``` ###Explanation of Sample Input 1 Your friend is located in timezone `12`. They are available:  `[Sundays midnight to 7:30am]`  `[Sundays 8:30am to 3:30pm]`, and  `[Sundays 4:30pm to midnight]`. To translate the time to your timezone, you must subtract `12` hours.  `[Sundays midnight to 7:30am]` becomes `[Saturdays noon to 7:30pm]`.  `[Sundays 8:30am to 3:30pm]` becomes `[Saturdays 8:30pm to Sundays 3:30am]`, and hence gets split into two separate intervals `[Saturdays 8:30pm to midnight]` and `[Sundays midnight to 3:30am]`.  `[Sundays 4:30pm to midnight]` becomes `[Sundays 4:30am to noon]`. ###Sample Input 2 ``` 12 2 00:00 03:30 04:30 12:00 0 0 0 0 0 2 12:00 19:30 20:30 00:00 ``` ###Sample Output 2 ``` 0 0 0 0 0 0 3 00:00 07:30 08:30 15:30 16:30 00:00 ``` ###Explanation of Sample Input 2 This is the _reverse_ of Sample Input 1, but a day earlier. ###Sample Input 3 ``` 6 0 0 0 1 00:00 00:00 0 1 08:12 08:13 0 ``` ###Sample Output 3 ``` 0 0 1 18:00 00:00 1 00:00 18:00 0 1 02:12 02:13 0 ```Author:  dojiboy9 
Tags  dojiboy9 
Date Added:  28122018 
Time Limit:  1 sec 
Source Limit:  50000 Bytes 
Languages:  C, CPP14, JAVA, PYTH, PYTH 3.6, PYPY, CS2, PAS fpc, PAS gpc, RUBY, PHP, GO, NODEJS, HASK, rust, SCALA, swift, D, PERL, FORT, WSPC, ADA, CAML, ICK, BF, ASM, CLPS, PRLG, ICON, SCM qobi, PIKE, ST, NICE, LUA, BASH, NEM, LISP sbcl, LISP clisp, SCM guile, JS, ERL, TCL, kotlin, PERL6, TEXT, SCM chicken, PYP3, CLOJ, COB, FS 
Comments
 Please login at the top to post a comment.
SUCCESSFUL SUBMISSIONS
Fetching successful submissions
HELP
If you are still having problems, see a sample solution here. 