{"trustable":false,"sections":[{"title":"","value":{"format":"HTML","content":"\u003cdiv class\u003d\"ptx\" lang\u003d\"en-US\"\u003e\u003cdiv\u003e\u003cp\u003eYixght is a manager of the company called SzqNetwork(SN). Now she\u0027s very worried because she has just received a bad news which denotes that DxtNetwork(DN), the SN\u0027s business rival, intents to attack the network of SN. More unfortunately, the original network of SN is so weak that we can just treat it as a tree. Formally, there are \u003ci\u003eN\u003c/i\u003e nodes in SN\u0027s network, \u003ci\u003eN\u003c/i\u003e-1 bidirectional channels to connect the nodes, and there always exists a route from any node to another. In order to protect the network from the attack, Yixght builds \u003ci\u003eM\u003c/i\u003e new bidirectional channels between some of the nodes.\u003c/p\u003e\u003cp\u003eAs the DN\u0027s best hacker, you can exactly destory two channels, one in the original network and the other among the \u003ci\u003eM\u003c/i\u003e new channels. Now your higher-up wants to know how many ways you can divide the network of SN into at least two parts.\u003c/p\u003e\u003c/div\u003e\u003c/div\u003e\n\u003cbr\u003e\n传说中的暗之连锁被人们称为Dark。Dark是人类内心的黑暗的产物,古今中外的勇者们都试图打倒它。经过研究,你发现Dark呈现无向图的结构,图中有N个节点和两类边,一类边被称为主要边,而另一类被称为附加边。Dark有N – 1条主要边,并且Dark的任意两个节点之间都存在一条只由主要边构成的路径。另外,Dark还有M条附加边。 你的任务是把Dark斩为不连通的两部分。一开始Dark的附加边都处于无敌状态,你只能选择一条主要边切断。一旦你切断了一条主要边,Dark就会进入防御模式,主要边会变为无敌的而附加边可以被切断。但是你的能力只能再切断 Dark的一条附加边。现在你想要知道,一共有多少种方案可以击败Dark。注意,就算你第一步切断主要边之后就已经把Dark斩为两截,你也需要切断一条附加边才算击败了Dark。\u003cbr\u003e\nInput\u003cbr\u003e\n第一行包含两个整数N和M。 之后N – 1行,每行包括两个整数A和B,表示A和B之间有一条主要边。 之后M行以同样的格式给出附加边。\u003cbr\u003e\nOutput\u003cbr\u003e\n输出一个整数表示答案"}},{"title":"Input","value":{"format":"HTML","content":"\u003cdiv class\u003d\"ptx\" lang\u003d\"en-US\"\u003e\u003cdiv\u003e\u003cp\u003eThe first line of the input file contains two integers: \u003ci\u003eN\u003c/i\u003e (1 ≤ \u003ci\u003eN\u003c/i\u003e ≤ 100 000), \u003ci\u003eM\u003c/i\u003e (1 ≤ \u003ci\u003eM\u003c/i\u003e ≤ 100 000) — the number of the nodes and the number of the new channels.\u003c/p\u003e\u003cp\u003eFollowing \u003ci\u003eN\u003c/i\u003e-1 lines represent the channels in the original network of SN, each pair (\u003ci\u003ea\u003c/i\u003e,\u003ci\u003eb\u003c/i\u003e) denote that there is a channel between node \u003ci\u003ea\u003c/i\u003e and node \u003ci\u003eb\u003c/i\u003e.\u003c/p\u003e\u003cp\u003eFollowing \u003ci\u003eM\u003c/i\u003e lines represent the new channels in the network, each pair (\u003ci\u003ea\u003c/i\u003e,\u003ci\u003eb\u003c/i\u003e) denote that a new channel between node \u003ci\u003ea\u003c/i\u003e and node \u003ci\u003eb\u003c/i\u003e is added to the network of SN.\u003c/p\u003e\u003c/div\u003e\u003c/div\u003e"}},{"title":"Output","value":{"format":"HTML","content":"\u003cdiv class\u003d\"ptx\" lang\u003d\"en-US\"\u003e\u003cp\u003eOutput a single integer — the number of ways to divide the network into at least two parts.\u003c/p\u003e\u003c/div\u003e"}},{"title":"Sample Input","value":{"format":"HTML","content":"\u003cpre class\u003d\"sio\"\u003e4 1\n1 2\n2 3\n1 4\n3 4\n\u003c/pre\u003e"}},{"title":"Sample Output","value":{"format":"HTML","content":"\u003cpre class\u003d\"sio\"\u003e3\u003c/pre\u003e"}}]}