P1615 Journey to the West Company
Background
An extremely nonsensical problem.
Description
Here is the story:
After fetching the scriptures from the West, the three disciples—Sun Wukong, Sha Wujing, and Zhu Bajie—entered the School of Economics and Trade at Xiamen University to study economics. After $1$ hour of study, they graduated using special means.
Then, they founded three companies: “Huaguo Mountain Eco-Tourism Resort Group Co.”, “Gao Village Pork Delicacies City Co., Ltd.”, and “Flowing-Sand River Ferry Co., Ltd.” Although these three companies were founded by the disciples of Tang Sanzang, the president of the “Sutra Publishing House”, each company still maintained financial income below $0$ yuan.
So they came up with a boring method: steal from others! Before Sun Wukong comes to steal Zhu Bajie’s frying pan, Zhu Bajie can keep stealing Sha Wujing’s laptops.
Now, as the chief strategist working for Zhu Bajie, you must help the clever yet foolish Zhu Bajie use such improper means to save the company!
You can do this: you already know when Sun Wukong will come to steal Zhu Bajie’s belongings, and when Zhu Bajie will go to steal Sha Wujing’s belongings. You also know that Zhu Bajie can steal $n$ laptops from Sha Wujing per second. Help Zhu Bajie calculate how many laptops he can steal from Sha Wujing within the limited time, so that he has enough time to defend against his senior brother.
Input Format
The first line: a time in the form hour:minute:second, indicating when Zhu Bajie plans to steal Sha Wujing’s laptops.
The second line: a time in the form hour:minute:second, indicating when Sun Wukong plans to steal Zhu Bajie’s frying pan.
**Note: The times may or may not have leading zeros.**
The third line: a single integer $n$, indicating how many laptops Zhu Bajie can steal from Sha Wujing per second.
It is guaranteed that the first time is earlier than the second time.
Output Format
A single integer, indicating how many laptops Zhu Bajie can steal from Sha Wujing.
Explanation/Hint
For $100\%$ of the testdata, the two times are valid, and $n