{"trustable":true,"sections":[{"title":"","value":{"format":"HTML","content":"\u003cspan lang\u003d\"en-us\"\u003e\u003cp\u003eDuring the kindergarten days, flymouse was the monitor of his class. Occasionally the head-teacher brought the kids of flymouse’s class a large bag of candies and had flymouse distribute them. All the kids loved candies very much and often compared the numbers of candies they got with others. A kid A could had the idea that though it might be the case that another kid B was better than him in some aspect and therefore had a reason for deserving more candies than he did, he should never get a certain number of candies fewer than B did no matter how many candies he actually got, otherwise he would feel dissatisfied and go to the head-teacher to complain about flymouse’s biased distribution.\u003c/p\u003e\u003cp\u003esnoopy shared class with flymouse at that time. flymouse always compared the number of his candies with that of snoopy’s. He wanted to make the difference between the numbers as large as possible while keeping every kid satisfied. Now he had just got another bag of candies from the head-teacher, what was the largest difference he could make out of it?\u003c/p\u003e\u003c/span\u003e"}},{"title":"Input","value":{"format":"HTML","content":"\u003cp\u003eThe input contains a single test cases. The test cases starts with a line with two integers \u003ci\u003eN\u003c/i\u003e and \u003ci\u003eM\u003c/i\u003e not exceeding 30 000 and 150 000 respectively. \u003ci\u003eN\u003c/i\u003e is the number of kids in the class and the kids were numbered 1 through \u003ci\u003eN\u003c/i\u003e. snoopy and flymouse were always numbered 1 and \u003ci\u003eN\u003c/i\u003e. Then follow \u003ci\u003eM\u003c/i\u003e lines each holding three integers \u003ci\u003eA\u003c/i\u003e, \u003ci\u003eB\u003c/i\u003e and \u003ci\u003ec\u003c/i\u003e in order, meaning that kid \u003ci\u003eA\u003c/i\u003e believed that kid \u003ci\u003eB\u003c/i\u003e should never get over \u003ci\u003ec\u003c/i\u003e candies more than he did.\u003c/p\u003e"}},{"title":"Output","value":{"format":"HTML","content":"\u003cp\u003eOutput one line with only the largest difference desired. The difference is guaranteed to be finite.\u003c/p\u003e"}},{"title":"Sample","value":{"format":"HTML","content":"\u003ctable class\u003d\u0027vjudge_sample\u0027\u003e\n\u003cthead\u003e\n \u003ctr\u003e\n \u003cth\u003eInput\u003c/th\u003e\n \u003cth\u003eOutput\u003c/th\u003e\n \u003c/tr\u003e\n\u003c/thead\u003e\n\u003ctbody\u003e\n \u003ctr\u003e\n \u003ctd\u003e\u003cpre\u003e2 2\r\n1 2 5\r\n2 1 4\u003c/pre\u003e\u003c/td\u003e\n \u003ctd\u003e\u003cpre\u003e5\u003c/pre\u003e\u003c/td\u003e\n \u003c/tr\u003e\n\u003c/tbody\u003e\n\u003c/table\u003e\n"}},{"title":"Hint","value":{"format":"HTML","content":"32-bit signed integer type is capable of doing all arithmetic."}}]}