{"trustable":false,"prependHtml":"\u003cscript\u003e\n window.katexOptions \u003d {\n delimiters: [\n {left: \u0027\\\\(\u0027, right: \u0027\\\\)\u0027, display: false},\n ]\n };\n\u003c/script\u003e\n","sections":[{"title":"","value":{"format":"HTML","content":"\t\u003cscript type\u003d\"text/x-mathjax-config\"\u003e\n\t MathJax.Hub.Config({\n\t extensions: [\"tex2jax.js\"],\n\t jax: [\"input/TeX\", \"output/SVG\"],\n\t tex2jax: {\n\t inlineMath: [ [\u0027$\u0027,\u0027$\u0027], [\"\\\\(\",\"\\\\)\"] ],\n\t displayMath: [ [\u0027$$\u0027,\u0027$$\u0027], [\"\\\\[\",\"\\\\]\"] ],\n\t processEscapes: true\n\t },\n\t });\n\t\u003c/script\u003e\n\t\u003cscript type\u003d\"text/javascript\"\n\t src\u003d\"https://cdn.staticfile.org/mathjax/2.7.0/MathJax.js\"\u003e\n\t\u003c/script\u003e\n \n \u003cp\u003e Suppose there are \u003cvar\u003eN\u003c/var\u003e people in ZJU, whose ages are unknown. We have some messages about them. The \u003cvar\u003ei\u003c/var\u003e-th message shows that the age of person \u003cvar\u003es\u003csub\u003ei\u003c/sub\u003e\u003c/var\u003e is not smaller than the age of person \u003cvar\u003et\u003csub\u003ei\u003c/sub\u003e\u003c/var\u003e. Now we need to divide all these \u003cvar\u003eN\u003c/var\u003e people into several groups. One\u0027s age shouldn\u0027t be compared with each other in the same group, directly or indirectly. And everyone should be assigned to one and only one group. The task is to calculate the minimum number of groups that meet the requirement. \u003c/p\u003e \n \u003cp\u003e \u003c/p\u003e\n 给定n个人,m条信息,每条信息表示为a的年龄不比b的年龄小。现在要把这些人分组,满足组内任意两个人的年龄是不能比较的。"}},{"title":"Input","value":{"format":"HTML","content":"\u003ch4\u003e \n \u003cp\u003e There are multiple test cases. For each test case: The first line contains two integers \u003cvar\u003eN\u003c/var\u003e(1≤ \u003cvar\u003eN\u003c/var\u003e≤ 100000), \u003cvar\u003eM\u003c/var\u003e(1≤ \u003cvar\u003eM\u003c/var\u003e≤ 300000), \u003cvar\u003eN\u003c/var\u003e is the number of people, and \u003cvar\u003eM\u003c/var\u003e is is the number of messages. Then followed by \u003cvar\u003eM\u003c/var\u003e lines, each line contain two integers s\u003csub\u003ei\u003c/sub\u003e and t\u003csub\u003ei\u003c/sub\u003e. There is a blank line between every two cases. Process to the end of input.\u003c/p\u003e \u003c/h4\u003e\n\u003cbr\u003e多组输入数据,第一行两个整数n和m\n\u003c br\u003e接下来m行,表示一条信息。\n"}},{"title":"Output","value":{"format":"HTML","content":"\u003ch4\u003e \n \u003cp\u003e For each the case, print the minimum number of groups that meet the requirement one line. \u003c/p\u003e \n\u003c/h4\u003e\n输出最少的分组。\n \u003ch4"}},{"title":"Sample Input","value":{"format":"HTML","content":"\u003c/h4\u003e \n \u003cpre\u003e4 4\n1 2\n1 3\n2 4\n3 4\n\u003c/pre\u003e \n \u003ch4"}},{"title":"Sample Output","value":{"format":"HTML","content":"\u003c/h4\u003e \n \u003cpre\u003e3\n\u003c/pre\u003e \n \u003ch4"}},{"title":"Hint","value":{"format":"HTML","content":"\u003c/h4\u003e \n \u003cp\u003e set1\u003d {1}, set2\u003d {2, 3}, set3\u003d {4} \u003c/p\u003e \n "}}]}