{"trustable":false,"prependHtml":"\u003cscript\u003e window.katexOptions \u003d { disable: true }; \u003c/script\u003e\n\u003cscript type\u003d\"text/x-mathjax-config\"\u003e\n MathJax.Hub.Config({\n tex2jax: {\n inlineMath: [[\u0027$$$\u0027,\u0027$$$\u0027], [\u0027$\u0027,\u0027$\u0027]],\n displayMath: [[\u0027$$$$$$\u0027,\u0027$$$$$$\u0027], [\u0027$$\u0027,\u0027$$\u0027]]\n }\n });\n\u003c/script\u003e\n\u003cscript async src\u003d\"https://mathjax.codeforces.org/MathJax.js?config\u003dTeX-AMS-MML_HTMLorMML\" type\u003d\"text/javascript\"\u003e\u003c/script\u003e","sections":[{"title":"","value":{"format":"HTML","content":"\u003cscript type\u003d\u0027text/x-mathjax-config\u0027\u003eMathJax.Hub.Config({tex2jax: { inlineMath: [[\u0027$\u0027,\u0027$\u0027]] } }); \u003c/script\u003e\n\u003cscript type\u003d\u0027text/javascript\u0027 src\u003d\u0027https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.1/MathJax.js?config\u003dTeX-AMS-MML_HTMLorMML\u0027\u003e\u003c/script\u003e\n\u003cscript type\u003d\u0027text/javascript\u0027\u003esetTimeout(function(){MathJax.Hub.Queue([\u0027Typeset\u0027, MathJax.Hub, \u0027left_view\u0027]);}, 2000);\u003c/script\u003e\n\u003cdiv class\u003d\"panel_content\"\u003e\n Running a taxi station is not all that simple. Apart from the obvious demand for a centralised coordination of the cabs in order to pick up the customers calling to get a cab as soon as possible, there is also a need to schedule all the taxi rides which have been booked in advance. Given a list of all booked taxi rides for the next day, you want to minimise the number of cabs needed to carry out all of the rides. \n \u003cbr\u003e \n \u003cbr\u003eFor the sake of simplicity, we model a city as a rectangular grid. An address in the city is denoted by two integers: the street and avenue number. The time needed to get from the address a, b to c, d by taxi is |a - c| + |b - d| minutes. A cab may carry out a booked ride if it is its first ride of the day, or if it can get to the source address of the new ride from its latest, at least one minute before the new ride’s scheduled departure. Note that some rides may end after midnight. \n \u003cbr\u003e \n\u003c/div\u003e\n\u003cbr\u003e一个城市被划分成200*200的区域。\n\u003cbr\u003e一个人如果在(a,b)点到(c,d),乘出租车需要花费的时间为|c-a|+|d-b|。\n\u003cbr\u003e如果一辆车可以在乘客出发前的1分钟达到,就可以接到该乘客。\n\u003cbr\u003e现在收到了第二天全部订单,你需要规划处最少的出租车,完成所有的任务。\n\u003cbr\u003e你可以认为,每辆出租车的第一位乘客,他一定能准时到达。"}},{"title":"Input","value":{"format":"HTML","content":"On the first line of the input is a single positive integer N, telling the number of test scenarios to follow. Each scenario begins with a line containing an integer M, 0 \u0026lt; M \u0026lt; 500, being the number of booked taxi rides. The following M lines contain the rides. Each ride is described by a departure time on the format hh:mm (ranging from 00:00 to 23:59), two integers a b that are the coordinates of the source address and two integers c d that are the coordinates of the destination address. All coordinates are at least 0 and strictly smaller than 200. The booked rides in each scenario are sorted in order of increasing departure time. \n\u003cbr\u003e\n\u003cbr\u003e第一行一个整数,表示数据组数。\n\u003cbr\u003e每组测试数据,第一行一个整数M,表示请求数量。\n\u003cbr\u003e接下来M行,每行一个时间和两个表示坐标的整数。\n\u003cbr\u003e时间是递增给出的。某些行程可能第二天才能完成。"}},{"title":"Output","value":{"format":"HTML","content":"For each scenario, output one line containing the minimum number of cabs required to carry out all the booked taxi rides. \n\u003cbr\u003e\n\u003cbr\u003e对于每组测试数据,输出一个整数,表示最少的出租车,完成所有的任务。"}},{"title":"Sample Input","value":{"format":"HTML","content":"\u003cpre\u003e2\n2\n08:00 10 11 9 16\n08:07 9 16 10 11\n2\n08:00 10 11 9 16\n08:06 9 16 10 11\u003c/pre\u003e"}},{"title":"Sample Output","value":{"format":"HTML","content":"\u003cpre\u003e1\n2\u003c/pre\u003e"}}]}